summaryrefslogtreecommitdiff
path: root/uts/debian/patches/flock.patch
blob: e683d2d89ea5b718e72b7928273818195789054f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Description: Add missing flock() function. Implemented
 in libc in terms of fcntl(2)
Index: b/usr/src/uts/common/sys/file.h
===================================================================
--- a/usr/src/uts/common/sys/file.h	2014-03-01 22:51:56.874581723 +0400
+++ b/usr/src/uts/common/sys/file.h	2014-03-01 22:55:58.000215635 +0400
@@ -117,6 +117,24 @@
 
 #define	FCLOEXEC	0x800000	/* O_CLOEXEC = 0x800000 */
 
+#if !defined(_KERNEL) && !defined(_BOOT)
+
+/* For compatibility with glibc: */
+#ifndef _FCNTL_H
+# include <fcntl.h>
+#endif
+
+/* From usr/src/lib/libbc/inc/include/sys/file.h */
+/*
+ * Flock call.
+ */
+#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 */
+extern int flock(int, int);
+#endif
+
 #ifdef _KERNEL
 
 /*