[file-descriptors] is a Rust crate wrapping the various kinds of file descriptors with safe abstractions, including IPv4 / IPv6 sockets, Unix domain sockets, epoll, timerfd, signalfd, eventfd, POSIX message queues, pipes, FIFOs, terminals (and serial ports), character devices, inotify, fanotify and Files.
There is a particularly extensive and safe wrapper for signals and terminals.
Fully functional on Android and Linux.
Somewhat functional on Fuschia, Illumos (a Solaris fork), uclibc and emscripten.
Support for the BSDs is desired.
The above features may not work correctly after the use of seccomp
to lock down system calls (particularly the attempt to delete a socket file path on close).
splice()
, vmsplice()
and tee()
are supported for all file descriptors where possible (including Rust's ::std::fs::File
).stdin
), use pipes_and_fifos::ReceivePipeFileDescriptor::standard_in()
.stdout
), use pipes_and_fifos::SendPipeFileDescriptor::standard_out()
.stderr
), use pipes_and_fifos::SendPipeFileDescriptor::standard_error()
.MSG_ZEROCOPY
) and receive (SO_ZEROCOPY
), mostly because they have a horrible, hacky API.SO_BUSY_POLL
and SO_INCOMING_CPU
.autobind
; setting of the SO_PASSCRED
socket option.recvmsg()
.mkfifo()
.mknod()
.The license for this project is MIT.