Define F_OFD fcntl commands

This commit is contained in:
Jeremy Soller
2025-12-19 09:23:33 -07:00
parent c1d3ff3d53
commit 6617f6afda
+5 -3
View File
@@ -35,6 +35,9 @@ 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 const F_OFD_GETLK: c_int = 36;
pub const F_OFD_SETLK: c_int = 37;
pub const F_OFD_SETLKW: c_int = 38;
pub const F_DUPFD_CLOEXEC: c_int = 1030;
pub const F_RDLCK: c_int = 0;
@@ -68,9 +71,8 @@ pub struct flock {
pub unsafe extern "C" fn fcntl(fildes: c_int, cmd: c_int, mut __valist: ...) -> c_int {
// c_ulonglong
let arg = match cmd {
F_DUPFD | F_SETFD | F_SETFL | F_SETLK | F_SETLKW | F_GETLK | F_DUPFD_CLOEXEC => unsafe {
__valist.arg::<c_ulonglong>()
},
F_DUPFD | F_SETFD | F_SETFL | F_GETLK | F_SETLK | F_SETLKW | F_OFD_GETLK | F_OFD_SETLK
| F_OFD_SETLKW | F_DUPFD_CLOEXEC => unsafe { __valist.arg::<c_ulonglong>() },
_ => 0,
};