add syscall wrapper for flock
authorRich Felker <dalias@aerifal.cx>
Wed, 13 Apr 2011 18:55:26 +0000 (14:55 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 13 Apr 2011 18:55:26 +0000 (14:55 -0400)
it should be noted that flock does not mix well with standard fcntl
locking, but nonetheless some applications will attempt to use flock
instead of fcntl if both exist. options to configure or small patches
may be needed. debian maintainers have plenty of experience with this
unfortunate situation...

src/linux/flock.c [new file with mode: 0644]

diff --git a/src/linux/flock.c b/src/linux/flock.c
new file mode 100644 (file)
index 0000000..87aa5cf
--- /dev/null
@@ -0,0 +1,7 @@
+#include <sys/file.h>
+#include "syscall.h"
+
+int flock(int fd, int op)
+{
+       return syscall(SYS_flock, fd, op);
+}