Module nix::unistd

Documentation

Safe wrappers around functions found in libc “unistd.h” header

Modules

acct not(target_os = "redox")

Alarm signal scheduling.

Structs

Options for access()

Group identifier

Group not(target_os = "redox")

Representation of a Group, based on libc::group

Process identifier

Real, effective and saved group IDs.

Real, effective and saved user IDs.

User identifier

User not(target_os = "redox")

Representation of a User, based on libc::passwd

Enums

Flags for fchownat function.

Represents the successful result of calling fork

Flags for linkat function.

Variable names for pathconf

Variable names for sysconf

Flags for unlinkat function.

Directive that tells lseek and lseek64 what the offset is relative to.

Functions

Checks the file named by path for accessibility according to the flags given by amode See access(2)

Change the current working directory of the calling process (see chdir(2)).

Change the ownership of the file at path to be owned by the specified owner (user) and group (see chown(2)).

chroot not(target_os = "fuchsia")

Close a raw file descriptor

daemon any(target_os = "android", target_os = "dragonfly", target_os = "freebsd", target_os = "illumos", target_os = "linux", target_os = "netbsd", target_os = "openbsd", target_os = "solaris")

Daemonize this process by detaching from the controlling terminal (see daemon(3)).

Create a copy of the specified file descriptor (see dup(2)).

Create a copy of the specified file descriptor using the specified fd (see dup(2)).

Create a new copy of the specified file descriptor using the specified fd and flags (see dup(2)).

Replace the current process image with a new one (see exec(3)).

Replace the current process image with a new one (see execve(2)).

execveat any(target_os = "android", target_os = "linux")

Execute program relative to a directory file descriptor (see execveat(2)).

Replace the current process image with a new one and replicate shell PATH searching behavior (see exec(3)).

execvpe any(target_os = "haiku", target_os = "linux", target_os = "openbsd")

Replace the current process image with a new one and replicate shell PATH searching behavior (see execvpe(3)).

fchdir not(target_os = "fuchsia")

Change the current working directory of the process to the one given as an open file descriptor (see fchdir(2)).

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 not(target_os = "redox")

Change the ownership of the file at path to be owned by the specified owner (user) and group.

fdatasync any(target_os = "linux", target_os = "android", target_os = "emscripten", target_os = "illumos", target_os = "solaris")

Synchronize the data of a file

fexecve any(target_os = "android", target_os = "linux", target_os = "freebsd")

Replace the current process image with a new one (see fexecve(2)).

fork This function is unsafe to use

Create a new child process duplicating the parent process (see fork(2)).

Like pathconf, but works with file descriptors instead of paths (see fpathconf(2))

Synchronize changes to a file

Truncate a file to a specified length

Returns the current directory as a PathBuf

Get the effective group ID

Get the effective user ID

Get the real group ID

getgrouplist not(any(target_os = "illumos", target_os = "ios", target_os = "macos", target_os = "redox"))

Calculate the supplementary group access list.

getgroups not(any(target_os = "ios", target_os = "macos"))

Get the list of supplementary group IDs of the calling process.

Get the host name and store it in the provided buffer, returning a pointer the CStr in that buffer on success (see gethostname(2)).

Get the group id of the calling process (see getpgrp(3)).

Get the pid of this process (see getpid(2)).

Get the pid of this processes’ parent (see getpid(2)).

Gets the real, effective, and saved group IDs.

Gets the real, effective, and saved user IDs.

getsid not(target_os = "redox")

Get the process group ID of a session leader getsid(2).

gettid any(target_os = "linux", target_os = "android")

Get the caller’s thread ID (see gettid(2).

Get a real user ID

initgroups not(any(target_os = "ios", target_os = "macos", target_os = "redox"))

Initialize the supplementary group access list.

linkat not(target_os = "redox")

Link one file to another file

Move the read/write file offset.

lseek64 any(target_os = "linux", target_os = "android")

Creates new directory path with access rights mode. (see mkdir(2))

mkfifo not(target_os = "redox")

Creates new fifo special file (named pipe) with path path and access rights mode.

mkfifoat not(any(target_os = "macos", target_os = "ios", target_os = "android", target_os = "redox"))

Creates new fifo special file (named pipe) with path path and access rights mode.

Creates a regular file which persists even after process termination

Get path-dependent configurable system variables (see pathconf(2))

pause not(target_os = "redox")

Suspend the thread until a signal is received.

Create an interprocess channel.

pipe2 any(target_os = "android", target_os = "dragonfly", target_os = "emscripten", target_os = "freebsd", target_os = "illumos", target_os = "linux", target_os = "redox", target_os = "netbsd", target_os = "openbsd", target_os = "solaris")

Like pipe, but allows setting certain file descriptor flags.

Read from a raw file descriptor.

Set the effective group ID

Set the effective user ID

setfsgid any(target_os = "linux", target_os = "android")

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 any(target_os = "linux", target_os = "android")

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.

Set the group ID

setgroups not(any(target_os = "ios", target_os = "macos", target_os = "redox"))

Set the list of supplementary group IDs for the calling process.

sethostname not(target_os = "redox")

Set the system host name (see sethostname(2)).

Set a process group ID (see setpgid(2)).

Sets the real, effective, and saved gid. (see setresuid(2))

Sets the real, effective, and saved uid. (see setresuid(2))

Create new session and set process group id (see setsid(2)).

Set the user ID

Suspend execution for an interval of time

symlinkat not(target_os = "redox")

Creates a symbolic link at path2 which points to path1.

sync any(target_os = "dragonfly", target_os = "freebsd", target_os = "linux", target_os = "netbsd", target_os = "openbsd")

Commit filesystem caches to disk

Get configurable system variables (see sysconf(3))

Get the terminal foreground process group (see tcgetpgrp(3)).

Set the terminal foreground process group (see tcgetpgrp(3)).

truncate not(any(target_os = "redox", target_os = "fuchsia"))

Truncate a file to a specified length

ttyname not(target_os = "fuchsia")

Get the name of the terminal device that is open on file descriptor fd (see ttyname(3)).

Remove a directory entry

unlinkat not(target_os = "redox")

Remove a directory entry

Write to a raw file descriptor.

Constants

Constant for UID = 0