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 elf;
21mod reg;
22#[cfg(any(feature = "time", target_arch = "x86"))]
23mod vdso;
24#[cfg(any(feature = "time", target_arch = "x86"))]
25mod 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))]
40pub(crate) mod fs;
41pub(crate) mod io;
42#[cfg(feature = "io_uring")]
43pub(crate) mod io_uring;
44#[cfg(feature = "mm")]
45pub(crate) mod mm;
46#[cfg(feature = "net")]
47pub(crate) mod net;
48#[cfg(any(
49 feature = "param",
50 feature = "runtime",
51 feature = "time",
52 target_arch = "x86",
53))]
54pub(crate) mod param;
55pub(crate) mod process;
56#[cfg(feature = "pty")]
57pub(crate) mod pty;
58#[cfg(feature = "rand")]
59pub(crate) mod rand;
60#[cfg(feature = "runtime")]
61pub(crate) mod runtime;
62#[cfg(feature = "termios")]
63pub(crate) mod termios;
64#[cfg(feature = "thread")]
65pub(crate) mod thread;
66pub(crate) mod time;
67
68#[cfg(feature = "std")]
69pub(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"))]
77pub(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`.
81pub(crate) mod c;
82