-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Attempt to automate posix consts #6117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,39 +47,177 @@ pub mod module { | |||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
| use strum_macros::{EnumIter, EnumString}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "android")] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{PRIO_PGRP, PRIO_PROCESS, PRIO_USER}; | ||||||||||||||||||||||||
| use libc::{ | ||||||||||||||||||||||||
| F_OK, O_CLOEXEC, O_DIRECTORY, O_NOFOLLOW, O_NONBLOCK, PRIO_PGRP, PRIO_PROCESS, PRIO_USER, | ||||||||||||||||||||||||
| R_OK, RTLD_GLOBAL, RTLD_LAZY, RTLD_LOCAL, RTLD_NOW, W_OK, WCONTINUED, WNOHANG, WUNTRACED, | ||||||||||||||||||||||||
| X_OK, | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "freebsd")] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{MFD_HUGE_MASK, SF_MNOWAIT, SF_NOCACHE, SF_NODISKIO, SF_SYNC}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "linux")] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::PIDFD_NONBLOCK; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "macos")] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{ | ||||||||||||||||||||||||
| O_EVTONLY, O_NOFOLLOW_ANY, PRIO_DARWIN_BG, PRIO_DARWIN_NONUI, PRIO_DARWIN_PROCESS, | ||||||||||||||||||||||||
| PRIO_DARWIN_THREAD, | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any(target_os = "android", target_os = "linux"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{ | ||||||||||||||||||||||||
| CLONE_FILES, CLONE_FS, CLONE_NEWCGROUP, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, | ||||||||||||||||||||||||
| CLONE_NEWPID, CLONE_NEWUSER, CLONE_NEWUTS, CLONE_SIGHAND, CLONE_SYSVSEM, CLONE_THREAD, | ||||||||||||||||||||||||
| CLONE_VM, EFD_CLOEXEC, EFD_NONBLOCK, EFD_SEMAPHORE, O_NOATIME, O_TMPFILE, P_PIDFD, | ||||||||||||||||||||||||
| SCHED_BATCH, SCHED_IDLE, SCHED_RESET_ON_FORK, SPLICE_F_MORE, SPLICE_F_MOVE, | ||||||||||||||||||||||||
| SPLICE_F_NONBLOCK, | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+65
to
+74
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainSplit Linux-only flags from Android-safe ones; likely Android build break Several items here are Linux-only or not guaranteed in bionic (e.g., P_PIDFD, O_TMPFILE, O_NOATIME, CLONE_NEW*). Keep eventfd on Android; move the rest to Linux-only. -#[cfg(any(target_os = "android", target_os = "linux"))]
-#[pyattr]
-use libc::{
- CLONE_FILES, CLONE_FS, CLONE_NEWCGROUP, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS,
- CLONE_NEWPID, CLONE_NEWUSER, CLONE_NEWUTS, CLONE_SIGHAND, CLONE_SYSVSEM, CLONE_THREAD,
- CLONE_VM, EFD_CLOEXEC, EFD_NONBLOCK, EFD_SEMAPHORE, O_NOATIME, O_TMPFILE, P_PIDFD,
- SCHED_BATCH, SCHED_IDLE, SCHED_RESET_ON_FORK, SPLICE_F_MORE, SPLICE_F_MOVE,
- SPLICE_F_NONBLOCK,
-};
+# // Android + Linux: eventfd
+#[cfg(any(target_os = "android", target_os = "linux"))]
+#[pyattr]
+use libc::{EFD_CLOEXEC, EFD_NONBLOCK, EFD_SEMAPHORE};
+
+# // Linux-only: clone namespaces, pidfd, tmpfile, noatime, splice, sched_*
+#[cfg(target_os = "linux")]
+#[pyattr]
+use libc::{
+ CLONE_FILES, CLONE_FS, CLONE_NEWCGROUP, CLONE_NEWIPC, CLONE_NEWNET, CLONE_NEWNS, CLONE_NEWPID,
+ CLONE_NEWUSER, CLONE_NEWUTS, CLONE_SIGHAND, CLONE_SYSVSEM, CLONE_THREAD, CLONE_VM, O_NOATIME,
+ O_TMPFILE, P_PIDFD, SCHED_BATCH, SCHED_IDLE, SCHED_RESET_ON_FORK, SPLICE_F_MORE, SPLICE_F_MOVE,
+ SPLICE_F_NONBLOCK,
+};To confirm bionic coverage, please verify: 🌐 Web query: 💡 Result: O_TMPFILE — yes. [1] Sources:
Only exclude P_PIDFD on Android; keep O_TMPFILE, O_NOATIME, CLONE_NEWCGROUP under Android+Linux O_TMPFILE, O_NOATIME and CLONE_NEWCGROUP are defined in bionic’s asm-generic fcntl.h and linux/sched.h and safe on Android (android.googlesource.com). P_PIDFD is not defined in bionic’s public headers (sys/pidfd.h provides APIs but no P_PIDFD) (android.googlesource.com); move only P_PIDFD into the 🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| #[cfg(any(target_os = "macos", target_os = "redox"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::O_SYMLINK; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{ | ||||||||||||||||||||||||
| MFD_ALLOW_SEALING, MFD_CLOEXEC, MFD_HUGETLB, POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE, | ||||||||||||||||||||||||
| POSIX_FADV_NORMAL, POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED, | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+87
to
+93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Split memfd flags from POSIX_FADV_*; avoid FreeBSD/Android build breaks
Apply: -#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
-#[pyattr]
-use libc::{
- MFD_ALLOW_SEALING, MFD_CLOEXEC, MFD_HUGETLB, POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE,
- POSIX_FADV_NORMAL, POSIX_FADV_RANDOM, POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED,
-};
+// memfd_* flags: Linux/Android only
+#[cfg(any(target_os = "android", target_os = "linux"))]
+#[pyattr]
+use libc::{MFD_ALLOW_SEALING, MFD_CLOEXEC, MFD_HUGETLB};
+
+// posix_fadvise advice values
+#[cfg(any(target_os = "android", target_os = "freebsd", target_os = "linux"))]
+#[pyattr]
+use libc::{
+ POSIX_FADV_DONTNEED, POSIX_FADV_NOREUSE, POSIX_FADV_NORMAL, POSIX_FADV_RANDOM,
+ POSIX_FADV_SEQUENTIAL, POSIX_FADV_WILLNEED,
+};🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| #[cfg(any(target_os = "android", target_os = "linux", target_os = "netbsd"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{TFD_CLOEXEC, TFD_NONBLOCK, TFD_TIMER_ABSTIME, TFD_TIMER_CANCEL_ON_SET}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+94
to
+97
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restrict timerfd constants to Linux/Android TFD_* are Linux-only (and present on Android); NetBSD doesn’t provide timerfd. Apply: -#[cfg(any(target_os = "android", target_os = "linux", target_os = "netbsd"))]
+#[cfg(any(target_os = "android", target_os = "linux"))]
#[pyattr]
use libc::{TFD_CLOEXEC, TFD_NONBLOCK, TFD_TIMER_ABSTIME, TFD_TIMER_CANCEL_ON_SET};📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| #[cfg(any(target_os = "linux", target_os = "macos", target_os = "netbsd"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{XATTR_CREATE, XATTR_REPLACE}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "netbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{GRND_NONBLOCK, GRND_RANDOM}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "redox" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::O_PATH; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+111
to
+119
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O_PATH is Linux-specific FreeBSD/Redox don’t expose O_PATH like Linux; this will likely fail to compile on those targets. Apply: -#[cfg(any(
- target_os = "android",
- target_os = "freebsd",
- target_os = "linux",
- target_os = "redox"
-))]
+#[cfg(any(target_os = "android", target_os = "linux"))]
#[pyattr]
use libc::O_PATH;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "openbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::O_RSYNC; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
|
Comment on lines
+120
to
+128
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent ❓ Verification inconclusiveTighten O_RSYNC gating O_RSYNC is a Linux-ism (alias of O_SYNC). It’s not generally available on *BSDs and may not be exposed by libc there. Tentative change: -#[cfg(any(
- target_os = "android",
- target_os = "linux",
- target_os = "netbsd",
- target_os = "openbsd"
-))]
-#[pyattr]
-use libc::O_RSYNC;
+#[cfg(target_os = "linux")]
+#[pyattr]
+use libc::O_RSYNC;If Android’s bionic exposes O_RSYNC in your minimum API level, we can include it after verification. Restrict O_RSYNC import to Linux O_RSYNC is only defined in libc for Linux (added under “Solarish” in libc 0.2.160) and isn’t exposed on NetBSD or OpenBSD (github.com). Change the cfg to target Linux only; if Android’s bionic proves to define O_RSYNC on your minimum API level, you can re-add it then. -#[cfg(any(
- target_os = "android",
- target_os = "linux",
- target_os = "netbsd",
- target_os = "openbsd"
-))]
-#[pyattr]
-use libc::O_RSYNC;
+#[cfg(target_os = "linux")]
+#[pyattr]
+use libc::O_RSYNC;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "macos" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{SEEK_DATA, SEEK_HOLE}; | ||||||||||||||||||||||||
| use libc::{RTLD_NODELETE, SEEK_DATA, SEEK_HOLE}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(not(any(target_os = "redox", target_os = "freebsd")))] | ||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "netbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::O_DSYNC; | ||||||||||||||||||||||||
| use libc::O_DIRECT; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "netbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{O_CLOEXEC, O_NONBLOCK, WNOHANG}; | ||||||||||||||||||||||||
| use libc::RTLD_NOLOAD; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "macos")] | ||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "openbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{O_EVTONLY, O_FSYNC, O_NOFOLLOW_ANY, O_SYMLINK}; | ||||||||||||||||||||||||
| use libc::O_DSYNC; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(not(target_os = "redox"))] | ||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "openbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{O_NDELAY, O_NOCTTY}; | ||||||||||||||||||||||||
| use libc::SCHED_OTHER; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "openbsd", | ||||||||||||||||||||||||
| target_os = "redox" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{RTLD_GLOBAL, RTLD_LAZY, RTLD_LOCAL, RTLD_NOW}; | ||||||||||||||||||||||||
| use libc::{O_EXLOCK, O_FSYNC, O_SHLOCK}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "linux")] | ||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "openbsd" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{GRND_NONBLOCK, GRND_RANDOM}; | ||||||||||||||||||||||||
| use libc::{ | ||||||||||||||||||||||||
| CLD_CONTINUED, CLD_DUMPED, CLD_EXITED, CLD_KILLED, CLD_STOPPED, CLD_TRAPPED, F_LOCK, | ||||||||||||||||||||||||
| F_TEST, F_TLOCK, F_ULOCK, O_NDELAY, O_NOCTTY, O_SYNC, P_ALL, P_PGID, P_PID, SCHED_FIFO, | ||||||||||||||||||||||||
| SCHED_RR, | ||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "openbsd", | ||||||||||||||||||||||||
| target_os = "redox" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| use libc::{O_ASYNC, WEXITED, WNOWAIT, WSTOPPED}; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const EX_OK: i8 = exitcode::OK as i8; | ||||||||||||||||||||||||
|
|
@@ -129,49 +267,6 @@ pub mod module { | |||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const EX_CONFIG: i8 = exitcode::CONFIG as i8; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "macos" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const SCHED_RR: i32 = libc::SCHED_RR; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "android", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "macos" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const SCHED_FIFO: i32 = libc::SCHED_FIFO; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any( | ||||||||||||||||||||||||
| target_os = "macos", | ||||||||||||||||||||||||
| target_os = "linux", | ||||||||||||||||||||||||
| target_os = "freebsd", | ||||||||||||||||||||||||
| target_os = "dragonfly", | ||||||||||||||||||||||||
| target_os = "netbsd", | ||||||||||||||||||||||||
| target_os = "macos" | ||||||||||||||||||||||||
| ))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const SCHED_OTHER: i32 = libc::SCHED_OTHER; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any(target_os = "linux", target_os = "android"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const SCHED_IDLE: i32 = libc::SCHED_IDLE; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any(target_os = "linux", target_os = "android"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const SCHED_BATCH: i32 = libc::SCHED_BATCH; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "macos"))] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const POSIX_SPAWN_OPEN: i32 = PosixSpawnFileActionIdentifier::Open as i32; | ||||||||||||||||||||||||
|
|
@@ -184,10 +279,6 @@ pub mod module { | |||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const POSIX_SPAWN_DUP2: i32 = PosixSpawnFileActionIdentifier::Dup2 as i32; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| #[cfg(target_os = "macos")] | ||||||||||||||||||||||||
| #[pyattr] | ||||||||||||||||||||||||
| const _COPYFILE_DATA: u32 = 1 << 3; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| impl TryFromObject for BorrowedFd<'_> { | ||||||||||||||||||||||||
| fn try_from_object(vm: &VirtualMachine, obj: PyObjectRef) -> PyResult<Self> { | ||||||||||||||||||||||||
| let fd = i32::try_from_object(vm, obj)?; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix FreeBSD import: MFD_HUGE_MASK is Linux-only
MFD_HUGE_MASK isn’t available on FreeBSD (it’s a Linux memfd hugepage flag) and will fail to compile under that target.
Apply:
📝 Committable suggestion