Crates.io | file-descriptors |
lib.rs | file-descriptors |
version | 0.9.1 |
source | src |
created_at | 2019-01-08 10:36:25.171817 |
updated_at | 2020-03-21 12:20:22.709267 |
description | Wrapper around the common kinds of (mostly Linux) file descriptors, including sockets, pipes, FIFOs, terminals, serial ports, character devices, epoll, POSIX message queues, timerfd, eventfd, signalfd fanotify and inotify |
homepage | https://github.com/lemonrock/file-descriptors |
repository | https://github.com/lemonrock/file-descriptors.git |
max_upload_size | |
id | 107171 |
size | 787,002 |
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.
Additionally, extensions (SendFile
, SpliceRecipient
and SpliceSender
) are implemented for Rust's File
.
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 splice()
, vmsplice()
and tee()
are supported for all file descriptors where possible (including Rust's ::std::fs::File
).
To be able to use epoll with standard in (stdin
), use pipes_and_fifos::ReceivePipeFileDescriptor::standard_in()
.
To be able to use epoll with standard out (stdout
), use pipes_and_fifos::SendPipeFileDescriptor::standard_out()
.
To be able to use epoll with standard error (stderr
), use pipes_and_fifos::SendPipeFileDescriptor::standard_error()
.
Linux zero copy send (MSG_ZEROCOPY
) and receive (SO_ZEROCOPY
), mostly because they have a horrible, hacky API.
SO_BUSY_POLL
and SO_INCOMING_CPU
.
Unix Domain Sockets using autobind
; setting of the SO_PASSCRED
socket option.
Receiving credentials over Unix Domain Sockets using recvmsg()
.
mkfifo()
.
mknod()
.
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.