Package com.sun.jna.platform.unix
Interface LibCAPI
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.sun.jna.platform.unix.Resource
Resource.Rlimit
-
-
Field Summary
Fields Modifier and Type Field Description static int
HOST_NAME_MAX
-
Fields inherited from interface com.sun.jna.platform.unix.Reboot
RB_AUTOBOOT, RB_DISABLE_CAD, RB_ENABLE_CAD, RB_HALT_SYSTEM, RB_KEXEC, RB_POWER_OFF, RB_SW_SUSPEND
-
Fields inherited from interface com.sun.jna.platform.unix.Resource
RLIMIT_AS, RLIMIT_CORE, RLIMIT_CPU, RLIMIT_DATA, RLIMIT_FSIZE, RLIMIT_LOCKS, RLIMIT_MEMLOCK, RLIMIT_MSGQUEUE, RLIMIT_NICE, RLIMIT_NLIMITS, RLIMIT_NOFILE, RLIMIT_NPROC, RLIMIT_RSS, RLIMIT_RTPRIO, RLIMIT_RTTIME, RLIMIT_SIGPENDING, RLIMIT_STACK
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description int
getdomainname(byte[] name, int len)
int
getdomainname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.getdomainname(byte[], int)int
getegid()
String
getenv(String name)
int
geteuid()
int
getgid()
int
gethostname(byte[] name, int len)
int
gethostname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.gethostname(byte[], int)int
getloadavg(double[] loadavg, int nelem)
The getloadavg() function returns the number of processes in the system run queue averaged over various periods of time.int
getuid()
int
setdomainname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.setdomainname(String, int)int
setdomainname(String name, int len)
int
setegid(int gid)
int
setenv(String name, String value, int overwrite)
Update or add a variable in the environment of the calling process.int
seteuid(int uid)
int
setgid(int gid)
int
sethostname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.sethostname(String, int)int
sethostname(String name, int len)
int
setuid(int uid)
int
unsetenv(String name)
-
-
-
Field Detail
-
HOST_NAME_MAX
static final int HOST_NAME_MAX
- See Also:
- Constant Field Values
-
-
Method Detail
-
getuid
int getuid()
-
geteuid
int geteuid()
-
getgid
int getgid()
-
getegid
int getegid()
-
setuid
int setuid(int uid)
-
seteuid
int seteuid(int uid)
-
setgid
int setgid(int gid)
-
setegid
int setegid(int gid)
-
gethostname
@Deprecated int gethostname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.gethostname(byte[], int)
-
sethostname
@Deprecated int sethostname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.sethostname(String, int)
-
gethostname
int gethostname(byte[] name, int len)
-
sethostname
int sethostname(String name, int len)
-
getdomainname
@Deprecated int getdomainname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.getdomainname(byte[], int)
-
setdomainname
@Deprecated int setdomainname(char[] name, int len)
Deprecated.use com.sun.jna.platform.unix.LibCAPI.setdomainname(String, int)
-
getdomainname
int getdomainname(byte[] name, int len)
-
setdomainname
int setdomainname(String name, int len)
-
getenv
String getenv(String name)
- Parameters:
name
- Environment variable name- Returns:
- Returns the value in the environment, or
null
if there is no match for the name - See Also:
- getenv(3)
-
setenv
int setenv(String name, String value, int overwrite)
Update or add a variable in the environment of the calling process.- Parameters:
name
- Environment variable namevalue
- Required valueoverwrite
- If the environment variable already exists and the value ofoverwrite
is non-zero, the function shall return success and the environment shall be updated. If the environment variable already exists and the value ofoverwrite
is zero, the function shall return success and the environment shall remain unchanged.- Returns:
- Upon successful completion, zero shall be returned. Otherwise,
-1 shall be returned,
errno
set to indicate the error, and the environment shall be unchanged - See Also:
- getenv(3)
-
unsetenv
int unsetenv(String name)
- Parameters:
name
- Environment variable name - If the named variable does not exist in the current environment, the environment shall be unchanged and the function is considered to have completed successfully.- Returns:
- Upon successful completion, zero shall be returned. Otherwise,
-1 shall be returned,
errno
set to indicate the error, and the environment shall be unchanged - See Also:
- getenv(3)
-
getloadavg
int getloadavg(double[] loadavg, int nelem)
The getloadavg() function returns the number of processes in the system run queue averaged over various periods of time. Up to nelem samples are retrieved and assigned to successive elements of loadavg[]. The system imposes a maximum of 3 samples, representing averages over the last 1, 5, and 15 minutes, respectively.- Parameters:
loadavg
- An array of doubles which will be filled with the resultsnelem
- Number of samples to return- Returns:
- If the load average was unobtainable, -1 is returned; otherwise, the number of samples actually retrieved is returned.
- See Also:
- getloadavg(3)
-
-