From aeabac730b62d2fabec0954a0a062f695465c568 Mon Sep 17 00:00:00 2001 From: Red Bear OS Date: Tue, 14 Jul 2026 08:30:50 +0900 Subject: [PATCH] fix(open): use FILETABLE-aware openat_into_posix to keep fd tables in sync --- redox-rt/src/sys.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/redox-rt/src/sys.rs b/redox-rt/src/sys.rs index a90cc926d0..addcaefef7 100644 --- a/redox-rt/src/sys.rs +++ b/redox-rt/src/sys.rs @@ -610,13 +610,8 @@ pub fn open>(path: T, flags: usize) -> Result { let _siglock = tmp_disable_signals(); let ns_fd = crate::current_namespace_fd()?; - - let posix_fd = syscall::openat( - ns_fd, - path.as_ref(), - flags, - 0, - ); + let fcntl_flags = flags & syscall::O_FCNTL_MASK; + let posix_fd = openat_into_posix(ns_fd, path.as_ref(), flags, fcntl_flags); if let Err(ref e) = posix_fd { let p = path.as_ref(); let mut buf = [0u8; 256]; @@ -640,7 +635,6 @@ pub fn open>(path: T, flags: usize) -> Result { let _ = syscall::write(2, &buf[..len]); } let posix_fd = posix_fd?; - register_external_fd(posix_fd)?; Ok(posix_fd) }