]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove __ASSUME_SIGNALFD4.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 21 Mar 2016 16:30:05 +0000 (16:30 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 21 Mar 2016 16:30:05 +0000 (16:30 +0000)
Current Linux kernel version requirements mean the signalfd4 syscall
can always be assumed to be available.  This patch removes
__ASSUME_SIGNALFD4 and associated conditionals.

Tested for x86_64 and x86 that installed stripped shared libraries are
unchanged by the patch.

* sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SIGNALFD4):
Remove macro.
* sysdeps/unix/sysv/linux/signalfd.c: Do not include
<kernel-features.h>.
(signalfd) [__NR_signalfd4]: Make code unconditional.
(signalfd) [!__ASSUME_SIGNALFD4]: Remove conditional code.

ChangeLog
sysdeps/unix/sysv/linux/kernel-features.h
sysdeps/unix/sysv/linux/signalfd.c

index ffaf973d141aa585669629784e1d939e7af67f57..52ec51044e7c041682715363b8d8da5eb6430cd0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-03-21  Joseph Myers  <joseph@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/kernel-features.h (__ASSUME_SIGNALFD4):
+       Remove macro.
+       * sysdeps/unix/sysv/linux/signalfd.c: Do not include
+       <kernel-features.h>.
+       (signalfd) [__NR_signalfd4]: Make code unconditional.
+       (signalfd) [!__ASSUME_SIGNALFD4]: Remove conditional code.
+
 2016-03-21  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Fix implict checks
index 34a7bd23a2537d39d7a26317aa846098c7dc20af..28195e5629044a1c06f28397c1a83ddb4a73f05b 100644 (file)
@@ -83,7 +83,6 @@
    2.6.27.  */
 #define __ASSUME_IN_NONBLOCK   1
 #define __ASSUME_PIPE2         1
-#define __ASSUME_SIGNALFD4     1
 #define __ASSUME_DUP3          1
 
 /* Support for accept4 functionality was added in 2.6.28, but for some
index ba64dad8016b9edc741d768282086368ac015bfb..99ecf6e0d7ce9217b582958cfbdaf4c75f1d58f0 100644 (file)
 #include <signal.h>
 #include <sys/signalfd.h>
 #include <sysdep.h>
-#include <kernel-features.h>
 
 
 int
 signalfd (int fd, const sigset_t *mask, int flags)
 {
-#ifdef __NR_signalfd4
-  int res = INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
-# ifndef __ASSUME_SIGNALFD4
-  if (res != -1 || errno != ENOSYS)
-# endif
-    return res;
-#endif
-
-#ifndef __ASSUME_SIGNALFD4
-  /* The old system call has no flag parameter which is bad.  So we have
-     to wait until we have to support to pass additional values to the
-     kernel (sys_indirect) before implementing setting flags like
-     O_NONBLOCK etc.  */
-  if (flags != 0)
-    return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
-
-# ifdef __NR_signalfd
-  return INLINE_SYSCALL (signalfd, 3, fd, mask, _NSIG / 8);
-# else
-  return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOSYS);
-# endif
-#elif !defined __NR_signalfd4
-# error "__ASSUME_SIGNALFD4 defined but not __NR_signalfd4"
-#endif
+  return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
 }