]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Revert "Fix F_GETOWN on some Linux archs." and "Define F_OWNER_* and f_owner_ex for...
authorAndreas Schwab <schwab@redhat.com>
Fri, 30 Oct 2009 10:20:44 +0000 (11:20 +0100)
committerAndreas Schwab <schwab@redhat.com>
Fri, 30 Oct 2009 15:11:26 +0000 (16:11 +0100)
They depend on F_GETOWN_EX/F_SETOWN_EX.

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 389761eacda0dbd6a120f67635a883cb14c09d33..aa8a10ddaad30dd29a7e5b17dc8efbd35b42d373 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -195,22 +195,6 @@ 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.
index b19654c62527466949217c611779cee4c00800ac..1f5aca14a478544edc650654ae459fc52cf130f9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2002, 2003, 2004 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
@@ -70,7 +36,7 @@ __fcntl_nocancel (int fd, int cmd, ...)
   arg = va_arg (ap, void *);
   va_end (ap);
 
-  return do_fcntl (fd, cmd, arg);
+  return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
 }
 #endif
 
@@ -86,11 +52,11 @@ __libc_fcntl (int fd, int cmd, ...)
   va_end (ap);
 
   if (SINGLE_THREAD_P || cmd != F_SETLKW)
-    return do_fcntl (fd, cmd, arg);
+    return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
 
   int oldtype = LIBC_CANCEL_ASYNC ();
 
-  int result = do_fcntl (fd, cmd, arg);
+  int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
 
   LIBC_CANCEL_RESET (oldtype);
 
index d1718a17c916e25cffe8667b7edd92300773201d..35ef665998f22a3deae27c541f19b362a8fc9b2a 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -166,23 +166,6 @@ 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 5544d6e0d9e68be4fae8494eeae9354c6c9bc083..b27373d24bc09e86a9839b5a359918d87bd02970 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000,2002,2003,2004,2006,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000,2002,2003,2004,2006 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
@@ -126,26 +119,6 @@ __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 9e11f648f805771d7b7258d3eb6b9c4df1379074..6abc5ced65ecfb8c03c98239cae0963e21e804fa 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/IA64.
-   Copyright (C) 1999,2000,2004,2006,2007,2009 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2004, 2006, 2007 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
@@ -159,23 +159,6 @@ 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 f48e644e094af3b9c4e6a09bbc66543f8e7b89ca..ff065effb599764aef46e561f29430a2b00fb175 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 dc2e0e6201b6a6faa85afa5ab9e10844bff8d314..90b669ab6097d48d328cf11fcf6e93e4f070850d 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, 2009
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -166,23 +166,6 @@ 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 b50c00c882c45d41bf3ccf69a9d30ed80d3540c5..ff5941df6544ce52fa71950b6d6bcda1b7566b75 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 2000,2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
+   Copyright (C) 2000,2001,2002,2004,2006,2007 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
@@ -181,23 +181,6 @@ 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 d1718a17c916e25cffe8667b7edd92300773201d..35ef665998f22a3deae27c541f19b362a8fc9b2a 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux.
-   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007, 2009
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -166,23 +166,6 @@ 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 648bea8e58635e4fb52dfe0476462ac5c4ae0536..d59744a55e22324a6365616654e15859ff2cb6f4 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, 2009
+   Copyright (C) 1995, 1996, 1997, 1998, 2000, 2003, 2004, 2006, 2007
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -185,23 +185,6 @@ 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 e9806ee004866c3cbbe47409aaac32fc74391e5b..bc0f4d687b38aed532315bf0788bbc81cfde00f5 100644 (file)
@@ -1,5 +1,5 @@
 /* O_*, F_*, FD_* bit values for Linux/x86-64.
-   Copyright (C) 2001,2002,2004,2006,2007,2009 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2004, 2006, 2007 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
@@ -180,23 +180,6 @@ 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