Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/arch define LINUX_O_CLOEXEC.



details:   https://anonhg.NetBSD.org/src/rev/ee96d0a5129a
branches:  trunk
changeset: 758338:ee96d0a5129a
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Nov 02 18:01:25 2010 +0000

description:
define LINUX_O_CLOEXEC.
sort definitions by value.
consistently use hex instead of octal for the values.

diffstat:

 sys/compat/linux/arch/alpha/linux_fcntl.h   |  24 ++++++++----------
 sys/compat/linux/arch/amd64/linux_fcntl.h   |  36 ++++++++++++++++++----------
 sys/compat/linux/arch/arm/linux_fcntl.h     |  22 +++++++++--------
 sys/compat/linux/arch/i386/linux_fcntl.h    |  21 +++++++++-------
 sys/compat/linux/arch/m68k/linux_fcntl.h    |  26 +++++++++++---------
 sys/compat/linux/arch/mips/linux_fcntl.h    |  32 +++++++++----------------
 sys/compat/linux/arch/powerpc/linux_fcntl.h |  32 ++++++++++---------------
 7 files changed, 97 insertions(+), 96 deletions(-)

diffs (truncated from 325 to 300 lines):

diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/alpha/linux_fcntl.h
--- a/sys/compat/linux/arch/alpha/linux_fcntl.h Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/alpha/linux_fcntl.h Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fcntl.h,v 1.3 2010/09/21 19:26:19 chs Exp $      */
+/*     $NetBSD: linux_fcntl.h,v 1.4 2010/11/02 18:01:25 chs Exp $      */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -39,19 +39,17 @@
 /* read/write mode for open(2) defined in common/linux_fcntl.h */
 
 /* flags used in open(2) */
-#define LINUX_O_CREAT          0x0200
-#define LINUX_O_TRUNC          0x0400
-#define LINUX_O_EXCL           0x0800
-
-#define LINUX_O_NOCTTY         0x8000
-
-#define LINUX_O_NONBLOCK       0x0004
-#define LINUX_O_APPEND         0x0008
+#define LINUX_O_NONBLOCK       0x000004
+#define LINUX_O_APPEND         0x000008
+#define LINUX_O_CREAT          0x000200
+#define LINUX_O_TRUNC          0x000400
+#define LINUX_O_EXCL           0x000800
 #define LINUX_O_NDELAY         LINUX_O_NONBLOCK
-#define LINUX_O_SYNC           0x4000
-#define LINUX_O_DIRECTORY      0x8000
-
-#define LINUX_FASYNC           0x2000
+#define LINUX_FASYNC           0x002000
+#define LINUX_O_SYNC           0x004000
+#define LINUX_O_NOCTTY         0x008000
+#define LINUX_O_DIRECTORY      0x040000
+#define LINUX_O_CLOEXEC                0x200000
 
 /* fcntl(2) operations */
 #define LINUX_F_DUPFD          0
diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/amd64/linux_fcntl.h
--- a/sys/compat/linux/arch/amd64/linux_fcntl.h Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/amd64/linux_fcntl.h Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fcntl.h,v 1.3 2010/09/21 19:26:19 chs Exp $ */
+/*     $NetBSD: linux_fcntl.h,v 1.4 2010/11/02 18:01:25 chs Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved.
@@ -31,23 +31,29 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ * Various flag values used in Linux for open(2) and fcntl(2).
+ */
+
 #ifndef _AMD64_LINUX_FCNTL_H
 #define _AMD64_LINUX_FCNTL_H
 
-#define LINUX_O_CREAT          0100
-#define LINUX_O_EXCL           0200
-#define LINUX_O_NOCTTY         0400
-#define LINUX_O_TRUNC          01000
-#define LINUX_O_APPEND         02000
-#define LINUX_O_NDELAY         04000
-#define LINUX_O_SYNC           010000
-#define LINUX_FASYNC           020000
+/* read/write mode for open(2) defined in common/linux_fcntl.h */
+
+/* flags used in open(2) */
+#define LINUX_O_CREAT          0x00040
+#define LINUX_O_EXCL           0x00080
+#define LINUX_O_NOCTTY         0x00100
+#define LINUX_O_TRUNC          0x00200
+#define LINUX_O_APPEND         0x00400
+#define LINUX_O_NONBLOCK       0x00800
+#define LINUX_O_NDELAY         LINUX_O_NONBLOCK
+#define LINUX_O_SYNC           0x01000
+#define LINUX_FASYNC           0x02000
 #define LINUX_O_DIRECTORY      0x10000
+#define LINUX_O_CLOEXEC                0x80000
 
-#define LINUX_F_RDLCK          0
-#define LINUX_F_WRLCK          1       
-#define LINUX_F_UNLCK          2
-
+/* fcntl(2) operations */
 #define LINUX_F_DUPFD          0
 #define LINUX_F_GETFD          1
 #define LINUX_F_SETFD          2
@@ -62,4 +68,8 @@
 #define LINUX_F_SETLK64                13
 #define LINUX_F_SETLKW64       14
 
+#define LINUX_F_RDLCK          0
+#define LINUX_F_WRLCK          1       
+#define LINUX_F_UNLCK          2
+
 #endif /* !_AMD64_LINUX_FCNTL_H */
diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/arm/linux_fcntl.h
--- a/sys/compat/linux/arch/arm/linux_fcntl.h   Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/arm/linux_fcntl.h   Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fcntl.h,v 1.3 2010/09/21 19:26:19 chs Exp $      */
+/*     $NetBSD: linux_fcntl.h,v 1.4 2010/11/02 18:01:25 chs Exp $      */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -39,15 +39,17 @@
 /* read/write mode for open(2) defined in common/linux_fcntl.h */
 
 /* flags used in open(2) */
-#define LINUX_O_CREAT          0x0040
-#define LINUX_O_EXCL           0x0080
-#define LINUX_O_NOCTTY         0x0100
-#define LINUX_O_TRUNC          0x0200
-#define LINUX_O_APPEND         0x0400
-#define LINUX_O_NDELAY         0x0800
-#define LINUX_O_SYNC           0x1000
-#define LINUX_FASYNC           0x2000
-#define LINUX_O_DIRECTORY      0x4000
+#define LINUX_O_CREAT          0x00040
+#define LINUX_O_EXCL           0x00080
+#define LINUX_O_NOCTTY         0x00100
+#define LINUX_O_TRUNC          0x00200
+#define LINUX_O_APPEND         0x00400
+#define LINUX_O_NONBLOCK       0x00800
+#define LINUX_O_NDELAY         LINUX_O_NONBLOCK
+#define LINUX_O_SYNC           0x01000
+#define LINUX_FASYNC           0x02000
+#define LINUX_O_DIRECTORY      0x04000
+#define LINUX_O_CLOEXEC                0x80000
 
 /* fcntl(2) operations */
 #define LINUX_F_DUPFD          0
diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/i386/linux_fcntl.h
--- a/sys/compat/linux/arch/i386/linux_fcntl.h  Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/i386/linux_fcntl.h  Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fcntl.h,v 1.6 2010/09/21 19:26:19 chs Exp $      */
+/*     $NetBSD: linux_fcntl.h,v 1.7 2010/11/02 18:01:26 chs Exp $      */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -39,15 +39,17 @@
 /* read/write mode for open(2) defined in common/linux_fcntl.h */
 
 /* flags used in open(2) */
-#define LINUX_O_CREAT          0x0040
-#define LINUX_O_EXCL           0x0080
-#define LINUX_O_NOCTTY         0x0100
-#define LINUX_O_TRUNC          0x0200
-#define LINUX_O_APPEND         0x0400
-#define LINUX_O_NDELAY         0x0800
-#define LINUX_O_SYNC           0x1000
-#define LINUX_FASYNC           0x2000
+#define LINUX_O_CREAT          0x00040
+#define LINUX_O_EXCL           0x00080
+#define LINUX_O_NOCTTY         0x00100
+#define LINUX_O_TRUNC          0x00200
+#define LINUX_O_APPEND         0x00400
+#define LINUX_O_NONBLOCK       0x00800
+#define LINUX_O_NDELAY         LINUX_O_NONBLOCK
+#define LINUX_O_SYNC           0x01000
+#define LINUX_FASYNC           0x02000
 #define LINUX_O_DIRECTORY      0x10000
+#define LINUX_O_CLOEXEC                0x80000
 
 /* fcntl(2) operations */
 #define LINUX_F_DUPFD          0
@@ -71,4 +73,5 @@
 #define LINUX_F_GETLK64                12
 #define LINUX_F_SETLK64                13
 #define LINUX_F_SETLKW64       14
+
 #endif /* !_I386_LINUX_FCNTL_H */
diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/m68k/linux_fcntl.h
--- a/sys/compat/linux/arch/m68k/linux_fcntl.h  Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/m68k/linux_fcntl.h  Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux_fcntl.h,v 1.3 2008/04/28 20:23:42 martin Exp $   */
+/*     $NetBSD: linux_fcntl.h,v 1.4 2010/11/02 18:01:26 chs Exp $      */
 
 /*-
  * Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -39,17 +39,18 @@
 /* read/write mode for open(2) defined in common/linux_fcntl.h */
 
 /* flags used in open(2) */
-#define LINUX_O_CREAT          0x0040
-#define LINUX_O_EXCL           0x0080
-#define LINUX_O_NOCTTY         0x0100
-#define LINUX_O_TRUNC          0x0200
-#define LINUX_O_APPEND         0x0400
-#define LINUX_O_NDELAY         0x0800
-#define LINUX_O_SYNC           0x1000
-#define LINUX_O_DIRECTORY      0x4000
-#define LINUX_O_NOFOLLOW       0x8000
-
-#define LINUX_FASYNC           0x2000
+#define LINUX_O_CREAT          0x00040
+#define LINUX_O_EXCL           0x00080
+#define LINUX_O_NOCTTY         0x00100
+#define LINUX_O_TRUNC          0x00200
+#define LINUX_O_APPEND         0x00400
+#define LINUX_O_NONBLOCK       0x00800
+#define LINUX_O_NDELAY         LINUX_O_NONBLOCK
+#define LINUX_O_SYNC           0x01000
+#define LINUX_FASYNC           0x02000
+#define LINUX_O_DIRECTORY      0x04000
+#define LINUX_O_NOFOLLOW       0x08000
+#define LINUX_O_CLOEXEC                0x80000
 
 /* fcntl(2) operations */
 #define LINUX_F_DUPFD          0
@@ -79,4 +80,5 @@
 #define LINUX_F_GETLK64                12
 #define LINUX_F_SETLK64                13
 #define LINUX_F_SETLKW64       14
+
 #endif /* !_M68K_LINUX_FCNTL_H */
diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/mips/linux_fcntl.h
--- a/sys/compat/linux/arch/mips/linux_fcntl.h  Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/mips/linux_fcntl.h  Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.6 2010/09/21 19:26:20 chs Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.7 2010/11/02 18:01:26 chs Exp $ */
 
 /*-
  * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
@@ -40,25 +40,20 @@
  * read/write mode for open(2) are defined in common/linux_fcntl.h
  */
 
-/*
- * flags used in open(2)
- * From Linux's include/asm-mips/fcntl.h
- */
-#define LINUX_O_CREAT          0x0100
-#define LINUX_O_EXCL           0x0400
-#define LINUX_O_NOCTTY         0x0800
-#define LINUX_O_TRUNC          0x0200
-#define LINUX_O_APPEND         0x0008
-#define LINUX_O_NONBLOCK       0x0080
+/* flags used in open(2) */
+#define LINUX_O_APPEND         0x00008
+#define LINUX_O_SYNC           0x00010
+#define LINUX_O_NONBLOCK       0x00080
 #define LINUX_O_NDELAY         LINUX_O_NONBLOCK
-#define LINUX_O_SYNC           0x0010
-#define LINUX_FASYNC           0x1000
+#define LINUX_O_CREAT          0x00100
+#define LINUX_O_TRUNC          0x00200
+#define LINUX_O_EXCL           0x00400
+#define LINUX_O_NOCTTY         0x00800
+#define LINUX_FASYNC           0x01000
 #define LINUX_O_DIRECTORY      0x10000
+#define LINUX_O_CLOEXEC                0x80000
 
-/*
- * fcntl(2) operations
- * From Linux's include/asm-mips/fcntl.h
- */
+/* fcntl(2) operations */
 #define LINUX_F_DUPFD          0
 #define LINUX_F_GETFD          1
 #define LINUX_F_SETFD          2
@@ -77,9 +72,6 @@
 #define LINUX_LOCK_EX          4  /* F_EXLCK in Linux, and comment "or 3 " */
 #define LINUX_LOCK_SH          8  /* F_SHLCK in Linux, and comment "or 4'  */
 
-/*
- * From Linux's include/asm-mips64/fcntl.h
- */
 #define LINUX_F_GETLK64                33
 #define LINUX_F_SETLK64                34
 #define LINUX_F_SETLKW64       35
diff -r 23cdab8c5a2e -r ee96d0a5129a sys/compat/linux/arch/powerpc/linux_fcntl.h
--- a/sys/compat/linux/arch/powerpc/linux_fcntl.h       Tue Nov 02 16:56:47 2010 +0000
+++ b/sys/compat/linux/arch/powerpc/linux_fcntl.h       Tue Nov 02 18:01:25 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_fcntl.h,v 1.8 2010/09/21 19:26:20 chs Exp $ */
+/* $NetBSD: linux_fcntl.h,v 1.9 2010/11/02 18:01:26 chs Exp $ */
 
 /*-
  * Copyright (c) 1995, 1998, 2001 The NetBSD Foundation, Inc.
@@ -40,26 +40,20 @@
  * read/write mode for open(2) are defined in common/linux_fcntl.h
  */
 
-/*
- * flags used in open(2)
- * From Linux's include/asm-ppc/fcntl.h
- * Theses are octal values (remember 0100 != 100 in C)
- */
-#define LINUX_O_CREAT          0100
-#define LINUX_O_EXCL           0200
-#define LINUX_O_NOCTTY         0400
-#define LINUX_O_TRUNC          01000
-#define LINUX_O_APPEND         02000



Home | Main Index | Thread Index | Old Index