Module rsix::io [−][src]
Expand description
I/O operations.
Modules
epoll support.
Structs
The error type for rsix APIs.
The EFD_*
flags accepted by eventfd
.
MLOCK_*
flags for use with mlock_with
.
PROT_*
flags for use with mprotect
.
MREMAP_*
flags for use with mremap
.
A wrapper around io_lifetimes::OwnedFd
which closes the file descriptor
using rsix’s own close
rather than libc’s close
.
struct pollfd
POLL*
The O_*
flags accepted by userfaultfd
.
Enums
Constants
linux_raw
, or libc
and non-WASIICANON
linux_raw
, or libc
and neither Redox nor WASIPIPE_BUF
—The maximum length at which writes to a pipe are atomic.
Functions
dup(fd)
—Creates a new OwnedFd
instance that shares the same
underlying file description as fd
.
dup2(fd, new)
—Creates a new OwnedFd
instance that shares the
same underlying file description as the existing OwnedFd
instance,
closing new
and reusing its file descriptor.
dup3(fd, new, flags)
—Creates a new OwnedFd
instance that shares the
same underlying file description as the existing OwnedFd
instance,
closing new
and reusing its file descriptor, with flags.
eventfd(initval, flags)
—Creates a file descriptor for event
notification.
ioctl(fd, FIONBIO, &value)
—Enables or disables non-blocking mode.
ioctl(fd, FIONREAD)
—Returns the number of bytes ready to be read.
ioctl(fd, TCGETS)
—Get terminal attributes.
linux_raw
, or libc
and neither Redox nor WASIioctl(fd, TIOCEXCL)
—Enables exclusive mode on a terminal.
ioctl(fd, TIOCGWINSZ)
—Get the current terminal window size.
linux_raw
, or libc
and neither Redox nor WASIioctl(fd, TIOCNXCL)
—Disables exclusive mode on a terminal.
Returns a pair of booleans indicating whether the file descriptor is readable and/or writeable, respectively.
isatty(fd)
—Tests whether a file descriptor refers to a terminal.
posix_madvise(addr, len, advice)
—Declares an expected access pattern
for a memory-mapped file.
mlock2(ptr, len, flags)
—Lock memory into RAM, with
flags.
mmap(ptr, len, prot, MAP_ANONYMOUS | flags, -1, 0)
—Create an anonymous
memory mapping.
mremap(old_address, old_size, new_size, flags)
—Resize, modify,
and/or move a memory mapping.
mremap(old_address, old_size, new_size, MREMAP_FIXED | flags)
—Resize,
modify, and/or move a memory mapping to a specific address.
pipe()
—Creates a pipe.
pipe2(flags)
—Creates a pipe, with flags.
poll(self.fds, timeout)
pread(fd, buf, offset)
—Reads from a file at a given position.
preadv(fd, bufs, offset)
—Reads from a file at a given position into
multiple buffers.
linux_raw
, or libc
and (Android or Linux)preadv2(fd, bufs, offset, flags)
—Reads data, with several options.
Returns a handle to Linux’s /proc/self/fd
directory.
pwrite(fd, bufs)
—Writes to a file at a given position.
pwritev(fd, bufs, offset)
—Writes to a file at a given position from
multiple buffers.
linux_raw
, or libc
and (Android or Linux)pwritev2(fd, bufs, offset, flags)
—Writes data, with several options.
read(fd, buf)
—Reads from a stream.
readv(fd, bufs)
—Reads from a stream into multiple buffers.
STDERR_FILENO
—Standard error, owned.
STDIN_FILENO
—Standard input, owned.
STDOUT_FILENO
—Standard output, owned.
procfs
ttyname_r(fd)
userfaultfd(flags)
write(fd, buf)
—Writes to a stream.
writev(fd, bufs)
—Writes to a stream from multiple buffers.