about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-02 10:30:16 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-02 10:30:16 +0000
commitea6710d38f9b7ab8a8d3d565d1cadd8c58d56f38 (patch)
treedd8e4fa9c6c9989004abc341309d06c0a1325582
parent13632cfc66bb9a1b55f3b6077b3f84d3de131c87 (diff)
downloadglibc-ea6710d38f9b7ab8a8d3d565d1cadd8c58d56f38.tar.gz
glibc-ea6710d38f9b7ab8a8d3d565d1cadd8c58d56f38.tar.xz
glibc-ea6710d38f9b7ab8a8d3d565d1cadd8c58d56f38.zip
Update.
1999-06-02  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/i386/sigaction.c: Read kernel-features.h
	and elide compatibility code if possible.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/i386/sigaction.c19
2 files changed, 23 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3e5b68e008..6379e3d3c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-06-02  Ulrich Drepper  <drepper@cygnus.com>
+
+	* sysdeps/unix/sysv/linux/i386/sigaction.c: Read kernel-features.h
+	and elide compatibility code if possible.
+
 1999-06-01  Ulrich Drepper  <drepper@cygnus.com>
 
 	* manual/llio.texi: Remove menu entry for removed section.
diff --git a/sysdeps/unix/sysv/linux/i386/sigaction.c b/sysdeps/unix/sysv/linux/i386/sigaction.c
index 142eac6a75..29f9fc5be8 100644
--- a/sysdeps/unix/sysv/linux/i386/sigaction.c
+++ b/sysdeps/unix/sysv/linux/i386/sigaction.c
@@ -1,5 +1,5 @@
 /* POSIX.1 `sigaction' call for Linux/i386.
-   Copyright (C) 1991, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 95, 96, 97, 98, 99 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
@@ -25,6 +25,8 @@
 #include <sysdep.h>
 #include <sys/syscall.h>
 
+#include <kernel-features.h>
+
 /* The difference here is that the sigaction structure used in the
    kernel is not the same as we use in the libc.  Therefore we must
    translate it here.  */
@@ -34,9 +36,11 @@
 extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
 				   struct kernel_sigaction *, size_t);
 
+#if __ASSUME_REALTIME_SIGNALS == 0
 /* The variable is shared between all wrappers around signal handling
    functions which have RT equivalents.  */
 int __libc_missing_rt_sigs;
+#endif
 
 
 /* If ACT is not NULL, change the action for SIG to *ACT.
@@ -44,15 +48,22 @@ int __libc_missing_rt_sigs;
 int
 __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 {
+#if __ASSUME_REALTIME_SIGNALS == 0
   struct old_kernel_sigaction k_newact, k_oldact;
+#endif
   int result;
 
 #ifdef __NR_rt_sigaction
+
   /* First try the RT signals.  */
+# if __ASSUME_REALTIME_SIGNALS == 0
   if (!__libc_missing_rt_sigs)
+# endif
     {
       struct kernel_sigaction kact, koact;
+# if __ASSUME_REALTIME_SIGNALS == 0
       int saved_errno = errno;
+# endif
 
       if (act)
 	{
@@ -69,7 +80,9 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
       result = INLINE_SYSCALL (rt_sigaction, 4, sig, act ? &kact : NULL,
 			       oact ? &koact : NULL, _NSIG / 8);
 
+# if __ASSUME_REALTIME_SIGNALS == 0
       if (result >= 0 || errno != ENOSYS)
+# endif
 	{
 	  if (oact && result >= 0)
 	    {
@@ -81,11 +94,14 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
 	  return result;
 	}
 
+# if __ASSUME_REALTIME_SIGNALS == 0
       __set_errno (saved_errno);
       __libc_missing_rt_sigs = 1;
+# endif
     }
 #endif
 
+#if __ASSUME_REALTIME_SIGNALS == 0
   if (act)
     {
       k_newact.k_sa_handler = act->sa_handler;
@@ -119,6 +135,7 @@ __sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
     }
 
   return 0;
+#endif
 
  restore:
   asm (