From e5450de63a6481a2b722cd57a50d94a2b6eea5df Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 6 Jul 2026 18:52:08 +0300 Subject: [PATCH] 0.3.0: add O_CLOEXEC and F_DUPFD_CLOEXEC constants for libredox ABI compatibility --- src/flag.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/flag.rs b/src/flag.rs index a8f22e63e8..fff6d17952 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -56,6 +56,9 @@ pub const F_SETFD: usize = 2; pub const F_GETFL: usize = 3; pub const F_SETFL: usize = 4; +/// Duplicate file descriptor with close-on-exec set (Red Bear extension; libredox ABI). +pub const F_DUPFD_CLOEXEC: usize = 5; + pub const FUTEX_WAIT: usize = 0; pub const FUTEX_WAKE: usize = 1; pub const FUTEX_REQUEUE: usize = 2; @@ -201,6 +204,9 @@ pub const O_NOFOLLOW: usize = 0x8000_0000; pub const O_ACCMODE: usize = O_RDONLY | O_WRONLY | O_RDWR; pub const O_FCNTL_MASK: usize = O_NONBLOCK | O_APPEND | O_ASYNC | O_FSYNC; +/// Atomically set close-on-exec when opening a file (Red Bear extension; libredox ABI). +pub const O_CLOEXEC: usize = 0x0100_0000; + /// Remove directory instead of unlinking file. pub const AT_REMOVEDIR: usize = 0x200;