Expand description
Safe wrappers around functions found in libc “unistd.h” header
Structs§
- Access
Flags - Options for access()
Enums§
- Unlinkat
Flags - Flags for
unlinkatfunction. - Whence
- Directive that tells
lseekandlseek64what the offset is relative to.
Functions§
- access
- Checks the file named by
pathfor accessibility according to the flags given byamodeSee access(2) - chdir
- Change the current working directory of the calling process (see chdir(2)).
- chroot
- Change a process’s root directory
- close
- Close a file descriptor.
- dup
- Create a copy of the specified file descriptor.
- dup2
- Create a copy of
oldfdusingnewfd. - dup3
- Create a new copy of the specified file descriptor using the specified fd and flags.
- dup2_
raw ⚠ - Create a copy of
oldfdwith any fd value you want. - dup2_
stderr - Duplicate
fdwith Stderr, i.e., Stderr redirection. - dup2_
stdin - Duplicate
fdwith Stdin, i.e., Stdin redirection. - dup2_
stdout - Duplicate
fdwith Stdout, i.e., Stdout redirection. - dup3_
raw ⚠ - Create a new copy of the specified file descriptor using the specified fd and flags.
- eaccess
- Checks the file named by
pathfor accessibility according to the flags given bymodeusing effective UID, effective GID and supplementary group lists. - faccessat
- Checks the file named by
dirfdandpathfor accessibility according to the flags given bymode - fchdir
- Change the current working directory of the process to the one given as an open file descriptor (see fchdir(2)).
- fdatasync
- Synchronize the data of a file
- fsync
- Synchronize changes to a file
- ftruncate
- Truncate a file to a specified length
- getcwd
- Returns the current directory as a
PathBuf - 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.
- lseek64
- Move the read/write file offset.
- mkdir
- Creates new directory
pathwith access rightsmode. (see mkdir(2)) - mkfifo
- Creates new FIFO special file (named pipe) with path
pathand access rightsmode. - mkfifoat
- Creates new FIFO special file (named pipe) with access rights set to
modein the path specified bydirfdandpath. - mkstemp
- Creates a regular file which persists even after process termination
- pipe
- Create an interprocess channel.
- pipe2
- Like
pipe, but allows setting certain file descriptor flags. - pivot_
root - Change the root file system.
- read
- Read from a raw file descriptor.
- sleep
- Suspend execution for an interval of time
- symlinkat
- Creates a symbolic link to
path1in the path specified bydirfdandpath2. - sync
- Commit filesystem caches to disk
- syncfs
- Commit filesystem caches containing file referred to by the open file
descriptor
fdto disk - truncate
- Truncate a file to a specified length
- unlink
- Remove a directory entry
- unlinkat
- Remove a directory entry
- write
- Write to a raw file descriptor.