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