This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH] Add FLOCK(2) definitions and declaration
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Cc: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- Date: Fri, 17 Jan 2014 10:41:01 +0100
- Subject: [PATCH] Add FLOCK(2) definitions and declaration
- Authentication-results: sourceware.org; auth=none
http://www.freebsd.org/cgi/man.cgi?query=flock
newlib/ChangeLog
2014-01-17 Sebastian Huber <sebastian.huber@embedded-brains.de>
* libc/include/sys/_default_fcntl.h (LOCK_SH): Define.
(LOCK_EX): Likewise.
(LOCK_NB): Likewise.
(LOCK_UN): Likewise.
(flock): Declare.
---
newlib/libc/include/sys/_default_fcntl.h | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h
index 40d8fae..4feaf5e 100644
--- a/newlib/libc/include/sys/_default_fcntl.h
+++ b/newlib/libc/include/sys/_default_fcntl.h
@@ -176,6 +176,13 @@ struct eflock {
};
#endif /* !_POSIX_SOURCE */
+#if __BSD_VISIBLE
+/* lock operations for flock(2) */
+#define LOCK_SH 0x01 /* shared file lock */
+#define LOCK_EX 0x02 /* exclusive file lock */
+#define LOCK_NB 0x04 /* don't block when locking */
+#define LOCK_UN 0x08 /* unlock file */
+#endif
#include <sys/types.h>
#include <sys/stat.h> /* sigh. for the mode bits for open/creat */
@@ -201,6 +208,10 @@ extern int _open64 _PARAMS ((const char *, int, ...));
#endif
#endif
+#if __BSD_VISIBLE
+extern int flock _PARAMS ((int, int));
+#endif
+
#ifdef __cplusplus
}
#endif
--
1.7.7