Skip to content

Commit 4a1bae2

Browse files
committed
Auto merge of #1087 - kalamay:bsd-fcntl-locks, r=alexcrichton
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.
2 parents 2926a5b + ea3b319 commit 4a1bae2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/unix/bsd/mod.rs

Lines changed: 4 additions & 0 deletions
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)