From d6b223dc28a5b9c7e30ee1990e6dc3fac04e7f7b Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 27 Jul 2026 23:08:58 +0900 Subject: [PATCH] libredox: revert O_CLOEXEC to literal in protocol module (fixes standalone build) Commit 65889db changed protocol::O_CLOEXEC to reference syscall::flag::O_CLOEXEC, but the `protocol` module is built standalone by relibc (default-features=false, features=["protocol"]), where the optional redox_syscall/base/libc crates are NOT linked. That produced E0433 'unresolved module or unlinked crate syscall' and failed the relibc/prefix build. Every other syscall:: use in libredox is #[cfg(feature="redox_syscall")] -gated; this const was not. 0x0100_0000 is exactly syscall's O_CLOEXEC value, so the literal is correct (the single-source-of-truth concern is cosmetic here). Co-Authored-By: Claude Opus 4.8 (1M context) --- src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 1d6a5f2768..e44376d4ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1188,6 +1188,10 @@ pub mod protocol { } } - pub const O_CLOEXEC: usize = syscall::flag::O_CLOEXEC; + // Literal, NOT `syscall::flag::O_CLOEXEC`: this `protocol` module is built + // standalone by relibc (default-features=false, features=["protocol"]), so + // the optional `redox_syscall`/`base`/`libc` crates are NOT linked here. + // 0x0100_0000 is exactly syscall's O_CLOEXEC value. + pub const O_CLOEXEC: usize = 0x0100_0000; pub const F_DUPFD_CLOEXEC: usize = 5; }