rustix/backend/libc/process/
types.rs1#[cfg(not(any(
2 target_os = "espidf",
3 target_os = "fuchsia",
4 target_os = "redox",
5 target_os = "vita",
6 target_os = "wasi"
7)))]
8use crate::backend::c;
9
10#[cfg(not(any(
17 target_os = "espidf",
18 target_os = "fuchsia",
19 target_os = "horizon",
20 target_os = "redox",
21 target_os = "vita",
22 target_os = "wasi"
23)))]
24#[derive(Copy, Clone, Debug, Eq, PartialEq)]
25#[cfg_attr(not(target_os = "l4re"), repr(u32))]
26#[cfg_attr(target_os = "l4re", repr(u64))]
27#[non_exhaustive]
28pub enum Resource {
29 Cpu = bitcast!(c::RLIMIT_CPU),
31 Fsize = bitcast!(c::RLIMIT_FSIZE),
33 Data = bitcast!(c::RLIMIT_DATA),
35 Stack = bitcast!(c::RLIMIT_STACK),
37 #[cfg(not(target_os = "haiku"))]
39 Core = bitcast!(c::RLIMIT_CORE),
40 #[cfg(not(any(
43 apple,
44 solarish,
45 target_os = "cygwin",
46 target_os = "haiku",
47 target_os = "nto",
48 )))]
49 Rss = bitcast!(c::RLIMIT_RSS),
50 #[cfg(not(any(solarish, target_os = "cygwin", target_os = "haiku")))]
52 Nproc = bitcast!(c::RLIMIT_NPROC),
53 Nofile = bitcast!(c::RLIMIT_NOFILE),
55 #[cfg(not(any(solarish, target_os = "aix", target_os = "cygwin", target_os = "haiku")))]
57 Memlock = bitcast!(c::RLIMIT_MEMLOCK),
58 #[cfg(not(target_os = "openbsd"))]
60 As = bitcast!(c::RLIMIT_AS),
61 #[cfg(not(any(
63 bsd,
64 solarish,
65 target_os = "aix",
66 target_os = "cygwin",
67 target_os = "haiku",
68 target_os = "hurd",
69 target_os = "nto",
70 )))]
71 Locks = bitcast!(c::RLIMIT_LOCKS),
72 #[cfg(not(any(
74 bsd,
75 solarish,
76 target_os = "aix",
77 target_os = "cygwin",
78 target_os = "haiku",
79 target_os = "hurd",
80 target_os = "nto",
81 )))]
82 Sigpending = bitcast!(c::RLIMIT_SIGPENDING),
83 #[cfg(not(any(
85 bsd,
86 solarish,
87 target_os = "aix",
88 target_os = "cygwin",
89 target_os = "haiku",
90 target_os = "hurd",
91 target_os = "nto",
92 )))]
93 Msgqueue = bitcast!(c::RLIMIT_MSGQUEUE),
94 #[cfg(not(any(
96 bsd,
97 solarish,
98 target_os = "aix",
99 target_os = "cygwin",
100 target_os = "haiku",
101 target_os = "hurd",
102 target_os = "nto",
103 )))]
104 Nice = bitcast!(c::RLIMIT_NICE),
105 #[cfg(not(any(
107 bsd,
108 solarish,
109 target_os = "aix",
110 target_os = "cygwin",
111 target_os = "haiku",
112 target_os = "hurd",
113 target_os = "nto",
114 )))]
115 Rtprio = bitcast!(c::RLIMIT_RTPRIO),
116 #[cfg(not(any(
118 bsd,
119 solarish,
120 target_os = "aix",
121 target_os = "android",
122 target_os = "cygwin",
123 target_os = "emscripten",
124 target_os = "haiku",
125 target_os = "hurd",
126 target_os = "nto",
127 )))]
128 Rttime = bitcast!(c::RLIMIT_RTTIME),
129}
130
131#[cfg(apple)]
132#[allow(non_upper_case_globals)]
133impl Resource {
134 pub const Rss: Self = Self::As;
136}
137
138#[cfg(freebsdlike)]
139pub type RawId = c::id_t;