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 // Weak symbols used by the use-libc-auxv feature for glibc 2.15 support. 18 #[cfg(feature = "use-libc-auxv")] 19 #[macro_use] 20 mod weak; 21 22 #[macro_use] 23 mod arch; 24 mod conv; 25 mod elf; 26 mod reg; 27 #[cfg(any(feature = "time", target_arch = "x86"))] 28 mod vdso; 29 #[cfg(any(feature = "time", target_arch = "x86"))] 30 mod vdso_wrappers; 31 32 #[cfg(feature = "fs")] 33 pub(crate) mod fs; 34 pub(crate) mod io; 35 #[cfg(feature = "io_uring")] 36 pub(crate) mod io_uring; 37 #[cfg(feature = "mm")] 38 pub(crate) mod mm; 39 #[cfg(feature = "net")] 40 pub(crate) mod net; 41 #[cfg(any( 42 feature = "param", 43 feature = "runtime", 44 feature = "time", 45 target_arch = "x86", 46 ))] 47 pub(crate) mod param; 48 pub(crate) mod process; 49 #[cfg(feature = "rand")] 50 pub(crate) mod rand; 51 #[cfg(feature = "runtime")] 52 pub(crate) mod runtime; 53 #[cfg(feature = "termios")] 54 pub(crate) mod termios; 55 #[cfg(feature = "thread")] 56 pub(crate) mod thread; 57 pub(crate) mod time; 58 59 #[cfg(feature = "std")] 60 pub(crate) mod fd { 61 pub use io_lifetimes::*; 62 #[allow(unused_imports)] 63 pub(crate) use std::os::unix::io::RawFd as LibcFd; 64 pub use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; 65 } 66 67 #[cfg(not(feature = "std"))] 68 pub(crate) use crate::io::fd; 69 70 // The linux_raw backend doesn't use actual libc, so we define selected 71 // libc-like definitions in a module called `c`. 72 pub(crate) mod c; 73