Expand description
I/O operations.
Modules
epoll support.
Structs
The error type for rustix
APIs.
EFD_*
flags for use with eventfd
.
A buffer type used with Write::write_vectored
.
A buffer type used with Read::read_vectored
.
A wrapper around io_lifetimes::OwnedFd
which closes the file descriptor
using rustix’s own close
rather than libc’s close
.
Enums
Enumeration of possible methods to seek within an I/O object.
Constants
PIPE_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)
—Changes the file description of a file descriptor.
dup3(fd, new, flags)
—Changes the file description of a file
descriptor, with flags.
eventfd(initval, flags)
—Creates a file descriptor for event
notification.
ioctl(fd, BLKPBSZGET)
—Returns the physical block size of a block device.
ioctl(fd, BLKSSZGET)
—Returns the logical block size of a block device.
ioctl(fd, FIONBIO, &value)
—Enables or disables non-blocking mode.
ioctl(fd, FIONREAD)
—Returns the number of bytes ready to be read.
ioctl(fd, TIOCEXCL)
—Enables exclusive mode on a terminal.
ioctl(fd, TIOCNXCL)
—Disables exclusive mode on a terminal.
Returns a pair of booleans indicating whether the file descriptor is readable and/or writable, respectively.
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.
preadv2(fd, bufs, offset, flags)
—Reads data, with several options.
Returns a handle to Linux’s /proc/self/fd
directory.
Returns a handle to a Linux /proc/self/fdinfo/<fd>
file.
Returns a handle to a Linux /proc/self/maps
file.
Returns a handle to a Linux /proc/self/pagemap
file.
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.
pwritev2(fd, bufs, offset, flags)
—Writes data, with several options.
STDERR_FILENO
—Standard error, raw.
STDIN_FILENO
—Standard input, raw.
STDOUT_FILENO
—Standard output, raw.
read(fd, buf)
—Reads from a stream.
readv(fd, bufs)
—Reads from a stream into multiple buffers.
Call f
until it either succeeds or fails other than Errno::INTR
.
STDERR_FILENO
—Standard error, owned.
STDIN_FILENO
—Standard input, owned.
STDOUT_FILENO
—Standard output, owned.
write(fd, buf)
—Writes to a stream.
writev(fd, bufs)
—Writes to a stream from multiple buffers.