26 releases (7 breaking)
|0.8.7||Jan 31, 2019|
|0.7.1||Jan 18, 2019|
#82 in Unix APIs
163 downloads per month
Used in 2 crates (1 directly)
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.
- character devices.
- POSIX message queues (<(https://linux.die.net/man/7/mq_overview>).
- pipes and FIFOs (anonymous and named FIFOs), including support for splice, vmsplice and tee.
- sockets (TCP, UDP and the equivalent over Unix Domain Sockets; sendfile supported).
- terminals (serial ports and modems).
Additionally, extensions (
SpliceSender) are implemented for Rust's
- Every effort is made to create the socket file path cleanly;
- To make sure all parent folders exist;
- To make sure parent folder permissions are correctly set;
- To remove any stale files;
- To remove socket file paths on drop (close).
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).
- The use of
tee()are supported for all file descriptors where possible (including Rust's
- To be able to use epoll with standard in (
- To be able to use epoll with standard out (
- To be able to use epoll with standard error (
- Linux zero copy send (
MSG_ZEROCOPY) and receive (
SO_ZEROCOPY), mostly because they have a horrible, hacky API.
- Unix Domain Sockets using
autobind; setting of the
- Receiving credentials over Unix Domain Sockets using
- infiniband sockets.
- canbus (SocketCAN sockets and can4linux http://can-wiki.info/can4linux/man/can4linux_8h_source.html character device drivers).
The license for this project is MIT.