Skip to content

Commit 4928bd9

Browse files
committed
Add fcntl constants for advisory locking on BSDs
For range-based locking POSIX fcntl locks are needed. This adds the constants F_RDLCK, F_UNLCK, and F_WRLCK for FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, and macOS/iOS. Fortunately these values are defined the same across these platforms.
1 parent 2926a5b commit 4928bd9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: src/unix/bsd/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,10 @@ pub const O_NDELAY: ::c_int = O_NONBLOCK;
215215
pub const F_GETOWN: ::c_int = 5;
216216
pub const F_SETOWN: ::c_int = 6;
217217

218+
pub const F_RDLCK: ::c_short = 1
219+
pub const F_UNLCK: ::c_short = 2
220+
pub const F_WRLCK: ::c_short = 3
221+
218222
pub const MNT_FORCE: ::c_int = 0x80000;
219223

220224
pub const Q_SYNC: ::c_int = 0x600;

0 commit comments

Comments
 (0)