summaryrefslogtreecommitdiffstats
path: root/sys/sys/fcntl.h
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>2000-04-22 15:22:31 +0000
committerwollman <wollman@FreeBSD.org>2000-04-22 15:22:31 +0000
commit16604ab260bd5c8c562cf5d28e190a84abd6ce84 (patch)
tree87dc595b565cb212c33ff9db0bf23c457e1c1b03 /sys/sys/fcntl.h
parent0a69363705f7f23b90ad08f0508d249d76df3da0 (diff)
downloadFreeBSD-src-16604ab260bd5c8c562cf5d28e190a84abd6ce84.zip
FreeBSD-src-16604ab260bd5c8c562cf5d28e190a84abd6ce84.tar.gz
Implement POSIX.1b shared memory objects. In this implementation,
shared memory objects are regular files; the shm_open(3) routine uses fcntl(2) to set a flag on the descriptor which tells mmap(2) to automatically apply MAP_NOSYNC. Not objected to by: bde, dillon, dufault, jasone
Diffstat (limited to 'sys/sys/fcntl.h')
-rw-r--r--sys/sys/fcntl.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h
index d5b29e6..6bbf156 100644
--- a/sys/sys/fcntl.h
+++ b/sys/sys/fcntl.h
@@ -106,12 +106,12 @@
/* bits to save after open */
#define FMASK (FREAD|FWRITE|FAPPEND|FASYNC|FFSYNC|FNONBLOCK)
/* bits settable by fcntl(F_SETFL, ...) */
-#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK)
+#define FCNTLFLAGS (FAPPEND|FASYNC|FFSYNC|FNONBLOCK|FPOSIXSHM)
#endif
/*
* The O_* flags used to have only F* names, which were used in the kernel
- * and by fcntl. We retain the F* names for the kernel f_flags field
+ * and by fcntl. We retain the F* names for the kernel f_flag field
* and for backward compatibility for fcntl.
*/
#ifndef _POSIX_SOURCE
@@ -124,6 +124,22 @@
#endif
/*
+ * We are out of bits in f_flag (which is a short). However,
+ * the flag bits not set in FMASK are only meaningful in the
+ * initial open syscall. Those bits can thus be given a
+ * different meaning for fcntl(2).
+ */
+#ifndef _POSIX_SOURCE
+
+/*
+ * Set by shm_open(3) to get automatic MAP_ASYNC behavior
+ * for POSIX shared memory objects (which are otherwise
+ * implemented as plain files).
+ */
+#define FPOSIXSHM O_NOFOLLOW
+#endif
+
+/*
* Constants used for fcntl(2)
*/
OpenPOWER on IntegriCloud