Available on Unix only.
Expand description
Safe wrappers around functions found in libc “unistd.h” header
Modules§
Structs§
- Access
Flags fs - 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§
- Fork
Result process - Represents the successful result of calling
fork - Pathconf
Var fsandfeature - Variable names for
pathconf - Sysconf
Var feature - Variable names for
sysconf - Unlinkat
Flags fs - Flags for
unlinkatfunction. - Whence
fs - Directive that tells
lseekandlseek64what the offset is relative to.
Constants§
- ROOT
user - Constant for UID = 0
Functions§
- access
fs - Checks the file named by
pathfor accessibility according to the flags given byamodeSee access(2) - chdir
fs - Change the current working directory of the calling process (see chdir(2)).
- chown
userandfs - Change the ownership of the file at
pathto be owned by the specifiedowner(user) andgroup(see chown(2)). - chroot
fs - Change a process’s root directory
- close
- Close a file descriptor.
- daemon
process - Daemonize this process by detaching from the controlling terminal (see daemon(3)).
- dup
fs - Create a copy of the specified file descriptor.
- dup2
fs - Create a copy of
oldfdusingnewfd. - dup3
fs - Create a new copy of the specified file descriptor using the specified fd and flags.
- dup2_
raw ⚠fs - Create a copy of
oldfdwith any fd value you want. - dup2_
stderr fs - Duplicate
fdwith Stderr, i.e., Stderr redirection. - dup2_
stdin fs - Duplicate
fdwith Stdin, i.e., Stdin redirection. - dup2_
stdout fs - Duplicate
fdwith Stdout, i.e., Stdout redirection. - dup3_
raw ⚠fs - Create a new copy of the specified file descriptor using the specified fd and flags.
- eaccess
fs - Checks the file named by
pathfor accessibility according to the flags given bymodeusing effective UID, effective GID and supplementary group lists. - execv
process - Replace the current process image with a new one (see exec(3)).
- execve
process - Replace the current process image with a new one (see execve(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
PATHsearching behavior (see exec(3)). - execvpe
process - Replace the current process image with a new one and replicate shell
PATHsearching behavior (seeexecvpe(3)). - faccessat
fs - Checks the file named by
dirfdandpathfor accessibility according to the flags given bymode - fchdir
fs - Change the current working directory of the process to the one given as an open file descriptor (see fchdir(2)).
- fchown
userandfs - Change the ownership of the file referred to by the open file descriptor
fdto be owned by the specifiedowner(user) andgroup. - fchownat
userandfs - Change the ownership of the file at
pathto be owned by the specifiedowner(user) andgroup. - fdatasync
fs - 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
fsandfeature - Like
pathconf, but works with file descriptors instead of paths (see fpathconf(2)) - fsync
fs - Synchronize changes to a file
- ftruncate
fs - 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
OsStringon success. - getpgid
process - Get process group
- getpgrp
process - Get the group id of the calling process (see getpgrp(3)).
- getpid
process - Get the pid of this process (see getpid(2)).
- getppid
process - Get the pid of this processes’ parent (see getpid(2)).
- getresgid
user - Gets the real, effective, and saved group IDs.
- getresuid
user - Gets the real, effective, and saved user IDs.
- getsid
process - Get the process group ID of a session leader getsid(2).
- gettid
process - Get the caller’s thread ID (see gettid(2).
- getuid
user - Get a real user ID
- initgroups
user - Initialize the supplementary group access list.
- isatty
fs - Determines if the file descriptor refers to a valid terminal type device.
- linkat
fs - Link one file to another file
- lseek
fs - Move the read/write file offset.
- lseek64
fs - Move the read/write file offset.
- mkdir
fs - Creates new directory
pathwith access rightsmode. (see mkdir(2)) - mkdtemp
fsandfeature - Creates a directory which persists even after process termination
- mkfifo
fs - Creates new FIFO special file (named pipe) with path
pathand access rightsmode. - mkfifoat
fs - Creates new FIFO special file (named pipe) with access rights set to
modein the path specified bydirfdandpath. - mkstemp
fs - Creates a regular file which persists even after process termination
- pathconf
fsandfeature - Get path-dependent configurable system variables (see pathconf(2))
- pause
signal - Suspend the thread until a signal is received.
- pipe
- Create an interprocess channel.
- pipe2
fs - Like
pipe, but allows setting certain file descriptor flags. - pivot_
root fs - Change the root file system.
- read
- Read from a raw file descriptor.
- setegid
user - Set the effective group ID
- seteuid
user - Set the effective user ID
- setfsgid
fsanduser - 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
fsanduser - 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))
- setsid
process - Create new session and set process group id (see setsid(2)).
- setuid
user - Set the user ID
- sleep
- Suspend execution for an interval of time
- symlinkat
fs - Creates a symbolic link to
path1in the path specified bydirfdandpath2. - sync
fs - Commit filesystem caches to disk
- syncfs
fs - Commit filesystem caches containing file referred to by the open file
descriptor
fdto disk - sysconf
feature - Get configurable system variables (see sysconf(3))
- tcgetpgrp
processandterm - Get the terminal foreground process group (see tcgetpgrp(3)).
- tcsetpgrp
processandterm - 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
- Write to a raw file descriptor.
Type Aliases§
- Fchownat
Flags userandfs - Linkat
Flags fs