From 01f01d3bd49df5af52e0beaff168795a3d70ec28 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Mon, 17 Nov 2025 17:46:57 -0700 Subject: [PATCH] Fix for F_DUPFD_CLOEXEC, add TODO for usage in upper table --- redox-rt/src/proc.rs | 1 + src/header/fcntl/mod.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/redox-rt/src/proc.rs b/redox-rt/src/proc.rs index de222d1bb3..e5a443a838 100644 --- a/redox-rt/src/proc.rs +++ b/redox-rt/src/proc.rs @@ -689,6 +689,7 @@ impl FdGuard { pub fn to_upper(self) -> Result { // Move to upper table if necessary let fd = if self.fd & syscall::UPPER_FDTBL_TAG == 0 { + //TODO: use F_DUPFD_CLOEXEC? let fd = syscall::fcntl(self.fd, syscall::F_DUPFD, syscall::UPPER_FDTBL_TAG)?; drop(self); fd diff --git a/src/header/fcntl/mod.rs b/src/header/fcntl/mod.rs index cf88a50f85..82716818dc 100644 --- a/src/header/fcntl/mod.rs +++ b/src/header/fcntl/mod.rs @@ -31,7 +31,7 @@ pub const F_SETFL: c_int = 4; pub const F_GETLK: c_int = 5; pub const F_SETLK: c_int = 6; pub const F_SETLKW: c_int = 7; -pub cosnt F_DUPFD_CLOEXEC: c_int = 1030; +pub const F_DUPFD_CLOEXEC: c_int = 1030; pub const F_RDLCK: c_int = 0; pub const F_WRLCK: c_int = 1;