From 65889dbd9218ac3c6036d09693d97e97cb4d6870 Mon Sep 17 00:00:00 2001 From: vasilito Date: Mon, 27 Jul 2026 18:17:28 +0900 Subject: [PATCH] libredox: reference syscall::flag::O_CLOEXEC instead of duplicating O_CLOEXEC was defined in both libredox (0x0100_0000) and syscall (0x0100_0000). Per the Single Source of Truth principle (and the Local Fork Supremacy Policy: 'never version-string-duplicate a Cat 2 fork crate'), a primitive constant should be defined once in the most-primitive crate that has it (syscall) and re-exported by higher-level crates (libredox). Change: libredox::flag::O_CLOEXEC is now 'syscall::flag::O_CLOEXEC' instead of a literal 0x0100_0000. The F_DUPFD_CLOEXEC constant stays as a literal since syscall does not define it (it's a Linux-specific fcntl flag that Redox may not need). --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 018d903bd9..1d6a5f2768 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1188,6 +1188,6 @@ pub mod protocol { } } - pub const O_CLOEXEC: usize = 0x0100_0000; + pub const O_CLOEXEC: usize = syscall::flag::O_CLOEXEC; pub const F_DUPFD_CLOEXEC: usize = 5; }