posix library

Constants

E2BIG → const int
7
EACCES → const int
13
EADDRINUSE → const int
98
EADDRNOTAVAIL → const int
99
EADV → const int
68
EAFNOSUPPORT → const int
97
EAGAIN → const int
11
EALREADY → const int
114
EBADE → const int
52
EBADF → const int
9
EBADFD → const int
77
EBADMSG → const int
74
EBADR → const int
53
EBADRQC → const int
56
EBADSLT → const int
57
EBFONT → const int
59
EBUSY → const int
16
ECANCELED → const int
125
ECHILD → const int
10
ECHRNG → const int
44
ECOMM → const int
70
ECONNABORTED → const int
103
ECONNREFUSED → const int
111
ECONNRESET → const int
104
EDEADLK → const int
35
EDEADLOCK → const int
35
EDESTADDRREQ → const int
89
EDOM → const int
33
EDOTDOT → const int
73
EDQUOT → const int
122
EEXIST → const int
17
EFAULT → const int
14
EFBIG → const int
27
EHOSTDOWN → const int
112
EHOSTUNREACH → const int
113
EHWPOISON → const int
133
EIDRM → const int
43
EILSEQ → const int
84
EINPROGRESS → const int
115
EINTR → const int
4
EINVAL → const int
22
EIO → const int
5
EISCONN → const int
106
EISDIR → const int
21
EISNAM → const int
120
EKEYEXPIRED → const int
127
EKEYREJECTED → const int
129
EKEYREVOKED → const int
128
EL2HLT → const int
51
EL2NSYNC → const int
45
EL3HLT → const int
46
EL3RST → const int
47
ELIBACC → const int
79
ELIBBAD → const int
80
ELIBEXEC → const int
83
ELIBMAX → const int
82
ELIBSCN → const int
81
ELNRNG → const int
48
ELOOP → const int
40
EMEDIUMTYPE → const int
124
EMFILE → const int
24
31
EMSGSIZE → const int
90
EMULTIHOP → const int
72
ENAMETOOLONG → const int
36
ENAVAIL → const int
119
ENETDOWN → const int
100
ENETRESET → const int
102
ENETUNREACH → const int
101
ENFILE → const int
23
ENOANO → const int
55
ENOBUFS → const int
105
ENOCSI → const int
50
ENODATA → const int
61
ENODEV → const int
19
ENOENT → const int
2
ENOEXEC → const int
8
ENOKEY → const int
126
ENOLCK → const int
37
67
ENOMEDIUM → const int
123
ENOMEM → const int
12
ENOMSG → const int
42
ENONET → const int
64
ENOPKG → const int
65
ENOPROTOOPT → const int
92
ENOSPC → const int
28
ENOSR → const int
63
ENOSTR → const int
60
ENOSYS → const int
38
ENOTBLK → const int
15
ENOTCONN → const int
107
ENOTDIR → const int
20
ENOTEMPTY → const int
39
ENOTNAM → const int
118
ENOTRECOVERABLE → const int
131
ENOTSOCK → const int
88
ENOTSUP → const int
95
ENOTTY → const int
25
ENOTUNIQ → const int
76
ENXIO → const int
6
EOPNOTSUPP → const int
95
EOVERFLOW → const int
75
EOWNERDEAD → const int
130
EPERM → const int
1
EPFNOSUPPORT → const int
96
EPIPE → const int
32
EPROTO → const int
71
EPROTONOSUPPORT → const int
93
EPROTOTYPE → const int
91
ERANGE → const int
34
EREMCHG → const int
78
EREMOTE → const int
66
EREMOTEIO → const int
121
ERESTART → const int
85
ERFKILL → const int
132
EROFS → const int
30
ESHUTDOWN → const int
108
ESOCKTNOSUPPORT → const int
94
ESPIPE → const int
29
ESRCH → const int
3
ESRMNT → const int
69
ESTALE → const int
116
ESTRPIPE → const int
86
ETIME → const int
62
ETIMEDOUT → const int
110
ETOOMANYREFS → const int
109
ETXTBSY → const int
26
EUCLEAN → const int
117
EUNATCH → const int
49
EUSERS → const int
87
EWOULDBLOCK → const int
11
EXDEV → const int
18
EXFULL → const int
54
F_LOCK → const int
1
F_OK → const int
0
F_TEST → const int
3
F_TLOCK → const int
2
F_ULOCK → const int
0
L_INCR → const int
1
L_SET → const int
0
L_XTND → const int
2
NULL → const int
0
PATH_MAX → const int
4096
R_OK → const int
4
SEEK_CUR → const int
1
SEEK_END → const int
2
SEEK_SET → const int
0
W_OK → const int
2
X_OK → const int
1

Functions

access(String name, int type) int
Test for access to NAME using the real UID and real GID.
acct(String name) int
Turn accounting on if NAME is an existing file. The system will then write a record for each process as it terminates, to this file. If NAME is NULL, turn accounting off. This call is restricted to the super-user.
alarm(int seconds) int
Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. The function returns the number of seconds remaining until the last alarm scheduled would have signaled, or zero if there wasn't one. There is no return value to indicate an error, but you can set errno' to 0 and check its value after callingalarm', and this might tell you. The signal may come late due to processor scheduling.
brk(Pointer<Void> addr) int
Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set).
chdir(String path) int
Change the process's working directory to PATH.
chown(String filename, int owner, int group) int
Change the owner and group of FILE.
chroot(String path) int
Make PATH be the root directory (the starting point for absolute paths). This call is restricted to the super-user.
close(int fd) int
Close the file descriptor FD. [...]
confstr(int name) String
Get the value of the string-valued system variable NAME.
crypt(Pointer<Int8> key, Pointer<Int8> salt) Pointer<Int8>
One-way hash PHRASE, returning a string suitable for storage in the user database. SALT selects the one-way function to use, and ensures that no two users' hashes are the same, even if they use the same passphrase. The return value points to static storage which will be overwritten by the next call to crypt.
daemon(int nochdir, int noclose) int
Put the program in the background, and dissociate from the controlling terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null.
dup(int fd) int
Duplicate FD, returning a new file descriptor on the same file.
dup2(int fd, int fd2) int
Duplicate FD to FD2, closing FD2 and making it open on the same file.
endusershell() → void
errno() int
The error code set by various library functions.
execl(String path, String arg) int
Execute PATH with all arguments after PATH until a NULL pointer and environment from `environ'.
execle(String path, String arg) int
Execute PATH with all arguments after PATH until a NULL pointer, and the argument after that for environment.
execlp(String file, String arg) int
Execute FILE, searching in the PATH' environment variable if it contains no slashes, with all arguments after FILE until a NULL pointer and environment fromenviron'.
execv(String path, Pointer<Pointer<Int8>> __argv) int
Execute PATH with arguments ARGV and environment from `environ'.
execve(String path, Pointer<Pointer<Int8>> __argv, Pointer<Pointer<Int8>> __envp) int
Replace the current process, executing PATH with arguments ARGV and environment ENVP. ARGV and ENVP are terminated by NULL pointers.
execvp(String file, Pointer<Pointer<Int8>> __argv) int
Execute FILE, searching in the PATH' environment variable if it contains no slashes, with arguments ARGV and environment fromenviron'.
exit(int status) → void
Terminate program execution with the low-order 8 bits of STATUS.
faccessat(int fd, String filename, int type, int flag) int
Test for access to FILE relative to the directory FD is open on. If AT_EACCESS is set in FLAG, then use effective IDs like eaccess', otherwise use real IDs likeaccess'.
fchdir(int fd) int
Change the process's working directory to the one FD is open on.
fchown(int fd, int owner, int group) int
Change the owner and group of the file that FD is open on.
fchownat(int fd, String filename, int owner, int group, int flag) int
Change the owner and group of FILE relative to the directory FD is open on.
fdatasync(int fildes) int
Synchronize at least the data part of a file with the underlying media.
fexecve(int fd, Pointer<Pointer<Int8>> __argv, Pointer<Pointer<Int8>> __envp) int
Execute the file FD refers to, overlaying the running program image. ARGV and ENVP are passed to the new program, as for `execve'.
fork() int
Clone the calling process, creating an exact copy. Return 0 to the new process, and the process ID of the new process to the old process. [...]
fpathconf(int fd, int name) int
Get file-specific configuration about descriptor FD.
fsync(int fd) int
Make all changes done to FD actually appear on disk. [...]
ftruncate(int fd, int length) int
getcwd() String
Get the pathname of the current working directory, and put it in SIZE bytes of BUF. Returns NULL if the directory couldn't be determined or SIZE was too small. If successful, returns BUF. In GNU, if BUF is NULL, an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary.
getdomainname(String name, int len) int
Get and set the NIS (aka YP) domain name, if any. Called just like gethostname' andsethostname'. The NIS domain name is usually the empty string when not using NIS.
getdtablesize() int
Return the maximum number of file descriptors the current process could possibly have.
getegid() int
Get the effective group ID of the calling process.
getentropy(Pointer<Void> buffer, int length) int
Write LENGTH bytes of randomness starting at BUFFER. Return 0 on success or -1 on error.
geteuid() int
Get the effective user ID of the calling process.
getgid() int
Get the real group ID of the calling process.
getgroups(int size, Pointer<Uint32> __list) int
If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written.
gethostid() int
Return identifier for the current host.
gethostname() String
Get the name of the current host. [...]
getlogin() String
Return the login name of the user. [...]
getlogin_r() String
Returns the login name. [...]
getopt(int argc, Pointer<Pointer<Int8>> ___argv, Pointer<Int8> __shortopts) int
getpagesize() int
Return the number of bytes in a page. This is the system's page size, which is not necessarily the same as the hardware page size.
getpass(Pointer<Int8> __prompt) Pointer<Int8>
Prompt with PROMPT and read a string from the terminal without echoing. Uses /dev/tty if possible; otherwise stderr and stdin.
getpgid(int pid) int
getpgrp() int
Get the process group ID of the calling process.
getpid() int
Get the process ID of the calling process.
getppid() int
Get the process ID of the calling process's parent.
getsid(int pid) int
Return the session ID of the given process.
getuid() int
Get the real user ID of the calling process.
getusershell() Pointer<Int8>
Successive calls return the shells listed in `/etc/shells'.
getwd() String
Put the absolute pathname of the current working directory in BUF. If successful, return BUF. If not, put an error message in BUF and return NULL. BUF should be at least PATH_MAX bytes long.
isatty(int fd) int
Return 1 if FD is a valid descriptor associated with a terminal, zero if not.
lchown(String filename, int owner, int group) int
Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed.
Make a link to FROM named TO. [...]
linkat(int __fromfd, String from, int __tofd, String to, int flags) → void
Like link but relative paths in TO and FROM are interpreted relative to FROMFD and TOFD respectively. [...]
lockf(int fd, int cmd, int len) int
lseek(int fd, int offset, int whence) int
nice(int inc) int
Add INC to priority of the current process.
pathconf(String path, int name) int
Get file-specific configuration information about PATH.
pause() int
Suspend the process until a signal arrives. This always returns -1 and sets `errno' to EINTR. [...]
pipe(Pointer<Int32> __pipedes) List<int>
Create a one-way communication channel (pipe). If successful, two file descriptors are stored in PIPEDES; bytes written on PIPEDES1 can be read from PIPEDES0. Returns 0 if successful, -1 if not.
pread(int fd, int nbytes, int offset) List<int>
Read NBYTES and returns 'nbytes' from FD at the given position OFFSET without changing the file pointer. [...]
profil(Pointer<Uint16> __sample_buffer, int size, int offset, int scale) int
Enable statistical profiling, writing samples of the PC into at most SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling is enabled, the system examines the user PC and increments SAMPLE_BUFFER((PC - OFFSET) / 2) * SCALE / 65536. If SCALE is zero, disable profiling. Returns zero on success, -1 on error.
pwrite(int fd, List<int> buf, int offset) int
Write N bytes of BUF to FD at the given position OFFSET without changing the file pointer. Return the number of bytes written [...]
read(int fd, int nbytes) List<int>
Read NBYTES from FD. Returning the bytes read. [...]
Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors.
readlinkat(int fd, String path, Pointer<Int8> buf, int len) → void
Like readlink but a relative PATH is interpreted relative to FD.
revoke(String filename) int
Revoke the access of all descriptors currently open on FILE.
rmdir(String path) → void
Remove the directory PATH. [...]
sbrk(int delta) Pointer<Void>
Increase or decrease the end of accessible data space by DELTA bytes. If successful, returns the address the previous end of data space (i.e. the beginning of the new space, if DELTA > 0); returns (void *) -1 for errors (with errno set).
setdomainname(String name, int len) int
setegid(int gid) → void
Set the effective group ID of the calling process to GID. Throws PosixException if the operation fails.
seteuid(int uid) → void
Set the effective user ID of the calling process to UID.
setgid(int gid) → void
Set the group ID of the calling process to GID. If the calling process is the super-user, set the real and effective group IDs, and the saved set-group-ID to GID; if not, the effective group ID is set to GID. Throws PosixException if the operation fails.
sethostid(int id) int
Set the current machine's Internet number to ID. This call is restricted to the super-user.
sethostname(String name) int
Set the name of the current host to NAME. This call is restricted to the super-user.
setlogin(String name) → void
Set the login name returned by `getlogin'. Throws PosixException if the call fails.
setpgid(int pid, int pgid) int
Set the process group ID of the process matching PID to PGID. If PID is zero, the current process's process group ID is set. If PGID is zero, the process ID of the process is used.
setpgrp() int
Set the process group ID of the calling process to its own PID. This is exactly the same as `setpgid (0, 0)'.
setregid(int rgid, int egid) → void
Set the real group ID of the calling process to RGID, and the effective group ID of the calling process to EGID. Throws PosixException if the operation fails.
setreuid(int ruid, int euid) → void
Set the real user ID of the calling process to RUID, and the effective user ID of the calling process to EUID. Throws PosixException if the operation fails.
setsid() int
Create a new session with the calling process as its leader. The process group IDs of the session and the calling process are set to the process ID of the calling process, which is returned.
setuid(int uid) → void
Set the user ID of the calling process to UID. If the calling process is the super-user, set the real and effective user IDs, and the saved set-user-ID to UID; if not, the effective user ID is set to UID.
setusershell() → void
sleep(int seconds) int
Make the process sleep for SECONDS seconds, or until a signal arrives and is not ignored. The function returns the number of seconds less than SECONDS which it actually slept (thus zero if it slept the full time). If a signal handler does a longjmp' or modifies the handling of the SIGALRM signal while insidesleep' call, the handling of the SIGALRM signal afterwards is undefined. There is no return value to indicate error, but if `sleep' returns SECONDS, it probably didn't work. [...]
Make a symbolic link to FROM named TO. [...]
symlinkat(String from, int tofd, String to) → void
Like symlink but a relative path in TO is interpreted relative to TOFD. [...]
sync_1() → void
Make all changes done to all files actually appear on disk.
syscall(int __sysno) int
Invoke `system call' number SYSNO, passing it the remaining arguments. This is completely system-dependent, and not often useful. [...]
sysconf(int name) int
Get the value of the system variable NAME.
tcgetpgrp(int fd) int
Return the foreground process group ID of FD.
tcsetpgrp(int fd, int pgrp_id) int
Set the foreground process group ID of FD set PGRP_ID.
truncate(String filename, int length) int
ttyname(int fd) String
Return the pathname of the terminal associate with the fd or null if no terminal is associated with the fd [...]
ttyname_r(int fd, Pointer<Int8> buf, int buflen) int
Store at most BUFLEN characters of the pathname of the terminal FD is open on in BUF. Return 0 on success, otherwise an error number.
ttyslot() int
Return the index into the active-logins file (utmp) for the controlling terminal.
ualarm(int value, int interval) int
Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds. If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go off every INTERVAL microseconds thereafter. Returns the number of microseconds remaining before the alarm.
Remove the link NAME.
unlinkat(int fd, String name, int flag) → void
Remove the link NAME relative to FD. [...]
usleep(int useconds) int
Sleep USECONDS microseconds, or until a signal arrives that is not blocked or ignored. [...]
vfork() int
Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is replaced by a call to `execve'. Return 0 to the new child process, Returns the process ID of the new process to the parent process. [...]
vhangup() int
Revoke access permissions to all processes currently communicating with the control terminal, and then send a SIGHUP signal to the process group of the control terminal.
write(int fd, List<int> buf) int
Writes buf to FD. Return the number of bytes written; [...]

Exceptions / Errors

PosixException