Skip to content

Commit e663286

Browse files
committed
Add fcntl OFD commands for macOS
1 parent bea1bcb commit e663286

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

libc-test/semver/apple.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ COPYFILE_STATE_SRC_FD
256256
COPYFILE_STATE_SRC_FILENAME
257257
COPYFILE_STATE_STATUS_CB
258258
COPYFILE_STATE_STATUS_CTX
259-
COPYFILE_STATE_XATTRNAME
260259
COPYFILE_STATE_WAS_CLONED
261-
COPYFILE_VERBOSE
260+
COPYFILE_STATE_XATTRNAME
262261
COPYFILE_UNLINK
262+
COPYFILE_VERBOSE
263263
COPYFILE_XATTR
264264
CR0
265265
CR1
@@ -440,6 +440,9 @@ F_LOG2PHYS
440440
F_LOG2PHYS_EXT
441441
F_NOCACHE
442442
F_NODIRECT
443+
F_OFD_GETLK
444+
F_OFD_SETLK
445+
F_OFD_SETLKW
443446
F_PEOFPOSMODE
444447
F_PREALLOCATE
445448
F_PUNCHHOLE
@@ -2074,19 +2077,19 @@ posix_spawn_file_actions_t
20742077
posix_spawnattr_destroy
20752078
posix_spawnattr_get_qos_class_np
20762079
posix_spawnattr_getarchpref_np
2080+
posix_spawnattr_getbinpref_np
20772081
posix_spawnattr_getflags
20782082
posix_spawnattr_getpgroup
20792083
posix_spawnattr_getsigdefault
20802084
posix_spawnattr_getsigmask
20812085
posix_spawnattr_init
20822086
posix_spawnattr_set_qos_class_np
20832087
posix_spawnattr_setarchpref_np
2088+
posix_spawnattr_setbinpref_np
20842089
posix_spawnattr_setflags
20852090
posix_spawnattr_setpgroup
20862091
posix_spawnattr_setsigdefault
20872092
posix_spawnattr_setsigmask
2088-
posix_spawnattr_getbinpref_np
2089-
posix_spawnattr_setbinpref_np
20902093
posix_spawnattr_t
20912094
posix_spawnp
20922095
preadv

src/unix/bsd/apple/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3556,6 +3556,10 @@ pub const F_GLOBAL_NOCACHE: ::c_int = 55;
35563556
pub const F_NODIRECT: ::c_int = 62;
35573557
pub const F_LOG2PHYS_EXT: ::c_int = 65;
35583558
pub const F_BARRIERFSYNC: ::c_int = 85;
3559+
// See https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h
3560+
pub const F_OFD_SETLK: ::c_int = 90; /* Acquire or release open file description lock */
3561+
pub const F_OFD_SETLKW: ::c_int = 91; /* (as F_OFD_SETLK but blocking if conflicting lock) */
3562+
pub const F_OFD_GETLK: ::c_int = 92; /* Examine OFD lock */
35593563
pub const F_PUNCHHOLE: ::c_int = 99;
35603564
pub const F_TRIM_ACTIVE_FILE: ::c_int = 100;
35613565
pub const F_SPECULATIVE_READ: ::c_int = 101;

0 commit comments

Comments
 (0)