Fix for F_DUPFD_CLOEXEC, add TODO for usage in upper table

This commit is contained in:
Jeremy Soller
2025-11-17 17:46:57 -07:00
parent db2600881f
commit 01f01d3bd4
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -689,6 +689,7 @@ impl FdGuard<false> {
pub fn to_upper(self) -> Result<FdGuardUpper> {
// 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
+1 -1
View File
@@ -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;