]> rtime.felk.cvut.cz Git - l4.git/blobdiff - l4/pkg/linux-26-headers/include/asm-generic/fcntl.h
update
[l4.git] / l4 / pkg / linux-26-headers / include / asm-generic / fcntl.h
index b8477414c5c85858de58d6489673da501f93d7bf..a48937d4a5ea5715fafe813baf4f586a0b747355 100644 (file)
@@ -3,8 +3,18 @@
 
 #include <linux/types.h>
 
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
-   located on an ext2 file system */
+/*
+ * FMODE_EXEC is 0x20
+ * FMODE_NONOTIFY is 0x1000000
+ * These cannot be used by userspace O_* until internal and external open
+ * flags are split.
+ * -Eric Paris
+ */
+
+/*
+ * When introducing new O_* bits, please check its uniqueness in fcntl_init().
+ */
+
 #define O_ACCMODE      00000003
 #define O_RDONLY       00000000
 #define O_WRONLY       00000001
@@ -27,8 +37,8 @@
 #ifndef O_NONBLOCK
 #define O_NONBLOCK     00004000
 #endif
-#ifndef O_SYNC
-#define O_SYNC         00010000
+#ifndef O_DSYNC
+#define O_DSYNC                00010000        /* used to be O_SYNC, see below */
 #endif
 #ifndef FASYNC
 #define FASYNC         00020000        /* fcntl, for BSD compatibility */
 #ifndef O_CLOEXEC
 #define O_CLOEXEC      02000000        /* set close_on_exec */
 #endif
+
+/*
+ * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using
+ * the O_SYNC flag.  We continue to use the existing numerical value
+ * for O_DSYNC semantics now, but using the correct symbolic name for it.
+ * This new value is used to request true Posix O_SYNC semantics.  It is
+ * defined in this strange way to make sure applications compiled against
+ * new headers get at least O_DSYNC semantics on older kernels.
+ *
+ * This has the nice side-effect that we can simply test for O_DSYNC
+ * wherever we do not care if O_DSYNC or O_SYNC is used.
+ *
+ * Note: __O_SYNC must never be used directly.
+ */
+#ifndef O_SYNC
+#define __O_SYNC       04000000
+#define O_SYNC         (__O_SYNC|O_DSYNC)
+#endif
+
+#ifndef O_PATH
+#define O_PATH         010000000
+#endif
+
 #ifndef O_NDELAY
 #define O_NDELAY       O_NONBLOCK
 #endif
 #define F_GETSIG       11      /* for sockets. */
 #endif
 
+#ifndef CONFIG_64BIT
+#ifndef F_GETLK64
+#define F_GETLK64      12      /*  using 'struct flock64' */
+#define F_SETLK64      13
+#define F_SETLKW64     14
+#endif
+#endif
+
+#ifndef F_SETOWN_EX
+#define F_SETOWN_EX    15
+#define F_GETOWN_EX    16
+#endif
+
+#ifndef F_GETOWNER_UIDS
+#define F_GETOWNER_UIDS        17
+#endif
+
+#define F_OWNER_TID    0
+#define F_OWNER_PID    1
+#define F_OWNER_PGRP   2
+
+struct f_owner_ex {
+       int     type;
+       __kernel_pid_t  pid;
+};
+
 /* for F_[GET|SET]FL */
 #define FD_CLOEXEC     1       /* actually anything with low bit set goes */
 
 #define F_SHLCK                8       /* or 4 */
 #endif
 
-/* for leases */
-#ifndef F_INPROGRESS
-#define F_INPROGRESS   16
-#endif
-
 /* operations for bsd flock(), also used by the kernel implementation */
 #define LOCK_SH                1       /* shared lock */
 #define LOCK_EX                2       /* exclusive lock */
 struct flock {
        short   l_type;
        short   l_whence;
-       off_t   l_start;
-       off_t   l_len;
-       pid_t   l_pid;
+       __kernel_off_t  l_start;
+       __kernel_off_t  l_len;
+       __kernel_pid_t  l_pid;
        __ARCH_FLOCK_PAD
 };
 #endif
 
 #ifndef CONFIG_64BIT
 
-#ifndef F_GETLK64
-#define F_GETLK64      12      /*  using 'struct flock64' */
-#define F_SETLK64      13
-#define F_SETLKW64     14
-#endif
-
 #ifndef HAVE_ARCH_STRUCT_FLOCK64
 #ifndef __ARCH_FLOCK64_PAD
 #define __ARCH_FLOCK64_PAD
@@ -140,9 +188,9 @@ struct flock {
 struct flock64 {
        short  l_type;
        short  l_whence;
-       loff_t l_start;
-       loff_t l_len;
-       pid_t  l_pid;
+       __kernel_loff_t l_start;
+       __kernel_loff_t l_len;
+       __kernel_pid_t  l_pid;
        __ARCH_FLOCK64_PAD
 };
 #endif