1 //! The linux_raw backend. 2 //! 3 //! This makes Linux syscalls directly, without going through libc. 4 //! 5 //! # Safety 6 //! 7 //! These files performs raw system calls, and sometimes passes them 8 //! uninitialized memory buffers. The signatures in this file are currently 9 //! manually maintained and must correspond with the signatures of the actual 10 //! Linux syscalls. 11 //! 12 //! Some of this could be auto-generated from the Linux header file 13 //! <linux/syscalls.h>, but we often need more information than it provides, 14 //! such as which pointers are array slices, out parameters, or in-out 15 //! parameters, which integers are owned or borrowed file descriptors, etc. 16 17 #[macro_use] 18 mod arch; 19 mod conv; 20 mod elf; 21 mod reg; 22 #[cfg(any(feature = "time", target_arch = "x86"))] 23 mod vdso; 24 #[cfg(any(feature = "time", target_arch = "x86"))] 25 mod vdso_wrappers; 26 27 #[cfg(feature = "fs")] 28 pub(crate) mod fs; 29 pub(crate) mod io; 30 #[cfg(feature = "io_uring")] 31 pub(crate) mod io_uring; 32 #[cfg(feature = "mm")] 33 pub(crate) mod mm; 34 #[cfg(feature = "net")] 35 pub(crate) mod net; 36 #[cfg(any( 37 feature = "param", 38 feature = "runtime", 39 feature = "time", 40 target_arch = "x86", 41 ))] 42 pub(crate) mod param; 43 pub(crate) mod process; 44 #[cfg(feature = "rand")] 45 pub(crate) mod rand; 46 #[cfg(feature = "runtime")] 47 pub(crate) mod runtime; 48 #[cfg(feature = "termios")] 49 pub(crate) mod termios; 50 #[cfg(feature = "thread")] 51 pub(crate) mod thread; 52 pub(crate) mod time; 53 54 #[cfg(feature = "std")] 55 pub(crate) mod fd { 56 pub use io_lifetimes::*; 57 #[allow(unused_imports)] 58 pub(crate) use std::os::unix::io::RawFd as LibcFd; 59 pub use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; 60 } 61 62 #[cfg(not(feature = "std"))] 63 pub(crate) use crate::io::fd; 64 65 // The linux_raw backend doesn't use actual libc, so we define selected 66 // libc-like definitions in a module called `c`. 67 pub(crate) mod c; 68