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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
use super::super::c;
#[cfg(not(target_os = "wasi"))]
use bitflags::bitflags;
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
pub struct ReadWriteFlags: c::c_int {
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const DSYNC = c::RWF_DSYNC;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const HIPRI = c::RWF_HIPRI;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const SYNC = c::RWF_SYNC;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const NOWAIT = c::RWF_NOWAIT;
#[cfg(all(target_os = "linux", target_env = "gnu"))]
const APPEND = c::RWF_APPEND;
}
}
#[cfg(not(target_os = "wasi"))]
bitflags! {
pub struct DupFlags: c::c_int {
#[cfg(not(any(
target_os = "android",
target_os = "ios",
target_os = "macos",
target_os = "redox",
)))] const CLOEXEC = c::O_CLOEXEC;
}
}
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "wasi")))]
bitflags! {
pub struct PipeFlags: c::c_int {
const CLOEXEC = c::O_CLOEXEC;
#[cfg(not(any(
target_os = "haiku",
target_os = "illumos",
target_os = "openbsd",
target_os = "redox",
target_os = "solaris",
)))]
const DIRECT = c::O_DIRECT;
const NONBLOCK = c::O_NONBLOCK;
}
}
#[cfg(any(target_os = "android", target_os = "linux"))]
bitflags! {
pub struct EventfdFlags: c::c_int {
const CLOEXEC = c::EFD_CLOEXEC;
const NONBLOCK = c::EFD_NONBLOCK;
const SEMAPHORE = c::EFD_SEMAPHORE;
}
}
#[cfg(not(any(
target_os = "haiku",
target_os = "illumos",
target_os = "redox",
target_os = "solaris",
target_os = "wasi",
)))]
pub const PIPE_BUF: usize = c::PIPE_BUF;
#[cfg(not(any(windows, target_os = "redox")))]
pub(crate) const AT_FDCWD: c::c_int = c::AT_FDCWD;
#[cfg(not(windows))]
pub(crate) const STDIN_FILENO: c::c_int = c::STDIN_FILENO;
#[cfg(not(windows))]
pub(crate) const STDOUT_FILENO: c::c_int = c::STDOUT_FILENO;
#[cfg(not(windows))]
pub(crate) const STDERR_FILENO: c::c_int = c::STDERR_FILENO;