aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2020-09-23 22:35:41 +0300
committerMartin Pärtel <martin.partel@gmail.com>2020-09-23 22:35:57 +0300
commit20897d737110ad2a3911c65578e58cead2b8ba25 (patch)
treec4efe1c29540267c3a069154c34235231c61efc5
parent9466e22a8be617c0c4556d99f0574b39b253e184 (diff)
downloadbindfs-20897d737110ad2a3911c65578e58cead2b8ba25.tar.gz
Added copy-pasta for flock() required by MacOS / XCode 12.
Fixes #88
-rw-r--r--ChangeLog1
-rw-r--r--src/bindfs.c7
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a90288..78fe040 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
2020-09-23 Martin Pärtel <martin dot partel at gmail dot com>
* Added missing include for "sys/file.h".
+ * Added flock copy-pasta needed by XCode 12 (issue #88).
2020-05-13 Martin Pärtel <martin dot partel at gmail dot com>
* 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,