From 20897d737110ad2a3911c65578e58cead2b8ba25 Mon Sep 17 00:00:00 2001 From: Martin Pärtel Date: Wed, 23 Sep 2020 22:35:41 +0300 Subject: Added copy-pasta for flock() required by MacOS / XCode 12. Fixes #88 --- ChangeLog | 1 + src/bindfs.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7a90288..78fe040 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2020-09-23 Martin Pärtel * Added missing include for "sys/file.h". + * Added flock copy-pasta needed by XCode 12 (issue #88). 2020-05-13 Martin Pärtel * Fixed missing newlines bug with --map-passwd and --map-group diff --git a/src/bindfs.c b/src/bindfs.c index 5f82af3..8e561f8 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -106,6 +106,13 @@ #define A_PREFIX "com" #define A_KAUTH_FILESEC_XATTR A_PREFIX ".apple.system.Security" #define XATTR_APPLE_PREFIX "com.apple." + +// Yes, Apple asks us to copy/paste these -.- +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* don't block when locking */ +#define LOCK_UN 8 /* unlock */ +int flock(int fd, int operation); #endif /* We pessimistically assume signed uid_t and gid_t in our overflow checks, -- cgit v1.2.3