Skip to content

Commit 9899deb

Browse files
authored
Update libc to 0.2.182 (#7247)
* Update to libc 0.2.182, refactor update script * Fix typing
1 parent 5f6a565 commit 9899deb

4 files changed

Lines changed: 301 additions & 127 deletions

File tree

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ insta = "1.46"
182182
itertools = "0.14.0"
183183
is-macro = "0.3.7"
184184
junction = "1.4.2"
185-
libc = "0.2.180"
185+
libc = "0.2.182"
186186
libffi = "5"
187187
log = "0.4.29"
188188
nix = { version = "0.30", features = ["fs", "user", "process", "term", "time", "signal", "ioctl", "socket", "sched", "zerocopy", "dir", "hostname", "net", "poll"] }

‎crates/vm/src/stdlib/posix.rs‎

Lines changed: 105 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ pub mod module {
6161
use strum::IntoEnumIterator;
6262
use strum_macros::{EnumIter, EnumString};
6363

64-
#[cfg(any(target_os = "android", target_os = "linux"))]
65-
#[pyattr]
66-
use libc::{SCHED_DEADLINE, SCHED_NORMAL};
67-
68-
#[cfg(target_os = "freebsd")]
69-
#[pyattr]
70-
use libc::{MFD_HUGE_MASK, SF_MNOWAIT, SF_NOCACHE, SF_NODISKIO, SF_SYNC};
71-
7264
#[cfg(target_os = "linux")]
7365
#[pyattr]
7466
use libc::PIDFD_NONBLOCK;
@@ -80,42 +72,72 @@ pub mod module {
8072
PRIO_DARWIN_NONUI, PRIO_DARWIN_PROCESS, PRIO_DARWIN_THREAD,
8173
};
8274

75+
#[cfg(target_os = "freebsd")]
76+
#[pyattr]
77+
use libc::{SF_MNOWAIT, SF_NOCACHE, SF_NODISKIO, SF_SYNC};
78+
8379
#[cfg(any(target_os = "android", target_os = "linux"))]
8480
#[pyattr]
8581
use libc::{
8682
CLONE_FILES, CLONE_FS, CLONE_NEWCGROUP, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS,
8783
CLONE_NEWPID, CLONE_NEWUSER, CLONE_NEWUTS, CLONE_SIGHAND, CLONE_SYSVSEM, CLONE_THREAD,
88-
CLONE_VM, EFD_CLOEXEC, EFD_NONBLOCK, EFD_SEMAPHORE, O_NOATIME, O_TMPFILE, P_PIDFD,
89-
SCHED_BATCH, SCHED_IDLE, SCHED_RESET_ON_FORK, SPLICE_F_MORE, SPLICE_F_MOVE,
84+
CLONE_VM, MFD_HUGE_SHIFT, O_NOATIME, O_TMPFILE, P_PIDFD, SCHED_BATCH, SCHED_DEADLINE,
85+
SCHED_IDLE, SCHED_NORMAL, SCHED_RESET_ON_FORK, SPLICE_F_MORE, SPLICE_F_MOVE,
9086
SPLICE_F_NONBLOCK,
9187
};
9288

93-
#[cfg(any(target_os = "android", unix))]
94-
#[pyattr]
95-
use libc::{
96-
F_OK, O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW, O_NONBLOCK, PRIO_PGRP, PRIO_PROCESS, PRIO_USER,
97-
R_OK, RTLD_GLOBAL, RTLD_LAZY, RTLD_LOCAL, RTLD_NOW, W_OK, WCONTINUED, WNOHANG, WUNTRACED,
98-
X_OK,
99-
};
100-
10189
#[cfg(any(target_os = "macos", target_os = "redox"))]
10290
#[pyattr]
10391
use libc::O_SYMLINK;
10492

93+
#[cfg(any(target_os = "android", target_os = "redox", unix))]
94+
#[pyattr]
95+
use libc::{O_NOFOLLOW, PRIO_PGRP, PRIO_PROCESS, PRIO_USER};
96+
97+
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "netbsd"))]
98+
#[pyattr]
99+
use libc::{XATTR_CREATE, XATTR_REPLACE};
100+
101+
#[cfg(any(target_os = "android", target_os = "linux", target_os = "netbsd"))]
102+
#[pyattr]
103+
use libc::O_RSYNC;
104+
105105
#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
106106
#[pyattr]
107107
use libc::{
108-
MFD_ALLOW_SEALING, MFD_CLOEXEC, MFD_HUGETLB, POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE,
109-
POSIX_FADV_NORMAL, POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED,
108+
MFD_ALLOW_SEALING, MFD_CLOEXEC, MFD_HUGE_MASK, MFD_HUGETLB, POSIX_FADV_DONTNEED,
109+
POSIX_FADV_NOREUSE, POSIX_FADV_NORMAL, POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL,
110+
POSIX_FADV_WILLNEED,
110111
};
111112

112-
#[cfg(any(target_os = "android", target_os = "linux", target_os = "netbsd"))]
113+
#[cfg(any(target_os = "android", target_os = "linux", target_os = "redox", unix))]
113114
#[pyattr]
114-
use libc::{TFD_CLOEXEC, TFD_NONBLOCK, TFD_TIMER_ABSTIME, TFD_TIMER_CANCEL_ON_SET};
115+
use libc::{RTLD_LAZY, RTLD_NOW, WNOHANG};
115116

116-
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "netbsd"))]
117+
#[cfg(any(target_os = "android", target_os = "macos", target_os = "redox", unix))]
117118
#[pyattr]
118-
use libc::{XATTR_CREATE, XATTR_REPLACE};
119+
use libc::RTLD_GLOBAL;
120+
121+
#[cfg(any(
122+
target_os = "android",
123+
target_os = "freebsd",
124+
target_os = "linux",
125+
target_os = "redox"
126+
))]
127+
#[pyattr]
128+
use libc::O_PATH;
129+
130+
#[cfg(any(
131+
target_os = "android",
132+
target_os = "freebsd",
133+
target_os = "linux",
134+
target_os = "netbsd"
135+
))]
136+
#[pyattr]
137+
use libc::{
138+
EFD_CLOEXEC, EFD_NONBLOCK, EFD_SEMAPHORE, TFD_CLOEXEC, TFD_NONBLOCK, TFD_TIMER_ABSTIME,
139+
TFD_TIMER_CANCEL_ON_SET,
140+
};
119141

120142
#[cfg(any(
121143
target_os = "android",
@@ -128,21 +150,43 @@ pub mod module {
128150

129151
#[cfg(any(
130152
target_os = "android",
131-
target_os = "freebsd",
132153
target_os = "linux",
133-
target_os = "redox"
154+
target_os = "macos",
155+
target_os = "redox",
156+
unix
134157
))]
135158
#[pyattr]
136-
use libc::O_PATH;
159+
use libc::{F_OK, R_OK, W_OK, X_OK};
137160

138161
#[cfg(any(
139162
target_os = "android",
140-
target_os = "linux",
163+
target_os = "freebsd",
141164
target_os = "netbsd",
142-
target_os = "openbsd"
165+
target_os = "redox",
166+
unix
143167
))]
144168
#[pyattr]
145-
use libc::O_RSYNC;
169+
use libc::O_NONBLOCK;
170+
171+
#[cfg(any(
172+
target_os = "android",
173+
target_os = "freebsd",
174+
target_os = "linux",
175+
target_os = "macos",
176+
target_os = "netbsd"
177+
))]
178+
#[pyattr]
179+
use libc::O_DSYNC;
180+
181+
#[cfg(any(
182+
target_os = "dragonfly",
183+
target_os = "freebsd",
184+
target_os = "linux",
185+
target_os = "macos",
186+
target_os = "netbsd"
187+
))]
188+
#[pyattr]
189+
use libc::SCHED_OTHER;
146190

147191
#[cfg(any(
148192
target_os = "android",
@@ -165,48 +209,62 @@ pub mod module {
165209
use libc::O_DIRECT;
166210

167211
#[cfg(any(
168-
target_os = "android",
169212
target_os = "dragonfly",
170213
target_os = "freebsd",
214+
target_os = "macos",
215+
target_os = "netbsd",
216+
target_os = "redox"
217+
))]
218+
#[pyattr]
219+
use libc::{O_EXLOCK, O_FSYNC, O_SHLOCK};
220+
221+
#[cfg(any(
222+
target_os = "android",
171223
target_os = "linux",
172224
target_os = "macos",
173-
target_os = "netbsd"
225+
target_os = "netbsd",
226+
target_os = "redox",
227+
unix
174228
))]
175229
#[pyattr]
176-
use libc::RTLD_NOLOAD;
230+
use libc::RTLD_LOCAL;
177231

178232
#[cfg(any(
179233
target_os = "android",
180234
target_os = "freebsd",
181235
target_os = "linux",
182-
target_os = "macos",
183236
target_os = "netbsd",
184-
target_os = "openbsd"
237+
target_os = "redox",
238+
unix
185239
))]
186240
#[pyattr]
187-
use libc::O_DSYNC;
241+
use libc::WUNTRACED;
188242

189243
#[cfg(any(
244+
target_os = "android",
190245
target_os = "dragonfly",
191246
target_os = "freebsd",
192247
target_os = "linux",
193248
target_os = "macos",
194-
target_os = "netbsd",
195-
target_os = "openbsd"
249+
target_os = "netbsd"
196250
))]
197251
#[pyattr]
198-
use libc::SCHED_OTHER;
252+
use libc::{
253+
CLD_CONTINUED, CLD_DUMPED, CLD_EXITED, CLD_KILLED, CLD_STOPPED, CLD_TRAPPED, O_SYNC, P_ALL,
254+
P_PGID, P_PID, RTLD_NOLOAD, SCHED_FIFO, SCHED_RR,
255+
};
199256

200257
#[cfg(any(
258+
target_os = "android",
201259
target_os = "dragonfly",
202260
target_os = "freebsd",
203261
target_os = "macos",
204262
target_os = "netbsd",
205-
target_os = "openbsd",
206-
target_os = "redox"
263+
target_os = "redox",
264+
unix
207265
))]
208266
#[pyattr]
209-
use libc::{O_EXLOCK, O_FSYNC, O_SHLOCK};
267+
use libc::O_DIRECTORY;
210268

211269
#[cfg(any(
212270
target_os = "android",
@@ -215,12 +273,11 @@ pub mod module {
215273
target_os = "linux",
216274
target_os = "macos",
217275
target_os = "netbsd",
218-
target_os = "openbsd"
276+
target_os = "redox"
219277
))]
220278
#[pyattr]
221279
use libc::{
222-
CLD_CONTINUED, CLD_DUMPED, CLD_EXITED, CLD_KILLED, CLD_STOPPED, CLD_TRAPPED, F_LOCK,
223-
F_TEST, F_TLOCK, F_ULOCK, O_SYNC, P_ALL, P_PGID, P_PID, SCHED_FIFO, SCHED_RR,
280+
F_LOCK, F_TEST, F_TLOCK, F_ULOCK, O_ASYNC, O_NDELAY, O_NOCTTY, WEXITED, WNOWAIT, WSTOPPED,
224281
};
225282

226283
#[cfg(any(
@@ -230,11 +287,11 @@ pub mod module {
230287
target_os = "linux",
231288
target_os = "macos",
232289
target_os = "netbsd",
233-
target_os = "openbsd",
234-
target_os = "redox"
290+
target_os = "redox",
291+
unix
235292
))]
236293
#[pyattr]
237-
use libc::{O_ASYNC, O_NDELAY, O_NOCTTY, WEXITED, WNOWAIT, WSTOPPED};
294+
use libc::{O_CLOEXEC, WCONTINUED};
238295

239296
#[pyattr]
240297
const EX_OK: i8 = exitcode::OK as i8;

0 commit comments

Comments
 (0)