Debian Codegraph @

debian/missing-sources/rustix/src/backend/linux_raw/mod.rs

raw
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 module 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 reg;
21 #[cfg(any(feature = "time", feature = "thread", target_arch = "x86"))]
22 mod vdso;
23 #[cfg(any(feature = "time", feature = "thread", target_arch = "x86"))]
24 mod vdso_wrappers;
25
26 #[cfg(feature = "event")]
27 pub(crate) mod event;
28 #[cfg(any(
29 feature = "fs",
30 all(
31 not(feature = "use-libc-auxv"),
32 not(feature = "use-explicitly-provided-auxv"),
33 any(
34 feature = "param",
35 feature = "runtime",
36 feature = "thread",
37 feature = "time",
38 target_arch = "x86",
39 )
40 )
41 ))]
42 pub(crate) mod fs;
43 pub(crate) mod io;
44 #[cfg(feature = "io_uring")]
45 pub(crate) mod io_uring;
46 #[cfg(feature = "mm")]
47 pub(crate) mod mm;
48 #[cfg(feature = "mount")]
49 pub(crate) mod mount;
50 #[cfg(feature = "net")]
51 pub(crate) mod net;
52 #[cfg(any(
53 feature = "param",
54 feature = "runtime",
55 feature = "thread",
56 feature = "time",
57 target_arch = "x86",
58 ))]
59 pub(crate) mod param;
60 #[cfg(feature = "pipe")]
61 pub(crate) mod pipe;
62 #[cfg(feature = "process")]
63 pub(crate) mod process;
64 #[cfg(feature = "pty")]
65 pub(crate) mod pty;
66 #[cfg(feature = "rand")]
67 pub(crate) mod rand;
68 #[cfg(feature = "runtime")]
69 pub(crate) mod runtime;
70 #[cfg(feature = "shm")]
71 pub(crate) mod shm;
72 #[cfg(feature = "system")]
73 pub(crate) mod system;
74 #[cfg(feature = "termios")]
75 pub(crate) mod termios;
76 #[cfg(feature = "thread")]
77 pub(crate) mod thread;
78 #[cfg(feature = "time")]
79 pub(crate) mod time;
80
81 // Re-export the maybe-polyfill `core::os::fd`.
82 pub(crate) use crate::maybe_polyfill::os::fd;
83
84 // The linux_raw backend doesn't use actual libc, so we define selected
85 // libc-like definitions in a module called `c`.
86 pub(crate) mod c;
87
88 // Private modules used by multiple public modules.
89 #[cfg(any(feature = "process", feature = "runtime"))]
90 pub(crate) mod pid;
91 #[cfg(any(feature = "process", feature = "thread"))]
92 pub(crate) mod prctl;
93 #[cfg(any(
94 feature = "fs",
95 feature = "process",
96 feature = "thread",
97 all(
98 not(feature = "use-libc-auxv"),
99 not(feature = "use-explicitly-provided-auxv"),
100 any(
101 feature = "param",
102 feature = "runtime",
103 feature = "time",
104 target_arch = "x86",
105 )
106 )
107 ))]
108 pub(crate) mod ugid;
109
110 /// The maximum number of buffers that can be passed into a vectored I/O system
111 /// call on the current platform.
112 const MAX_IOV: usize = linux_raw_sys::general::UIO_MAXIOV as usize;