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 (any( |
28 | feature = "fs" , |
29 | all( |
30 | not(feature = "use-libc-auxv" ), |
31 | not(target_vendor = "mustang" ), |
32 | any( |
33 | feature = "param" , |
34 | feature = "runtime" , |
35 | feature = "time" , |
36 | target_arch = "x86" , |
37 | ) |
38 | ) |
39 | ))] |
40 | pub(crate) mod fs; |
41 | pub(crate) mod io; |
42 | #[cfg (feature = "io_uring" )] |
43 | pub(crate) mod io_uring; |
44 | #[cfg (feature = "mm" )] |
45 | pub(crate) mod mm; |
46 | #[cfg (feature = "net" )] |
47 | pub(crate) mod net; |
48 | #[cfg (any( |
49 | feature = "param" , |
50 | feature = "runtime" , |
51 | feature = "time" , |
52 | target_arch = "x86" , |
53 | ))] |
54 | pub(crate) mod param; |
55 | pub(crate) mod process; |
56 | #[cfg (feature = "pty" )] |
57 | pub(crate) mod pty; |
58 | #[cfg (feature = "rand" )] |
59 | pub(crate) mod rand; |
60 | #[cfg (feature = "runtime" )] |
61 | pub(crate) mod runtime; |
62 | #[cfg (feature = "termios" )] |
63 | pub(crate) mod termios; |
64 | #[cfg (feature = "thread" )] |
65 | pub(crate) mod thread; |
66 | pub(crate) mod time; |
67 | |
68 | #[cfg (feature = "std" )] |
69 | pub(crate) mod fd { |
70 | pub use io_lifetimes::*; |
71 | #[allow (unused_imports)] |
72 | pub(crate) use std::os::unix::io::RawFd as LibcFd; |
73 | pub use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd}; |
74 | } |
75 | |
76 | #[cfg (not(feature = "std" ))] |
77 | pub(crate) use crate::io::fd; |
78 | |
79 | // The linux_raw backend doesn't use actual libc, so we define selected |
80 | // libc-like definitions in a module called `c`. |
81 | pub(crate) mod c; |
82 | |