Skip to content

Commit b016569

Browse files
committed
Add fcntl OFD commands for macOS
Obey shellcheck ci/style.sh should be executable Require macos-14
1 parent cb61441 commit b016569

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

ci/style.sh

100644100755
File mode 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
@@ -441,6 +441,9 @@ F_LOG2PHYS
441441
F_LOG2PHYS_EXT
442442
F_NOCACHE
443443
F_NODIRECT
444+
F_OFD_GETLK
445+
F_OFD_SETLK
446+
F_OFD_SETLKW
444447
F_PEOFPOSMODE
445448
F_PREALLOCATE
446449
F_PUNCHHOLE
@@ -1976,19 +1979,19 @@ posix_spawn_file_actions_t
19761979
posix_spawnattr_destroy
19771980
posix_spawnattr_get_qos_class_np
19781981
posix_spawnattr_getarchpref_np
1982+
posix_spawnattr_getbinpref_np
19791983
posix_spawnattr_getflags
19801984
posix_spawnattr_getpgroup
19811985
posix_spawnattr_getsigdefault
19821986
posix_spawnattr_getsigmask
19831987
posix_spawnattr_init
19841988
posix_spawnattr_set_qos_class_np
19851989
posix_spawnattr_setarchpref_np
1990+
posix_spawnattr_setbinpref_np
19861991
posix_spawnattr_setflags
19871992
posix_spawnattr_setpgroup
19881993
posix_spawnattr_setsigdefault
19891994
posix_spawnattr_setsigmask
1990-
posix_spawnattr_getbinpref_np
1991-
posix_spawnattr_setbinpref_np
19921995
posix_spawnattr_t
19931996
posix_spawnp
19941997
preadv

src/unix/bsd/apple/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3592,6 +3592,10 @@ pub const F_GLOBAL_NOCACHE: ::c_int = 55;
35923592
pub const F_NODIRECT: ::c_int = 62;
35933593
pub const F_LOG2PHYS_EXT: ::c_int = 65;
35943594
pub const F_BARRIERFSYNC: ::c_int = 85;
3595+
// See https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h
3596+
pub const F_OFD_SETLK: ::c_int = 90; /* Acquire or release open file description lock */
3597+
pub const F_OFD_SETLKW: ::c_int = 91; /* (as F_OFD_SETLK but blocking if conflicting lock) */
3598+
pub const F_OFD_GETLK: ::c_int = 92; /* Examine OFD lock */
35953599
pub const F_PUNCHHOLE: ::c_int = 99;
35963600
pub const F_TRIM_ACTIVE_FILE: ::c_int = 100;
35973601
pub const F_SPECULATIVE_READ: ::c_int = 101;

0 commit comments

Comments
 (0)