summaryrefslogtreecommitdiff
path: root/src/port/lockf.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/port/lockf.h')
-rw-r--r--src/port/lockf.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/port/lockf.h b/src/port/lockf.h
new file mode 100644
index 0000000..5ec99b3
--- /dev/null
+++ b/src/port/lockf.h
@@ -0,0 +1,20 @@
+#ifndef __LOCKF_H
+#define __LOCKF_H
+
+#include "sys.h"
+
+#if !defined HAVE_LOCKF
+
+/* Drop-in replacement for the simplified lockf interface (POSIX) */
+#include <fcntl.h> /* for fcntl and locking flags */
+
+#define F_ULOCK 0 /* Unlock a previously locked region */
+#define F_LOCK 1 /* Lock exclusively */
+#define F_TLOCK 2 /* Test and lock exclusively */
+#define F_TEST 3 /* Test for a locked region */
+
+extern int lockf( int fd, int cmd, off_t len );
+
+#endif /* !defined HAVE_LOCKF */
+
+#endif /* ifndef __LOCKF_H */