summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/imp/linux_raw/mod.rs
blob: ed46eaad1f02bc3158bad01e07555b9addf9eab2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! The linux_raw backend.
//!
//! This makes Linux syscalls directly, without going through libc.
//!
//! # Safety
//!
//! These files performs raw system calls, and sometimes passes them
//! uninitialized memory buffers. The signatures in this file are currently
//! manually maintained and must correspond with the signatures of the actual
//! Linux syscalls.
//!
//! Some of this could be auto-generated from the Linux header file
//! <linux/syscalls.h>, but we often need more information than it provides,
//! such as which pointers are array slices, out parameters, or in-out
//! parameters, which integers are owned or borrowed file descriptors, etc.

#[macro_use]
mod arch;
mod conv;
mod elf;
mod reg;
#[cfg(any(feature = "time", target_arch = "x86"))]
mod vdso;
#[cfg(any(feature = "time", target_arch = "x86"))]
mod vdso_wrappers;

#[cfg(any(
    feature = "param",
    feature = "runtime",
    feature = "time",
    target_arch = "x86",
))]
pub(crate) mod param;
// #[cfg(feature = "fs")] // TODO: Enable once `OwnedFd` moves out of the tree.
pub(crate) mod fs;
pub(crate) mod io;
#[cfg(feature = "io_uring")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "io_uring")))]
pub(crate) mod io_uring;
#[cfg(any(feature = "mm", feature = "time", target_arch = "x86"))] // vdso.rs uses `madvise`
pub(crate) mod mm;
#[cfg(feature = "net")]
pub(crate) mod net;
pub(crate) mod process;
#[cfg(feature = "rand")]
pub(crate) mod rand;
#[cfg(feature = "runtime")]
pub(crate) mod runtime;
#[cfg(feature = "termios")]
pub(crate) mod termios;
#[cfg(feature = "thread")]
pub(crate) mod thread;
pub(crate) mod time;

#[cfg(feature = "std")]
pub(crate) mod fd {
    pub use io_lifetimes::*;
    #[allow(unused_imports)]
    pub(crate) use std::os::unix::io::RawFd as LibcFd;
    pub use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
}

#[cfg(not(feature = "std"))]
pub(crate) use crate::io::fd;

// The linux_raw backend doesn't use actual libc, so we define selected
// libc-like definitions in a module called `c`.
pub(crate) mod c;