Expand description
Safe wrappers around functions found in libc “unistd.h” header
Modules
Structs
Options for access()
Gid
user
Group identifier
Group
user
Representation of a Group, based on
libc::group
Pid
process
Process identifier
ResGid
user
Real, effective and saved group IDs.
ResUid
user
Real, effective and saved user IDs.
Uid
user
User identifier
User
user
Representation of a User, based on
libc::passwd
Enums
FchownatFlags
user
and fs
Flags for
fchownat
function.ForkResult
process
Represents the successful result of calling
fork
Flags for
linkat
function.PathconfVar
fs
and feature
Variable names for
pathconf
SysconfVar
feature
Variable names for
sysconf
Flags for
unlinkat
function.Constants
ROOT
user
Constant for UID = 0
Functions
access
fs
chown
user
and fs
Change the ownership of the file at
path
to be owned by the specified
owner
(user) and group
(see
chown(2)).chroot
fs
Close a raw file descriptor
dup3
fs
Create a new copy of the specified file descriptor using the specified fd
and flags (see dup(2)).
execveat
process
Execute program relative to a directory file descriptor (see
execveat(2)).
execvp
process
Replace the current process image with a new one and replicate shell
PATH
searching behavior (see
exec(3)).Checks the file named by
path
for accessibility according to the flags given by mode
fchdir
fs
Change the current working directory of the process to the one
given as an open file descriptor (see
fchdir(2)).
fchown
user
and fs
Change the ownership of the file referred to by the open file descriptor
fd
to be owned by
the specified owner
(user) and group
(see
fchown(2)).fchownat
user
and fs
Change the ownership of the file at
path
to be owned by the specified
owner
(user) and group
.Synchronize the data of a file
fexecve
process
Replace the current process image with a new one (see
fexecve(2)).
fork⚠
process
Create a new child process duplicating the parent process (see
fork(2)).
fpathconf
fs
and feature
Like
pathconf
, but works with file descriptors instead of paths (see
fpathconf(2))fsync
fs
Synchronize changes to a file
Truncate a file to a specified length
getcwd
fs
Returns the current directory as a
PathBuf
getegid
user
Get the effective group ID
geteuid
user
Get the effective user ID
getgid
user
Get the real group ID
getgrouplist
user
Calculate the supplementary group access list.
getgroups
user
Get the list of supplementary group IDs of the calling process.
gethostname
hostname
Get the host name and store it in an internally allocated buffer, returning an
OsString
on success (see
gethostname(2)).getpgid
process
getpgrp
process
Get the group id of the calling process (see
getpgrp(3)).
getresgid
user
Gets the real, effective, and saved group IDs.
getresuid
user
Gets the real, effective, and saved user IDs.
getuid
user
Get a real user ID
initgroups
user
Initialize the supplementary group access list.
isatty
fs
linkat
fs
Link one file to another file
lseek
fs
Move the read/write file offset.
lseek64
fs
mkfifo
fs
Creates new fifo special file (named pipe) with path
path
and access rights mode
.mkstemp
fs
Creates a regular file which persists even after process termination
pathconf
fs
and feature
Get path-dependent configurable system variables (see
pathconf(2))
pause
signal
Suspend the thread until a signal is received.
Create an interprocess channel.
pipe2
fs
Like
pipe
, but allows setting certain file descriptor flags.Read from a raw file descriptor.
setegid
user
Set the effective group ID
seteuid
user
Set the effective user ID
setfsgid
fs
and user
Set the group identity used for filesystem checks per-thread.
On both success and failure, this call returns the previous filesystem group
ID of the caller.
setfsuid
fs
and user
Set the user identity used for filesystem checks per-thread.
On both success and failure, this call returns the previous filesystem user
ID of the caller.
setgid
user
Set the group ID
setgroups
user
Set the list of supplementary group IDs for the calling process.
sethostname
hostname
Set the system host name (see
sethostname(2)).
setpgid
process
Set a process group ID (see
setpgid(2)).
setresgid
user
Sets the real, effective, and saved gid.
(see setresuid(2))
setresuid
user
Sets the real, effective, and saved uid.
(see setresuid(2))
setuid
user
Set the user ID
Suspend execution for an interval of time
Creates a symbolic link at
path2
which points to path1
.sysconf
feature
Get configurable system variables (see
sysconf(3))
tcgetpgrp
process
and term
Get the terminal foreground process group (see
tcgetpgrp(3)).
tcsetpgrp
process
and term
Set the terminal foreground process group (see
tcgetpgrp(3)).
truncate
fs
Truncate a file to a specified length
ttyname
term
Get the name of the terminal device that is open on file descriptor fd
(see
ttyname(3)
).unlink
fs
Remove a directory entry
unlinkat
fs
Remove a directory entry
Write to a raw file descriptor.