]> sourceware.org Git - glibc.git/commitdiff
Remove NO_CANCELLATION macro
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 3 Aug 2017 17:29:06 +0000 (14:29 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 31 Aug 2017 19:10:34 +0000 (16:10 -0300)
The NO_CANCELLATION macro is used currently on generic headers to
define non cancellable syscalls and on Linux fcntl to implement the non
cancellable variation.  Former should be single-handled by not-cancel.h
header and former could be simplified build both cancellable and non
cancellable for default objects and alias the non-cancellable to default
one for rtld ones (since Linux already support cancellation as default).

This patch thus removes the NO_CANCELLATION macro and its usage.  The
generic non cancellable fcntl is route to internal fcntl.

Checked on x86_64-linux-gnu and i686-linux-gnu.  Also checked with
a build again major ABIs.

* sysdeps/generic/not-cancel.h (NO_CANCELLATION): Remove macro.
* sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
(NO_CANCELLATION): Likewise.
* sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
(NO_CANCELLATION): Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
(NO_CANCELLATION): Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (NO_CANCELLATION):
Likewise
* sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (NO_CANCELLATION):
Likewise.
* sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Add
hidden prototype.
* sysdeps/unix/sysv/linux/fcntl.c (__fcntl_nocancel): Define only
for !IS_IN (rtld) and remove NO_CANCELLATION usage.

21 files changed:
ChangeLog
sysdeps/generic/not-cancel.h
sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h
sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h
sysdeps/unix/sysv/linux/arm/sysdep-cancel.h
sysdeps/unix/sysv/linux/fcntl.c
sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
sysdeps/unix/sysv/linux/i386/sysdep-cancel.h
sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h
sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h
sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
sysdeps/unix/sysv/linux/mips/sysdep-cancel.h
sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h
sysdeps/unix/sysv/linux/not-cancel.h
sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h
sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
sysdeps/unix/sysv/linux/sh/sysdep-cancel.h
sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h
sysdeps/unix/sysv/linux/tile/sysdep-cancel.h
sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h

index e0473dc29e0fecbf7daafc1c2150d33da962feff..a934c6939317b6e5b825895e35b38ec3f1d64102 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,45 @@
+2017-08-31  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/generic/not-cancel.h (NO_CANCELLATION): Remove macro.
+       * sysdeps/unix/sysv/linux/aarch64/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/alpha/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/arm/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/ia64/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/m68k/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/microblaze/sysdep-cancel.h
+       (NO_CANCELLATION): Likewise.
+       * sysdeps/unix/sysv/linux/mips/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/nios2/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep-cancel.h
+       (NO_CANCELLATION): Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep-cancel.h
+       (NO_CANCELLATION): Likewise.
+       * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise
+       * sysdeps/unix/sysv/linux/sparc/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/tile/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/sysdep-cancel.h (NO_CANCELLATION):
+       Likewise.
+       * sysdeps/unix/sysv/linux/not-cancel.h (__fcntl_nocancel): Add
+       hidden prototype.
+       * sysdeps/unix/sysv/linux/fcntl.c (__fcntl_nocancel): Define only
+       for !IS_IN (rtld) and remove NO_CANCELLATION usage.
+
 2017-08-31  Steve Ellcey  <sellcey@cavium.com>
 
        * sysdeps/aarch64/dl-irel.h: (elf_ifunc_invoke): Change argument type
index e5a850c6fdeeaae1ce22f1a6d61e322cf5951e44..41ce1fc9fa82f42640a925752f70db171ba2d60f 100644 (file)
@@ -44,5 +44,3 @@
   __nanosleep (requested_time, remaining)
 #define __fcntl_nocancel(fd, cmd, ...) \
   __fcntl (fd, cmd, __VA_ARGS__)
-
-#define NO_CANCELLATION 1
index 80732f5445169ee6daa5a93d897204717d2d6cbe..27741a3f02ce96f859f5e48da06ad47466529cb0 100644 (file)
@@ -41,7 +41,6 @@ extern int __local_multiple_threads attribute_hidden;
 
 /* For rtld, et cetera.  */
 # define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
 
 #endif
 
index 72e6c0cb60c86335009885c50a7098db188d8e2a..561cb67f1ca3d2a1515cb81a67071ff879c34d8a 100644 (file)
@@ -39,7 +39,6 @@ extern int __local_multiple_threads attribute_hidden;
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index 8930245ff32f8e284c62cabe2311bd2f94067322..b227187ab99a3578c56b8ff97013d21b2fd19ce0 100644 (file)
@@ -40,7 +40,6 @@ extern int __local_multiple_threads attribute_hidden;
 
 /* For rtld, et cetera.  */
 # define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
 
 #endif
 
index 76e846c6accd5a38436bc2ec7fb7f722c0ca26a2..cda6be712dec2c9bb674a5a822f1bcf4e9b866aa 100644 (file)
@@ -19,6 +19,7 @@
 #include <stdarg.h>
 #include <errno.h>
 #include <sysdep-cancel.h>
+#include <not-cancel.h>
 
 #ifndef __NR_fcntl64
 # define __NR_fcntl64 __NR_fcntl
@@ -46,9 +47,8 @@ fcntl_common (int fd, int cmd, void *arg)
   return INLINE_SYSCALL_CALL (fcntl64, fd, cmd, (void *) arg);
 }
 
-#ifndef NO_CANCELLATION
 int
-__fcntl_nocancel (int fd, int cmd, ...)
+__libc_fcntl (int fd, int cmd, ...)
 {
   va_list ap;
   void *arg;
@@ -57,12 +57,18 @@ __fcntl_nocancel (int fd, int cmd, ...)
   arg = va_arg (ap, void *);
   va_end (ap);
 
+  cmd = FCNTL_ADJUST_CMD (cmd);
+
+  if (cmd == F_SETLKW || cmd == F_SETLKW64)
+    return SYSCALL_CANCEL (fcntl64, fd, cmd, (void *) arg);
+
   return fcntl_common (fd, cmd, arg);
 }
-#endif
+libc_hidden_def (__libc_fcntl)
 
+#if !IS_IN (rtld)
 int
-__libc_fcntl (int fd, int cmd, ...)
+__fcntl_nocancel (int fd, int cmd, ...)
 {
   va_list ap;
   void *arg;
@@ -71,14 +77,12 @@ __libc_fcntl (int fd, int cmd, ...)
   arg = va_arg (ap, void *);
   va_end (ap);
 
-  cmd = FCNTL_ADJUST_CMD (cmd);
-
-  if (cmd == F_SETLKW || cmd == F_SETLKW64)
-    return SYSCALL_CANCEL (fcntl64, fd, cmd, (void *) arg);
-
   return fcntl_common (fd, cmd, arg);
 }
-libc_hidden_def (__libc_fcntl)
+#else
+strong_alias (__libc_fcntl, __fcntl_nocancel)
+#endif
+libc_hidden_def (__fcntl_nocancel)
 
 weak_alias (__libc_fcntl, __fcntl)
 libc_hidden_weak (__fcntl)
index bf88ea56beb0321e6366240b0c345bc40f6d1605..8a85fc214477b77e1eef24ed25108298a1cb217f 100644 (file)
@@ -38,7 +38,6 @@
 
 /* This code should never be used but we define it anyhow.  */
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 /* IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt) */
index 7ad851ade6316bbc3874aabf22e576c7d4ddfb82..5c11983bb58e27e9d2e35e1bbaaa2ee2098812ad 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index d3d02d4ca35c99c400a01bea21fe429dcde9727a..fe5b35ad887c6e4045dae0868a0a9964f75a448b 100644 (file)
@@ -25,7 +25,6 @@
   __glibc_likely (THREAD_GETMEM (THREAD_SELF, header.multiple_threads) == 0)
 #else
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 #endif
 
 #define RTLD_SINGLE_THREAD_P \
index cf96c10d1f9865da2d2022547f1fbf2a7c3a7f54..b192a6875abd07a85f3c0be26a729e010c8802e6 100644 (file)
@@ -27,7 +27,6 @@
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION (1)
 
 #endif
 
index 8655c9dc970efbd3fce6f25e11de570b69a4428b..120ea06ba3c52f6c40122593a05598e0e2bbd07b 100644 (file)
@@ -38,7 +38,6 @@ extern int __local_multiple_threads attribute_hidden;
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION (1)
 
 #endif
 
index 76d7ef43cfca7ab2df68cd2f43685a3487b4f0c1..31dbba0470718b8c521c757d97f0737c8246f837 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
 
 #endif
 
index 73b623614d1d654d35855656ac9d60fc6e62d5f1..4e7f5363a15698361760c64febee839f83190efd 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
 
 #endif
 
index ae0b059e75366f5700345787e5c8091505d37a97..8f4f3380b9cbbb677535450a86be0903d3f4402a 100644 (file)
@@ -86,6 +86,7 @@ __typeof (__nanosleep) __nanosleep_nocancel;
 hidden_proto (__nanosleep_nocancel)
 
 /* Uncancelable fcntl.  */
-__typeof (__fcntl) __fcntl_nocancel attribute_hidden;
+__typeof (__fcntl) __fcntl_nocancel;
+libc_hidden_proto (__fcntl_nocancel)
 
 #endif /* NOT_CANCEL_H  */
index 532df316d557d1535d26026e091dba798148abe8..59f752f950059062b2e08b51ee1a3e90756f4502 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index 459b742f7abd38970e38148b467202214b67736f..bd606d5f8e7c54b4dbe38034c51faf94e742c92c 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index 99adad19a07b0a79268cf5b24214e6ea6b711cb1..2283b861cd0a80a9f934a245c79b3e30b4a80cde 100644 (file)
@@ -43,7 +43,6 @@ extern int __local_multiple_threads attribute_hidden;
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index 3f880bdf3bf526df68a006a98dff3f173f206835..b2deb1191bd0fdfcbc0d225fc3b20aba739dfad9 100644 (file)
@@ -27,7 +27,6 @@
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index 412b31af107b6ea97ba024d76c75bc2aa45c1bb1..7fe0deee6388d9bd1fdfa46c7900431d5c135887 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
index 277709f848f7532c0e50d52ffc4f4e0448a46a27..a606b0ceaaa06dd9302e1c2cf2da96a530a18699 100644 (file)
@@ -28,7 +28,6 @@
 #else
 
 # define SINGLE_THREAD_P 1
-# define NO_CANCELLATION 1
 
 #endif
 
index c1c07199ff0d62526daccf1bb66cb372d899a003..34f14c6bc94864e5f2cf4591acca854b09390ae5 100644 (file)
@@ -43,7 +43,6 @@ extern int __local_multiple_threads attribute_hidden;
 #else
 
 # define SINGLE_THREAD_P (1)
-# define NO_CANCELLATION 1
 
 #endif
 
This page took 0.066104 seconds and 5 git commands to generate.