Module libc/unistd
libc/unistd
POSIX <unistd.h> — standard symbolic constants and types.
Types
ssize_t
type-alias
ssize_t
off_t
type-alias
off_t
pid_t
type-alias
pid_t
uid_t
type-alias
uid_t
gid_t
type-alias
gid_t
Functions
read
function
fn(fd : int, buf : *(void), count : usize) -> ssize_t
Parameters
| Name | Type | Notes |
|---|---|---|
fd | int | |
buf | *(void) | |
count | usize |
Returns: ssize_t
write
function
fn(fd : int, buf : *(void), count : usize) -> ssize_t
Parameters
| Name | Type | Notes |
|---|---|---|
fd | int | |
buf | *(void) | |
count | usize |
Returns: ssize_t
close
function
fn(fd : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
fd | int |
Returns: int
lseek
function
fn(fd : int, offset : off_t, whence : int) -> off_t
Parameters
| Name | Type | Notes |
|---|---|---|
fd | int | |
offset | off_t | |
whence | int |
Returns: off_t
pipe
function
fn(pipefd : *(int)) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
pipefd | *(int) |
Returns: int
dup
function
fn(oldfd : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
oldfd | int |
Returns: int
dup2
function
fn(oldfd : int, newfd : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
oldfd | int | |
newfd | int |
Returns: int
access
function
fn(pathname : *(char), mode : int) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
pathname | *(char) | |
mode | int |
Returns: int
unlink
function
fn(pathname : *(char)) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
pathname | *(char) |
Returns: int
rmdir
function
fn(pathname : *(char)) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
pathname | *(char) |
Returns: int
chdir
function
fn(path : *(char)) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
path | *(char) |
Returns: int
getcwd
function
fn(buf : *(char), size : usize) -> Option(*(char))
Parameters
| Name | Type | Notes |
|---|---|---|
buf | *(char) | |
size | usize |
Returns: Option(*(char))
fork
function
fn() -> pid_t
Returns: pid_t
execve
function
fn(pathname : *(char), argv : *(*(char)), envp : *(*(char))) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
pathname | *(char) | |
argv | *(*(char)) | |
envp | *(*(char)) |
Returns: int
_exit
function
fn(status : int) -> unit
Parameters
| Name | Type | Notes |
|---|---|---|
status | int |
Returns: unit
getpid
function
fn() -> pid_t
Returns: pid_t
getppid
function
fn() -> pid_t
Returns: pid_t
getuid
function
fn() -> uid_t
Returns: uid_t
geteuid
function
fn() -> uid_t
Returns: uid_t
getgid
function
fn() -> gid_t
Returns: gid_t
getegid
function
fn() -> gid_t
Returns: gid_t
sleep
function
fn(seconds : u32) -> u32
Parameters
| Name | Type | Notes |
|---|---|---|
seconds | u32 |
Returns: u32
usleep
function
fn(usec : u32) -> int
Parameters
| Name | Type | Notes |
|---|---|---|
usec | u32 |
Returns: int
Constants
Value: STDIN_FILENO
Value: STDOUT_FILENO
Value: STDERR_FILENO
Value: R_OK
Value: W_OK
Value: X_OK
Value: F_OK