Expand description
Safe wrappers around functions found in libc “unistd.h” header
Modules§
- alarm
- Alarm signal scheduling.
Structs§
- Access
Flags - Options for access()
- Gid
- Group identifier
- Group
- Representation of a Group, based on
libc::group
- Pid
- Process identifier
- Uid
- User identifier
- User
- Representation of a User, based on
libc::passwd
Enums§
- Fork
Result - Represents the successful result of calling
fork
- Pathconf
Var - Variable names for
pathconf
- Sysconf
Var - Variable names for
sysconf
- Unlinkat
Flags - Flags for
unlinkat
function. - Whence
- Directive that tells
lseek
andlseek64
what the offset is relative to.
Constants§
- ROOT
- Constant for UID = 0
Functions§
- access
- Checks the file named by
path
for accessibility according to the flags given byamode
See access(2) - chdir
- Change the current working directory of the calling process (see chdir(2)).
- chown
- Change the ownership of the file at
path
to be owned by the specifiedowner
(user) andgroup
(see chown(2)). - close
- Close a raw file descriptor
- dup
- Create a copy of the specified file descriptor (see dup(2)).
- dup2
- Create a copy of the specified file descriptor using the specified fd (see dup(2)).
- dup3
- Create a new copy of the specified file descriptor using the specified fd
and flags (see
dup(2)
). - execv
- Replace the current process image with a new one (see exec(3)).
- execve
- Replace the current process image with a new one (see execve(2)).
- execvp
- Replace the current process image with a new one and replicate shell
PATH
searching behavior (see exec(3)). - faccessat
- Checks the file named by
path
for accessibility according to the flags given bymode
- fchown
- Change the ownership of the file referred to by the open file descriptor
fd
to be owned by the specifiedowner
(user) andgroup
(see fchown(2)). - fchownat
- Change the ownership of the file at
path
to be owned by the specifiedowner
(user) andgroup
. - fdatasync
- Synchronize the data of a file
- fork⚠
- Create a new child process duplicating the parent process (see fork(2)).
- fpathconf
- Like
pathconf
, but works with file descriptors instead of paths (see fpathconf(2)) - fsync
- Synchronize changes to a file
- ftruncate
- Truncate a file to a specified length
- getcwd
- Returns the current directory as a
PathBuf
- getegid
- Get the effective group ID
- geteuid
- Get the effective user ID
- getgid
- Get the real group ID
- getgrouplist
- Calculate the supplementary group access list.
- getgroups
- Get the list of supplementary group IDs of the calling process.
- gethostname
- Get the host name and store it in an internally allocated buffer, returning an
OsString
on success (see gethostname(2)). - getpgid
- Get process group
- getpgrp
- Get the group id of the calling process (see getpgrp(3)).
- getpid
- Get the pid of this process (see getpid(2)).
- getppid
- Get the pid of this processes’ parent (see getpid(2)).
- getsid
- Get the process group ID of a session leader getsid(2).
- getuid
- Get a real user ID
- initgroups
- Initialize the supplementary group access list.
- isatty
- Determines if the file descriptor refers to a valid terminal type device.
- linkat
- Link one file to another file
- lseek
- Move the read/write file offset.
- mkdir
- Creates new directory
path
with access rightsmode
. (see mkdir(2)) - mkdtemp
- Creates a directory which persists even after process termination
- mkfifo
- Creates new fifo special file (named pipe) with path
path
and access rightsmode
. - mkfifoat
- Creates new fifo special file (named pipe) with path
path
and access rightsmode
. - mkstemp
- Creates a regular file which persists even after process termination
- pathconf
- Get path-dependent configurable system variables (see pathconf(2))
- pause
- Suspend the thread until a signal is received.
- pipe
- Create an interprocess channel.
- read
- Read from a raw file descriptor.
- setegid
- Set the effective group ID
- seteuid
- Set the effective user ID
- setgid
- Set the group ID
- setgroups
- Set the list of supplementary group IDs for the calling process.
- sethostname
- Set the system host name (see sethostname(2)).
- setpgid
- Set a process group ID (see setpgid(2)).
- setsid
- Create new session and set process group id (see setsid(2)).
- setuid
- Set the user ID
- sleep
- Suspend execution for an interval of time
- symlinkat
- Creates a symbolic link at
path2
which points topath1
. - sysconf
- Get configurable system variables (see sysconf(3))
- unlink
- Remove a directory entry
- unlinkat
- Remove a directory entry
- write
- Write to a raw file descriptor.