Fix for F_DUPFD_CLOEXEC, add TODO for usage in upper table
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user