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

NameTypeNotes
fdint
buf*(void)
countusize

Returns: ssize_t

write function
fn(fd : int, buf : *(void), count : usize) -> ssize_t

Parameters

NameTypeNotes
fdint
buf*(void)
countusize

Returns: ssize_t

close function
fn(fd : int) -> int

Parameters

NameTypeNotes
fdint

Returns: int

lseek function
fn(fd : int, offset : off_t, whence : int) -> off_t

Parameters

NameTypeNotes
fdint
offsetoff_t
whenceint

Returns: off_t

pipe function
fn(pipefd : *(int)) -> int

Parameters

NameTypeNotes
pipefd*(int)

Returns: int

dup function
fn(oldfd : int) -> int

Parameters

NameTypeNotes
oldfdint

Returns: int

dup2 function
fn(oldfd : int, newfd : int) -> int

Parameters

NameTypeNotes
oldfdint
newfdint

Returns: int

access function
fn(pathname : *(char), mode : int) -> int

Parameters

NameTypeNotes
pathname*(char)
modeint

Returns: int

rmdir function
fn(pathname : *(char)) -> int

Parameters

NameTypeNotes
pathname*(char)

Returns: int

chdir function
fn(path : *(char)) -> int

Parameters

NameTypeNotes
path*(char)

Returns: int

getcwd function
fn(buf : *(char), size : usize) -> Option(*(char))

Parameters

NameTypeNotes
buf*(char)
sizeusize

Returns: Option(*(char))

fork function
fn() -> pid_t

Returns: pid_t

execve function
fn(pathname : *(char), argv : *(*(char)), envp : *(*(char))) -> int

Parameters

NameTypeNotes
pathname*(char)
argv*(*(char))
envp*(*(char))

Returns: int

_exit function
fn(status : int) -> unit

Parameters

NameTypeNotes
statusint

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

NameTypeNotes
secondsu32

Returns: u32

usleep function
fn(usec : u32) -> int

Parameters

NameTypeNotes
usecu32

Returns: int

Constants

STDIN_FILENO constant int

Value: STDIN_FILENO

STDOUT_FILENO constant int

Value: STDOUT_FILENO

STDERR_FILENO constant int

Value: STDERR_FILENO

R_OK constant int

Value: R_OK

W_OK constant int

Value: W_OK

X_OK constant int

Value: X_OK

F_OK constant int

Value: F_OK