]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Re-install F_[GS]ETOWN_EX changes
authorAndreas Schwab <schwab@redhat.com>
Tue, 24 Nov 2009 15:24:07 +0000 (16:24 +0100)
committerAndreas Schwab <schwab@redhat.com>
Wed, 25 Nov 2009 13:11:00 +0000 (14:11 +0100)
ChangeLog
sysdeps/unix/sysv/linux/fcntl.c
sysdeps/unix/sysv/linux/i386/bits/fcntl.h
sysdeps/unix/sysv/linux/i386/fcntl.c
sysdeps/unix/sysv/linux/ia64/bits/fcntl.h
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h
sysdeps/unix/sysv/linux/s390/bits/fcntl.h
sysdeps/unix/sysv/linux/sh/bits/fcntl.h
sysdeps/unix/sysv/linux/sparc/bits/fcntl.h
sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h

index 19a8e2fd4832f9fdc0e92f00a2c9855e87e3da8c..aaa01cb9371ab20b067293ad3a8f59e434728312 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -233,6 +233,22 @@ d2009-10-30  Ulrich Drepper  <drepper@redhat.com>
        * sysdeps/generic/netinet/ip.h: Define IPTOS_ENC* and IPTOS_DSCP*
        macros.  Patch by Philip Prindeville <philipp@redfish-solutions.com>.
 
+       [BZ #10840]
+       * sysdeps/unix/sysv/linux/kernel-features.h: Define
+       __ASSUME_F_GETOWN_EX.
+       * sysdeps/unix/sysv/linux/fcntl.c: Implement F_GETOWN using F_GETOWN_EX
+       if possible.
+       * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise.
+
+       * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_OWNER_*
+       and f_owner_ex.
+       * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+
        [BZ #10847]
        * sysdeps/gnu/getutmp.c: Allow compatibility code to play around with
        getutmpx symbol.
@@ -320,6 +336,17 @@ d2009-10-30  Ulrich Drepper  <drepper@redhat.com>
        * locale/C-time.c: Revert week-1stday back to 19971130 and set
        first_weekday to 1 and first_workday to 2.
 
+2009-10-01  Ulrich Drepper  <drepper@redhat.com>
+
+       * sysdeps/unix/sysv/linux/sh/bits/fcntl.h: Define F_SETOWN_EX and
+       F_GETOWN_EX.
+       * sysdeps/unix/sysv/linux/powerpc/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/i386/bits/fcntl.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/bits/fcntl.h: Likewise.
+
 2009-09-28  Andreas Schwab  <schwab@redhat.com>
 
        * stdio-common/printf_fp.c: Check for and avoid integer overflows.
index 1f5aca14a478544edc650654ae459fc52cf130f9..b19654c62527466949217c611779cee4c00800ac 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #include <stdarg.h>
 
 #include <sys/syscall.h>
+#include <kernel-features.h>
+
+
+#ifdef __ASSUME_F_GETOWN_EX
+# define miss_F_GETOWN_EX 0
+#else
+static int miss_F_GETOWN_EX;
+#endif
+
+
+static int
+do_fcntl (int fd, int cmd, void *arg)
+{
+  if (cmd != F_GETOWN || miss_F_GETOWN_EX)
+    return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+
+  INTERNAL_SYSCALL_DECL (err);
+  struct f_owner_ex fex;
+  int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
+  if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+    return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+#ifndef __ASSUME_F_GETOWN_EX
+  if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+    {
+      res = INLINE_SYSCALL (fcntl, 3, fd, F_GETOWN, arg);
+      miss_F_GETOWN_EX = 1;
+      return res;
+    }
+#endif
+
+  __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+  return -1;
+}
 
 
 #ifndef NO_CANCELLATION
@@ -36,7 +70,7 @@ __fcntl_nocancel (int fd, int cmd, ...)
   arg = va_arg (ap, void *);
   va_end (ap);
 
-  return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+  return do_fcntl (fd, cmd, arg);
 }
 #endif
 
@@ -52,11 +86,11 @@ __libc_fcntl (int fd, int cmd, ...)
   va_end (ap);
 
   if (SINGLE_THREAD_P || cmd != F_SETLKW)
-    return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+    return do_fcntl (fd, cmd, arg);
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
-  int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
+  int result = do_fcntl (fd, cmd, arg);
 
   LIBC_CANCEL_RESET (oldtype);
 
index 35dfb299d2a5cc7d9484f40686302fe3e611fb0a..6a38dc03fe208fd062a1f0fe18747eb2dce721ad 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 #define F_SETLKW64     14      /* Set record locking info (blocking).  */
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN      8       /* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN      9       /* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN      8       /* Get owner (process receiving SIGIO).  */
+# define F_GETOWN      9       /* Set owner (process receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_SETOWN_EX   12      /* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX   13      /* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -166,6 +168,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
 #ifdef __USE_BSD
index b27373d24bc09e86a9839b5a359918d87bd02970..5544d6e0d9e68be4fae8494eeae9354c6c9bc083 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002,2003,2004,2006 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2002,2003,2004,2006,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 int __have_no_fcntl64;
 #endif
 
+#ifdef __ASSUME_F_GETOWN_EX
+# define miss_F_GETOWN_EX 0
+#else
+static int miss_F_GETOWN_EX;
+#endif
+
+
 #if defined NO_CANCELLATION && __ASSUME_FCNTL64 == 0
 # define __fcntl_nocancel  __libc_fcntl
 #endif
@@ -119,6 +126,26 @@ __fcntl_nocancel (int fd, int cmd, ...)
        assert (F_SETLK - F_SETLKW == F_SETLK64 - F_SETLKW64);
        return INLINE_SYSCALL (fcntl, 3, fd, cmd + F_SETLK - F_SETLK64, &fl);
       }
+    case F_GETOWN:
+      if (! miss_F_GETOWN_EX)
+       {
+         INTERNAL_SYSCALL_DECL (err);
+         struct f_owner_ex fex;
+         int res = INTERNAL_SYSCALL (fcntl, err, 3, fd, F_GETOWN_EX, &fex);
+         if (!INTERNAL_SYSCALL_ERROR_P (res, err))
+           return fex.type == F_OWNER_GID ? -fex.pid : fex.pid;
+
+#ifndef __ASSUME_F_GETOWN_EX
+         if (INTERNAL_SYSCALL_ERRNO (res, err) == EINVAL)
+           miss_F_GETOWN_EX = 1;
+         else
+#endif
+           {
+             __set_errno (INTERNAL_SYSCALL_ERRNO (res, err));
+             return -1;
+           }
+       }
+      /* FALLTHROUGH */
     default:
       return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
     }
index 92b96bd14ca5ff2d84544da4ea6a90199743ff6d..9a0245a6c4cd663a716a7e4d6f9a65daa65b2813 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/IA64.
-   Copyright (C) 1999, 2000, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 1999,2000,2004,2006,2007,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #define F_SETLKW64     7       /* Set record locking info (blocking).  */
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN      8       /* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN      9       /* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN      8       /* Get owner (process receiving SIGIO).  */
+# define F_GETOWN      9       /* Set owner (process receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_SETOWN_EX   12      /* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX   13      /* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -159,6 +161,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
index ff065effb599764aef46e561f29430a2b00fb175..f48e644e094af3b9c4e6a09bbc66543f8e7b89ca 100644 (file)
 # define __ASSUME_PREADV       1
 # define __ASSUME_PWRITEV      1
 #endif
+
+/* Support for F_GETOWN_EX was introduced in 2.6.32.  */
+#if __LINUX_KERNEL_VERSION >= 0x020620
+# define __ASSUME_F_GETOWN_EX  1
+#endif
index 493d5cba5f22c9836489e1e8a9d2a717aa47ec58..6c4b66b7aceb07c893a7353b4fba2948d90ad397 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/PowerPC.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 #define F_SETLKW64     14      /* Set record locking info (blocking).  */
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN      8       /* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN      9       /* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN      8       /* Get owner (process receiving of SIGIO).  */
+# define F_GETOWN      9       /* Set owner (process receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_SETOWN_EX   12      /* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX   13      /* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -166,6 +168,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
 #ifdef __USE_BSD
index 54c4c527513518e945ea1b73c1bead4f19c2a56e..d3dddbc368ad5dc5cff6ef4bdbc7d1d29ea08aeb 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000,2001,2002,2004,2006,2007 Free Software Foundation, Inc.
+   Copyright (C) 2000,2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #endif
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN      8       /* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN      9       /* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN      8       /* Get owner (process receiving SIGIO).  */
+# define F_GETOWN      9       /* Set owner (process receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_SETOWN_EX   12      /* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX   13      /* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -181,6 +183,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
 #ifdef __USE_BSD
index 35dfb299d2a5cc7d9484f40686302fe3e611fb0a..d7a21ea2e25754f370d00f223a3fbc5dd104b4e0 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
 #define F_SETLKW64     14      /* Set record locking info (blocking).  */
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN      8       /* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN      9       /* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN      8       /* Get owner (process receiving of SIGIO).  */
+# define F_GETOWN      9       /* Set owner (process receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_SETOWN_EX   12      /* Get owner (thread receiving of SIGIO).  */
+# define F_GETOWN_EX   13      /* Set owner (thread receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -166,6 +168,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
 #ifdef __USE_BSD
index 56d9c004e7e56d5bac8c3291c27b3e67f996ed95..dfa848a3776c5605ac43e54a6dfc213e80511db2 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/SPARC.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007, 2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -83,8 +83,8 @@
 #define F_GETFL                3       /* Get file status flags.  */
 #define F_SETFL                4       /* Set file status flags.  */
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_GETOWN      5       /* Get owner of socket (receiver of SIGIO).  */
-# define F_SETOWN      6       /* Set owner of socket (receiver of SIGIO).  */
+# define F_GETOWN      5       /* Get owner (process receiving SIGIO).  */
+# define F_SETOWN      6       /* Set owner (process receiving SIGIO).  */
 #endif
 #ifndef __USE_FILE_OFFSET64
 # define F_GETLK       7       /* Get record locking info.  */
@@ -99,6 +99,8 @@
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_GETOWN_EX   12      /* Get owner (thread receiving SIGIO).  */
+# define F_SETOWN_EX   13      /* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -185,6 +187,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
 #ifdef __USE_BSD
index 1d68a201a5edf0b06253ea96b71fda0eeecf5e41..c3eb859e7ded3e967ac562bb37f93a95c45e613f 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/x86-64.
-   Copyright (C) 2001, 2002, 2004, 2006, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #endif
 
 #if defined __USE_BSD || defined __USE_UNIX98
-# define F_SETOWN      8       /* Get owner of socket (receiver of SIGIO).  */
-# define F_GETOWN      9       /* Set owner of socket (receiver of SIGIO).  */
+# define F_SETOWN      8       /* Get owner (process receiving of SIGIO).  */
+# define F_GETOWN      9       /* Set owner (process receiving of SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
 # define F_SETSIG      10      /* Set number of signal to be sent.  */
 # define F_GETSIG      11      /* Get number of signal to be sent.  */
+# define F_SETOWN_EX   12      /* Get owner (thread receiving SIGIO).  */
+# define F_GETOWN_EX   13      /* Set owner (thread receiving SIGIO).  */
 #endif
 
 #ifdef __USE_GNU
@@ -180,6 +182,23 @@ struct flock64
   };
 #endif
 
+#ifdef __USE_GNU
+/* Owner types.  */
+enum __pid_type
+  {
+    F_OWNER_TID = 0,   /* Kernel thread.  */
+    F_OWNER_PID,       /* Process.  */
+    F_OWNER_GID                /* Process group.  */
+  };
+
+/* Structure to use with F_GETOWN_EX and F_SETOWN_EX.  */
+struct f_owner_ex
+  {
+    enum __pid_type type;      /* Owner type of ID.  */
+    __pid_t pid;               /* ID of owner.  */
+  };
+#endif
+
 /* Define some more compatibility macros to be backward compatible with
    BSD systems which did not managed to hide these kernel macros.  */
 #ifdef __USE_BSD