Modifier and Type | Interface and Description |
---|---|
static class |
LibCAPI.size_t
This is an unsigned integer type used to represent the sizes of objects.
|
static class |
LibCAPI.ssize_t
This is a signed integer type used for a count of bytes or an error
indication.
|
Resource.Rlimit
Modifier and Type | Field and Description |
---|---|
static int |
HOST_NAME_MAX |
RB_AUTOBOOT, RB_DISABLE_CAD, RB_ENABLE_CAD, RB_HALT_SYSTEM, RB_KEXEC, RB_POWER_OFF, RB_SW_SUSPEND
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
Modifier and Type | Method and Description |
---|---|
int |
close(int fd)
Closes a file descriptor, so that it no longer refers to any file and may be
reused.
|
int |
getdomainname(byte[] name,
int len) |
int |
getegid() |
java.lang.String |
getenv(java.lang.String name) |
int |
geteuid() |
int |
getgid() |
int |
gethostname(byte[] name,
int len) |
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 |
msync(Pointer addr,
LibCAPI.size_t length,
int flags)
Flushes changes made to the in-core copy of a file that was mapped into
memory using
LibCUtil.mmap(Pointer, long, int, int, int, long) back
to the filesystem. |
int |
munmap(Pointer addr,
LibCAPI.size_t length)
Deletes the mappings for the specified address range, and causes further
references to addresses within the range to generate invalid memory
references.
|
int |
setdomainname(java.lang.String name,
int len) |
int |
setegid(int gid) |
int |
setenv(java.lang.String name,
java.lang.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(java.lang.String name,
int len) |
int |
setuid(int uid) |
int |
unsetenv(java.lang.String name) |
static final int HOST_NAME_MAX
int getuid()
int geteuid()
int getgid()
int getegid()
int setuid(int uid)
int seteuid(int uid)
int setgid(int gid)
int setegid(int gid)
int gethostname(byte[] name, int len)
int sethostname(java.lang.String name, int len)
int getdomainname(byte[] name, int len)
int setdomainname(java.lang.String name, int len)
java.lang.String getenv(java.lang.String name)
name
- Environment variable namenull
if there
is no match for the nameint setenv(java.lang.String name, java.lang.String value, int overwrite)
name
- Environment variable namevalue
- Required valueoverwrite
- If the environment variable already exists and the
value of overwrite
is non-zero, the function shall return
success and the environment shall be updated. If the environment
variable already exists and the value of overwrite
is zero, the
function shall return success and the environment shall remain unchanged.errno
set to indicate the error, and the
environment shall be unchangedint unsetenv(java.lang.String name)
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.errno
set to indicate the error, and the
environment shall be unchangedint getloadavg(double[] loadavg, int nelem)
loadavg
- An array of doubles which will be filled with the resultsnelem
- Number of samples to returnint close(int fd)
If fd
is the last file descriptor referring to the underlying open
file description, the resources associated with the open file description are
freed; if the file descriptor was the last reference to a file which has been
removed using unlink
, the file is deleted.
fd
- a file descriptorerrno
is set appropriately.
close()
should not be retried after an error.
int msync(Pointer addr, LibCAPI.size_t length, int flags)
LibCUtil.mmap(Pointer, long, int, int, int, long)
back
to the filesystem. Without use of this call, there is no guarantee that
changes are written back before munmap(Pointer, size_t)
is called.
To be more precise, the part of the file that corresponds to the memory area
starting at addr
and having length length
is updated.addr
- The start of the memory area to sync to the filesystem.length
- The length of the memory area to sync to the filesystem.flags
- The flags argument should specify exactly one of MS_ASYNC
and MS_SYNC
, and may additionally include the
MS_INVALIDATE
bit.errno
is set appropriately.int munmap(Pointer addr, LibCAPI.size_t length)
It is not an error if the indicated range does not contain any mapped pages.
addr
- The base address from which to delete mappings. The address addr
must be a multiple of the page size (but length need not be).length
- The length from the base address to delete mappings. All pages
containing a part of the indicated range are unmapped, and
subsequent references to these pages will generate
SIGSEGV
.errno
is set to indicate the cause of the error (probably to
EINVAL
).