Expand description
Unix API crate
NOTE: The crate documentation is in the docs
module.
Modules§
Macros§
- format_
ustr - Forwards its arguments to
format!
and wraps the result in aUstring
- map_err
fn(<integer type>) -> Result<integer type>
- ustr
fn(<string literal>) -> &'static Ustr
Structs§
- Assert
Packed - Transparent wrapper that asserts that a type is
Packed
- Assert
Pod - Transparent wrapper that asserts that a type is
Pod
- Bstr
- Thin wrapper for a
[u8]
- Dir
- Wrapper for
*mut libc::DIR
- Dirent
- Wrapper for
*const libc::dirent
- Errno
c_int
newtype which wrapsERRNO
values- Fd
- A borrowed file descriptor
- Initialized
Iovec - A wrapper for a partially initialized
iovec
- Initialized
Iovec Iter - An iterator over the initialized components of an
iovec
- Inotify
Event - Wrapper for
libc::inotify_event
- Msghdr
- Rusty version of an immutable
c::msghdr
- Msghdr
Mut - Rusty version of a mutable
c::msghdr
- Nlmsg
Writer Deprecated - A writer for netlink messages
- OwnedFd
- An owned file descriptor
- Ustr
- Thin wrapper for a
[u8]
that has a trailing nul byte - UstrPtr
- Wrapper for a
*const *const libc::c_char
with a terminating null pointer - Ustring
- Thin wrapper for a
Vec<u8>
that has a trailing nul byte - UtsName
- Wrapper for
libc::utsname
Constants§
- IOCSIZE_
MASK IOCSIZE_MASK
- IOCSIZE_
SHIFT IOCSIZE_SHIFT
- IOC_IN
IOC_IN
- IOC_
INOUT IOC_INOUT
- IOC_OUT
IOC_OUT
- _IOC_
DIRBITS _IOC_DIRBITS
- _IOC_
DIRMASK _IOC_DIRMASK
- _IOC_
DIRSHIFT _IOC_DIRSHIFT
- _IOC_
NONE _IOC_NONE
- _IOC_
NRBITS _IOC_NRBITS
- _IOC_
NRMASK _IOC_NRMASK
- _IOC_
NRSHIFT _IOC_NRSHIFT
- _IOC_
READ _IOC_READ
- _IOC_
SIZEBITS _IOC_SIZEBITS
- _IOC_
SIZEMASK _IOC_SIZEMASK
- _IOC_
SIZESHIFT _IOC_SIZESHIFT
- _IOC_
TYPEBITS _IOC_TYPEBITS
- _IOC_
TYPEMASK _IOC_TYPEMASK
- _IOC_
TYPESHIFT _IOC_TYPESHIFT
- _IOC_
WRITE _IOC_WRITE
Traits§
- AsUstr
- Used for cheap conversion from into
&Ustr
- Bytes
- Trait for objects which can be turned into bytes
- Into
Ustr - Trait for objects which can be turned into
Cow<'a, Ustr>
- Maybe
Uninit Iovec - A possibly uninitialized
iovec
- Maybe
Uninit Iovec Mut - A possibly uninitialized
iovec
(mutable) - Maybe
Uninit Slice Ext - Extension for
MaybeUninit
- Nlmsg
Header Deprecated - The general shape of a header of a netlink message
- Nlmsg
Header Ext Deprecated - Extension trait for netlink message headers
- Packed
- Marker trait for types without padding
- Pod
- Marker trait for Pod types
- Sock
Addr - Marker trait for socket address types
- Uapi
Read Ext Read
extensions
Functions§
- WCOREDUMP
wait(2)
- WEXITSTATUS
wait(2)
- WIFCONTINUED
wait(2)
- WIFEXITED
wait(2)
- WIFSIGNALED
wait(2)
- WIFSTOPPED
wait(2)
- WSTOPSIG
wait(2)
- WTERMSIG
wait(2)
- _IO
_IO
- _IOC
_IOC
- _IOC_
DIR _IOC_DIR
- _IOC_NR
_IOC_NR
- _IOC_
SIZE _IOC_SIZE
- _IOC_
TYPE _IOC_TYPE
- _IOR
_IOR
- _IOW
_IOW
- _IOWR
_IOWR
- accept
accept(2)
- accept4
accept4(2)
- access
access(2)
- as_
bytes - Returns the object representation of
t
- as_
bytes_ mut - Returns the mutable object representation of
t
- as_
maybe_ uninit - Casts the argument to
MaybeUninit
of the same type - as_
maybe_ uninit_ bytes - Returns the object representation of
t
- as_
maybe_ uninit_ bytes_ mut - Returns the mutable object representation of
t
- as_
maybe_ ⚠uninit_ bytes_ mut2 - Returns the mutable object representation of
t
- as_
maybe_ ⚠uninit_ mut - Casts the argument to
MaybeUninit
of the same type - assert_
packed ⚠ - Asserts that
T
isPacked
- assert_
pod ⚠ - Asserts that
T
isPod
- bind
bind(2)
- chdir
chdir(2)
- chmod
chmod(2)
- chown
chown(2)
- chroot
chroot(2)
- clock_
getres clock_getres(2)
- clock_
gettime clock_gettime(2)
- clock_
nanosleep clock_nanosleep(2)
- clock_
settime clock_settime(2)
- close
close(2)
- close_
range close_range(2)
- cmsg_
read - Reads a cmsg from a buffer
- cmsg_
space - Returns the number of bytes needed to store a cmsg with data-length
data_len
- cmsg_
write - Writes a cmsg to a buffer
- connect
connect(2)
- copy_
file_ range copy_file_range(2)
- daemon
daemon(3)
- dirfd
dirfd(3)
- dup
dup(2)
- dup2
dup2(2)
- dup3
dup3(2)
- empty_
sig_ set - Returns an empty sig set
- epoll_
create1 epoll_create1(2)
- epoll_
ctl epoll_ctl(2)
- epoll_
wait epoll_wait(2)
- errno_
location - Gets a pointer to the current thread’s errno
- eventfd
eventfd(2)
- eventfd_
read - Reads from an eventfd file descriptor
- eventfd_
write - Writes to an eventfd file descriptor
- execv
execv(3)
- execve
execve(2)
- execveat
execveat(2)
- execvp
execvp(3)
- execvpe
execvpe(3)
- faccessat
faccessat(2)
- fallocate
fallocate(2)
- fchdir
fchdir(2)
- fchmod
fchmod(2)
- fchmodat
fchmodat(2)
- fchown
fchown(2)
- fchownat
fchownat(2)
- fcntl_
add_ seals fcntl(2)
with cmd =F_ADD_SEALS
- fcntl_
dupfd fcntl(2)
with cmd =F_DUPFD
- fcntl_
dupfd_ cloexec fcntl(2)
with cmd =F_DUPFD_CLOEXEC
- fcntl_
get_ seals fcntl(2)
with cmd =F_GET_SEALS
- fcntl_
getfd fcntl(2)
with cmd =F_GETFD
- fcntl_
getfl fcntl(2)
with cmd =F_GETFL
- fcntl_
getlk fcntl(2)
with cmd =F_GETLK
- fcntl_
getpipe_ sz fcntl(2)
with cmd =F_GETPIPE_SZ
- fcntl_
ofd_ getlk fcntl(2)
with cmd =F_OFD_GETLK
- fcntl_
ofd_ setlk fcntl(2)
with cmd =F_OFD_SETLK
- fcntl_
ofd_ setlkw fcntl(2)
with cmd =F_OFD_SETLKW
- fcntl_
setfd fcntl(2)
with cmd =F_SETFD
- fcntl_
setfl fcntl(2)
with cmd =F_SETFL
- fcntl_
setlk fcntl(2)
with cmd =F_SETLK
- fcntl_
setlkw fcntl(2)
with cmd =F_SETLKW
- fcntl_
setpipe_ sz fcntl(2)
with cmd =F_SETPIPE_SZ
- fdatasync
fdatasync(2)
- fdopendir
fdopendir(3)
- fexecve
fexecve(3)
- flock
flock(2)
- fork⚠
fork(2)
- fpathconf
fpathconf(3)
- fsconfig_
cmd_ create fsconfig(2)
with cmd =FSCONFIG_CMD_CREATE
- fsconfig_
cmd_ reconfigure fsconfig(2)
with cmd =FSCONFIG_CMD_RECONFIGURE
- fsconfig_
set_ binary fsconfig(2)
with cmd =FSCONFIG_SET_BINARY
- fsconfig_
set_ fd fsconfig(2)
with cmd =FSCONFIG_SET_FD
- fsconfig_
set_ flag fsconfig(2)
with cmd =FSCONFIG_SET_FLAG
- fsconfig_
set_ path fsconfig(2)
with cmd =FSCONFIG_SET_PATH
- fsconfig_
set_ path_ empty fsconfig(2)
with cmd =FSCONFIG_SET_PATH_EMPTY
- fsconfig_
set_ string fsconfig(2)
with cmd =FSCONFIG_SET_STRING
- fsmount
fsmount(2)
- fsopen
fsopen(2)
- fspick
fspick(2)
- fstat
fstat(2)
- fstatat
fstatat(2)
- fstatfs
fstatfs(2)
- fstatvfs
fstatvfs(3)
- fsync
fsync(2)
- ftruncate
ftruncate(2)
- futimens
futimens(2)
- futimes
futimes(3)
- get_
errno - Gets the current thread’s errno
- getcwd
getcwd(3)
- getegid
getegid(2)
- geteuid
geteuid(2)
- getgid
getgid(2)
- getgroups
getgroups(2)
- gethostname
gethostname(2)
- getpeername
getpeername(2)
- getpgrp
getpgrp(2)
- getpid
getpid(2)
- getppid
getppid(2)
- getpriority
getpriority(2)
- getresgid
getresgid(2)
- getresuid
getresuid(2)
- getrlimit
getrlimit(2)
- getsid
getsid(2)
- getsockname
getsockname(2)
- getsockopt
getsockopt(2)
- gettid
gettid(2)
- getuid
getuid(2)
- inotify_
add_ watch inotify_add_watch(2)
- inotify_
init1 inotify_init1(2)
- inotify_
read - Reads from an inotify file descriptor and returns an iterator over the results
- inotify_
rm_ watch inotify_rm_watch(2)
- isatty
isatty(3)
- kill
kill(2)
- lchown
lchown(2)
- link
link(2)
- linkat
linkat(2)
- listen
listen(2)
- lseek
lseek(2)
- lstat
lstat(2)
- lutimes
lutimes(3)
- major
major(3)
- makedev
makedev(3)
- memfd_
create memfd_create(2)
- minor
minor(3)
- mkdir
mkdir(2)
- mkdirat
mkdirat(2)
- mkfifo
mkfifo(3)
- mkfifoat
mkfifoat(3)
- mknod
mknod(2)
- mknodat
mknodat(2)
- mount
mount(2)
- move_
mount move_mount(2)
- msghdr_
control_ none_ mut - Returns
Option::<&mut [u8]>::None
- msghdr_
control_ none_ ref - Returns
Option::<&[u8]>::None
- nice
nice(2)
- nlmsg_
align Deprecated - Increases the size to the next multiple of 4
- nlmsg_
read Deprecated - Reads an object from an netlink message buffer
- open
open(2)
- open_
tree open_tree(2)
- openat
openat(2)
- openat2
openat2(2)
- opendir
opendir(3)
- pathconf
pathconf(3)
- pause
pause(2)
- pidfd_
getfd pidfd_getfd(2)
- pidfd_
open pidfd_open(2)
- pipe
pipe(2)
- pipe2
pipe2(2)
- pivot_
root pivot_root(2)
- pod_
iter - Converts
u
into an iterator ofT
- pod_
read - Converts
u
toT
- pod_
read_ init - Converts an initial port of
u
toT
- pod_
write - Writes
u
tot
- pod_
zeroed - Returns an instance of
T
whose object representation is0
in all non-padding bytes - poll
poll(2)
- posix_
fadvise posix_fadvise(2)
- posix_
fallocate posix_fallocate(3)
- pread
pread(2)
- preadv
preadv(2)
- preadv2
preadv2(2)
- pthread_
sigmask pthread_sigmask(3)
- pwrite
pwrite(2)
- pwritev
pwritev(2)
- pwritev2
pwritev2(2)
- raise
raise(3)
- read
read(2)
- read_
link_ to_ new_ ustring - Shortcut for
read_link_to_ustring
with a newUstring
- read_
link_ to_ ustring - Uses
readlinkat(2)
on (fd
,path
) and appends the result tobuf
- readdir
readdir(3)
- readlink
readlink(2)
- readlinkat
readlinkat(2)
- readv
readv(2)
- recv
recv(2)
- recvfrom
recvfrom(2)
- recvmsg
recvmsg(2)
- rename
rename(2)
- renameat
renameat(2)
- renameat2
renameat2(2)
- rewinddir
rewinddir(3)
- sched_
get_ priority_ max sched_get_priority_max(2)
- sched_
get_ priority_ min sched_get_priority_min(2)
- sched_
getaffinity sched_getaffinity(2)
- sched_
getattr sched_getattr(2)
- sched_
getparam sched_getparam(2)
- sched_
getscheduler sched_getscheduler(2)
- sched_
rr_ get_ interval sched_rr_get_interval(2)
- sched_
setaffinity sched_setaffinity(2)
- sched_
setattr sched_setattr(2)
- sched_
setparam sched_setparam(2)
- sched_
setscheduler sched_setscheduler(2)
- sched_
yield sched_yield(2)
- seekdir
seekdir(3)
- send
send(2)
- sendfile
sendfile(2)
- sendmsg
sendmsg(2)
- sendto
sendto(2)
- set_
errno - Sets the current thread’s errno
- setegid
setegid(2)
- seteuid
seteuid(2)
- setgid
setgid(2)
- setgroups
setgroups(2)
- sethostname
sethostname(2)
- setns
setns(2)
- setpgid
setpgid(2)
- setpriority
setpriority(2)
- setresgid
setresgid(2)
- setresuid
setresuid(2)
- setrlimit
setrlimit(2)
- setsid
setsid(2)
- setsockopt
setsockopt(2)
- setuid
setuid(2)
- shutdown
shutdown(2)
- sigaddset
sigsetops(3)
- sigdelset
sigsetops(3)
- sigemptyset
sigsetops(3)
- sigfillset
sigsetops(3)
- sigismember
sigsetops(3)
- signalfd_
mod signalfd(2)
with fd !=-1
- signalfd_
new signalfd(2)
with fd =-1
- signalfd_
read - Reads from a signalfd file descriptor and returns the elements read
- sigtimedwait
sigtimedwait(2)
- sigwait
sigwait(3)
- sigwaitinfo
sigwaitinfo(2)
- sockaddr_
none_ mut - Returns
Option::<&mut c::sockaddr>::None
- sockaddr_
none_ ref - Returns
Option::<&c::sockaddr>::None
- socket
socket(2)
- socketpair
socketpair(2)
- splice
splice(2)
- stat
stat(2)
- statfs
statfs(2)
- statvfs
statvfs(3)
- symlink
symlink(2)
- symlinkat
symlinkat(2)
- sync
sync(2)
- syncfs
syncfs(2)
- sysconf
sysconf(3)
- sysinfo
sysinfo(2)
- tee
tee(2)
- telldir
telldir(3)
- timerfd_
create timerfd_create(2)
- timerfd_
gettime timerfd_gettime(2)
- timerfd_
settime timerfd_settime(2)
- truncate
truncate(2)
- umask
umask(2)
- umount2
umount2(2)
- uname
uname(2)
- unlink
unlink(2)
- unlinkat
unlinkat(2)
- unshare
unshare(2)
- utimensat
utimensat(2)
- wait
wait(2)
- waitpid
waitpid(2)
- write
write(2)
- writev
writev(2)