Expand description
Rust friendly bindings to the various *nix system functions.
Modules are structured according to the C header file that they would be defined in.
§Features
Nix uses the following Cargo features to enable optional functionality. They may be enabled in any combination.
acct- Process accountingaio- POSIX AIOdir- Stuff relating to directory iterationenv- Manipulate environment variablesevent- Event-driven APIs, likekqueueandepollfanotify- Linux’sfanotifyfilesystem events monitoring APIfeature- Query characteristics of the OS at runtimefs- File system functionalityhostname- Get and set the system’s hostnameinotify- Linux’sinotifyfile system notification APIioctl- Theioctlsyscall, and wrappers for many specific instanceskmod- Load and unload kernel modulesmman- Stuff relating to memory managementmount- Mount and unmount file systemsmqueue- POSIX message queuesnet- Networking-related functionalitypersonality- Set the process execution domainpoll- APIs likepollandselectprocess- Stuff relating to running processespthread- POSIX threadsptrace- Process tracing and debuggingquota- File system quotasreboot- Reboot the systemresource- Process resource limitssched- Manipulate process’s schedulingsocket- Sockets, whether for networking or local usesignal- Send and receive signals to processessyslog- System loggingterm- Terminal control APIstime- Query the operating system’s clocksucontext- User thread contextuio- Vectored I/Ouser- Stuff relating to users and groupszerocopy- APIs likesendfileandcopy_file_range
Re-exports§
pub use libc;
Modules§
- dir
dir - List directory contents
- env
env - Environment variables
- errno
- Safe wrappers around errno functions
- fcntl
- File control options
- features
feature - Feature tests for OS functionality
- ifaddrs
net - Query network interface addresses
- kmod
kmod - Load and unload kernel modules.
- mount
mount - Mount file systems
- mqueue
mqueue - Posix Message Queue functions
- net
net - Functionality involving network interfaces
- poll
poll - Wait for events to trigger on specific file descriptors
- pty
term - Create master and slave virtual pseudo-terminals (PTYs)
- sched
sched - Execution scheduling
- spawn
process - Safe wrappers around posix_spawn* functions found in the libc “spawn.h” header.
- sys
- Mostly platform-specific functionality
- syslog
syslog - Interfaces for controlling system log.
- time
time - Sleep, query system clocks, and set system clock
- ucontext
ucontext - unistd
- Safe wrappers around functions found in libc “unistd.h” header
Macros§
- cmsg_
space socketanduio - Create a buffer large enough for storing some control messages as returned
by
recvmsg. - getsockopt_
impl socket - Helper for implementing
GetSockOptfor a given socket option. See::sys::socket::GetSockOpt. - ioctl_
none ioctl - Generates a wrapper function for an ioctl that passes no data to the kernel.
- ioctl_
none_ bad ioctl - Generates a wrapper function for a “bad” ioctl that passes no data to the kernel.
- ioctl_
read ioctl - Generates a wrapper function for an ioctl that reads data from the kernel.
- ioctl_
read_ bad ioctl - Generates a wrapper function for a “bad” ioctl that reads data from the kernel.
- ioctl_
read_ buf ioctl - Generates a wrapper function for an ioctl that reads an array of elements from the kernel.
- ioctl_
readwrite ioctl - Generates a wrapper function for an ioctl that reads and writes data to the kernel.
- ioctl_
readwrite_ bad ioctl - Generates a wrapper function for a “bad” ioctl that reads and writes data to the kernel.
- ioctl_
readwrite_ buf ioctl - Generates a wrapper function for an ioctl that reads and writes an array of elements to the kernel.
- ioctl_
write_ buf ioctl - Generates a wrapper function for an ioctl that writes an array of elements to the kernel.
- ioctl_
write_ int ioctl - Generates a wrapper function for a ioctl that writes an integer to the kernel.
- ioctl_
write_ int_ bad ioctl - Generates a wrapper function for a “bad” ioctl that writes an integer to the kernel.
- ioctl_
write_ ptr ioctl - Generates a wrapper function for an ioctl that writes data through a pointer to the kernel.
- ioctl_
write_ ptr_ bad ioctl - Generates a wrapper function for a “bad” ioctl that writes data through a pointer to the kernel.
- request_
code_ none ioctl - Generate an ioctl request code for a command that passes no data.
- request_
code_ read ioctl - Generate an ioctl request code for a command that reads.
- request_
code_ readwrite ioctl - Generate an ioctl request code for a command that reads and writes.
- request_
code_ write ioctl - Generate an ioctl request code for a command that writes.
- setsockopt_
impl socket - Helper for implementing
SetSockOptfor a given socket option. See::sys::socket::SetSockOpt. - sockopt_
impl socket - Helper to generate the sockopt accessors. See
::sys::socket::GetSockOptand::sys::socket::SetSockOpt.
Traits§
- NixPath
- Common trait used to represent file system paths by many Nix functions.