Module posish::io [−][src]
Expand description
I/O operations.
Structs
O_*
constants for use with dup2
.
The error type for posish APIs.
MAP_*
flags for use with mmap
.
O_*
constants for use with pipe_with
.
struct pollfd
A Vec
of pollfd
.
POLL*
PROT_*
flags for use with mmap
.
The O_*
flags accepted by userfaultfd
.
Constants
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.
ioctl(fd, FIONREAD)
—Returns the number of bytes ready to be read.
ioctl(fd, TCGETS)
ioctl(fd, TIOCGWINSZ)
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.
mmap(fd, len, prot, flags, fd, offset)
munmap(ptr, len)
pipe2(flags)
—Creates a pipe, with flags.
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
directory.
Returns a handle to Linux’s /proc/self
directory.
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.
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.
STDIN_FILENO
—Standard input.
STDOUT_FILENO
—Standard output.
userfaultfd(flags)
write(fd, buf)
—Writes to a stream.
writev(fd, bufs)
—Writes to a stream from multiple buffers.
Type Definitions
A specialized Result
type for posish APIs.
struct termios
, for use with ioctl_tcgets
.
struct winsize