Browse Source

fcntl flock stubs to support Python fcntl module

K. Lange 2 years ago
parent
commit
ffe0aa2448
1 changed files with 18 additions and 0 deletions
  1. 18 0
      base/usr/include/fcntl.h

+ 18 - 0
base/usr/include/fcntl.h

@@ -24,6 +24,24 @@
 #define F_GETFL 3
 #define F_SETFL 4
 
+/* Advisory locks are not currently supported;
+ * these definitions are stubs. */
+#define F_GETLK  5
+#define F_SETLK  6
+#define F_SETLKW 7
+
+#define F_RDLCK  0
+#define F_WRLCK  1
+#define F_UNLCK  2
+
+struct flock {
+	short l_type;
+	short l_whence;
+	off_t l_start;
+	off_t l_len;
+	pid_t l_pid;
+};
+
 #define FD_CLOEXEC (1 << 0)
 
 extern int open (const char *, int, ...);