Fix sys/ucontext.h namespace from signal.h etc. inclusion (bug 21457)

Message ID alpine.DEB.2.20.1705222234140.9690@digraph.polyomino.org.uk
State New, archived
Headers

Commit Message

Joseph Myers May 22, 2017, 10:34 p.m. UTC
  The various sys/ucontext.h headers include <signal.h> and all the
headers split out of <bits/sigstack.h>.  (Except that the powerpc
version does not include <signal.h>.)

None of the standard versions defining ucontext.h require or permit
such inclusions; rather, they all say that the stack_t and sigset_t
types from signal.h are defined.  This patch fixes the headers to
include just the bits/ headers for those types (and the existing
includes of bits/sigcontext.h).  Since bits/types/sigset_t.h is now
being included instead of bits/types/__sigset_t.h, __sigset_t uses in
the headers are replaced by direct use of the public sigset_t type.
sysdeps/unix/sysv/linux/x86/bits/sigcontext.h was relying on the prior
inclusion of <signal.h> to define types such as __uint32_t, so gets a
bits/types.h include added to provide those types.

Although one could keep some or all of the includes under a __USE_MISC
conditional, that seems unnecessary to me, especially given the lack
of a <signal.h> include in the powerpc version meaning that portable
programs already cannot rely on such an include.

Tested for x86_64 and x86, and with build-many-glibcs.py.  As with
other such fixes, more namespace issues remain so this does not permit
any XFAILs to be removed or bugs to be closed.

2017-05-22  Joseph Myers  <joseph@codesourcery.com>

	[BZ #21457]
	* sysdeps/arm/sys/ucontext.h: Do not include <signal.h>,
	<bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/generic/sys/ucontext.h: Do not include <signal.h>,
	<bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/i386/sys/ucontext.h: Do not include <signal.h>,
	<bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/m68k/sys/ucontext.h: Do not include <signal.h>,
	<bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/mips/sys/ucontext.h: Do not include <signal.h>,
	<bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h>.
	* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Do not include
	<bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.
	* sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
	* sysdeps/unix/sysv/linux/x86/bits/sigcontext.h: Include
	<bits/types.h>.
	* sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Do not include
	<signal.h>, <bits/sigstack.h>, <bits/types/struct_sigstack.h> or
	<bits/ss_flags.h>.  Include <bits/types/sigset_t.h> instead of
	<bits/types/__sigset_t.h>.
	(ucontext_t): Use sigset_t instead of __sigset_t.
  

Comments

Zack Weinberg May 22, 2017, 10:51 p.m. UTC | #1
On Mon, May 22, 2017 at 6:34 PM, Joseph Myers <joseph@codesourcery.com> wrote:
> The various sys/ucontext.h headers include <signal.h> and all the
> headers split out of <bits/sigstack.h>.  (Except that the powerpc
> version does not include <signal.h>.)
>
> None of the standard versions defining ucontext.h require or permit
> such inclusions; rather, they all say that the stack_t and sigset_t
> types from signal.h are defined.  This patch fixes the headers to
> include just the bits/ headers for those types (and the existing
> includes of bits/sigcontext.h).

Looks good to me.
  

Patch

diff --git a/sysdeps/arm/sys/ucontext.h b/sysdeps/arm/sys/ucontext.h
index bbfeb20..37277f0 100644
--- a/sysdeps/arm/sys/ucontext.h
+++ b/sysdeps/arm/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 typedef int greg_t;
@@ -97,7 +91,7 @@  typedef struct ucontext
   {
     unsigned long int uc_flags;
     struct ucontext *uc_link;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
     long int uc_filler[5];
diff --git a/sysdeps/generic/sys/ucontext.h b/sysdeps/generic/sys/ucontext.h
index a0602a7..a64460c 100644
--- a/sysdeps/generic/sys/ucontext.h
+++ b/sysdeps/generic/sys/ucontext.h
@@ -23,16 +23,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 typedef struct sigcontext mcontext_t;
@@ -44,7 +38,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/i386/sys/ucontext.h b/sysdeps/i386/sys/ucontext.h
index 92deea9..a6b936a 100644
--- a/sysdeps/i386/sys/ucontext.h
+++ b/sysdeps/i386/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /* Type for general register.  */
@@ -122,7 +116,7 @@  typedef struct ucontext
   {
     unsigned long int uc_flags;
     struct ucontext *uc_link;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
     long int uc_filler[5];
diff --git a/sysdeps/m68k/sys/ucontext.h b/sysdeps/m68k/sys/ucontext.h
index 4f185ce..2b70e72 100644
--- a/sysdeps/m68k/sys/ucontext.h
+++ b/sysdeps/m68k/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /* Type for general register.  */
@@ -112,7 +106,7 @@  typedef struct ucontext
 {
   unsigned long int uc_flags;
   struct ucontext *uc_link;
-  __sigset_t uc_sigmask;
+  sigset_t uc_sigmask;
   stack_t uc_stack;
   mcontext_t uc_mcontext;
   long int uc_filler[201];
diff --git a/sysdeps/mips/sys/ucontext.h b/sysdeps/mips/sys/ucontext.h
index 9c6f8f8..ebc0609 100644
--- a/sysdeps/mips/sys/ucontext.h
+++ b/sysdeps/mips/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 #include <sgidefs.h>
 
@@ -162,7 +156,7 @@  typedef struct ucontext
   __uint64_t uc_flags;
 #endif
   struct ucontext *uc_link;
-  __sigset_t uc_sigmask;
+  sigset_t uc_sigmask;
   stack_t uc_stack;
   mcontext_t uc_mcontext;
   int uc_filler[48];
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
index 597f9ea..16c7acf 100644
--- a/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
@@ -22,16 +22,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 #ifdef __USE_MISC
 # include <sys/procfs.h>
@@ -58,7 +52,7 @@  typedef struct ucontext
     unsigned long uc_flags;
     struct ucontext *uc_link;
     stack_t uc_stack;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
     mcontext_t uc_mcontext;
   } ucontext_t;
 
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h b/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
index 4491ff7..09e24a1 100644
--- a/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
@@ -19,16 +19,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /* Type for general register.  */
@@ -61,7 +55,7 @@  typedef struct ucontext
     unsigned long __uc_osf_sigmask;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/arm/sys/ucontext.h b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
index d7c7d9e..0ce9b14 100644
--- a/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 #ifdef __USE_MISC
@@ -113,7 +107,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
     unsigned long uc_regspace[128] __attribute__((__aligned__(8)));
   } ucontext_t;
 
diff --git a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
index 79b99ff..982b4c4 100644
--- a/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 #ifdef __USE_MISC
@@ -67,7 +61,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h b/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
index 17474a5..5ed6929 100644
--- a/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
@@ -19,15 +19,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /*
diff --git a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
index 62dd96e..0570ec3 100644
--- a/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /* Type for general register.  */
@@ -120,7 +114,7 @@  typedef struct ucontext
   stack_t uc_stack;
   mcontext_t uc_mcontext;
   unsigned long uc_filler[80];
-  __sigset_t uc_sigmask;
+  sigset_t uc_sigmask;
 } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
index 06b45a8..d15d85d 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
@@ -20,16 +20,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 #include <sgidefs.h>
 
@@ -113,7 +107,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
index 7099b45..72ae1a0 100644
--- a/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
@@ -22,16 +22,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /* These definitions must be in sync with the kernel.  */
@@ -54,7 +48,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
index d91a5ac..c10741c 100644
--- a/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
@@ -20,14 +20,9 @@ 
 
 #include <features.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
 #include <bits/types/sigset_t.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 #if __WORDSIZE == 32
diff --git a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
index fcbd48d..80410fa 100644
--- a/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
@@ -20,16 +20,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by in <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 /* Type for a program status word.  */
@@ -84,7 +78,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 
diff --git a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
index cefb918..7444298 100644
--- a/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
@@ -21,16 +21,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 typedef int greg_t;
@@ -113,7 +107,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
index e859b79..7ce5f2b 100644
--- a/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
@@ -19,16 +19,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 #include <bits/wordsize.h>
 
@@ -94,7 +88,7 @@  typedef struct ucontext {
 	unsigned long		__uc_sigmask;
 	mcontext_t		uc_mcontext;
 	stack_t			uc_stack;
-	__sigset_t		uc_sigmask;
+	sigset_t		uc_sigmask;
 } ucontext_t;
 
 #endif /* __WORDISIZE == 64 */
@@ -271,7 +265,7 @@  typedef struct ucontext
   {
     unsigned long   uc_flags;
     struct ucontext *uc_link;
-    __sigset_t	    uc_sigmask;
+    sigset_t	    uc_sigmask;
     stack_t         uc_stack;
     mcontext_t      uc_mcontext;
   } ucontext_t;
diff --git a/sysdeps/unix/sysv/linux/tile/sys/ucontext.h b/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
index 4a40e57..7e5cf4a 100644
--- a/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/tile/sys/ucontext.h
@@ -20,16 +20,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 #ifdef __USE_MISC
 /* Get register type and register names. */
@@ -72,7 +66,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
   } ucontext_t;
 
 #endif /* sys/ucontext.h */
diff --git a/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
index bc692bc..cff595b 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
@@ -22,6 +22,8 @@ 
 # error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
 #endif
 
+#include <bits/types.h>
+
 #define FP_XSTATE_MAGIC1	0x46505853U
 #define FP_XSTATE_MAGIC2	0x46505845U
 #define FP_XSTATE_MAGIC2_SIZE	sizeof(FP_XSTATE_MAGIC2)
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
index 60a3edf..92a698e 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
@@ -19,16 +19,10 @@ 
 #define _SYS_UCONTEXT_H	1
 
 #include <features.h>
-#include <signal.h>
 
-/* We need the signal context definitions even if they are not exposed
-   by <signal.h>.  */
-#include <bits/types/__sigset_t.h>
+#include <bits/types/sigset_t.h>
 #include <bits/sigcontext.h>
-#include <bits/sigstack.h>
-#include <bits/types/struct_sigstack.h>
 #include <bits/types/stack_t.h>
-#include <bits/ss_flags.h>
 
 
 #ifdef __x86_64__
@@ -142,7 +136,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
     struct _libc_fpstate __fpregs_mem;
   } ucontext_t;
 
@@ -243,7 +237,7 @@  typedef struct ucontext
     struct ucontext *uc_link;
     stack_t uc_stack;
     mcontext_t uc_mcontext;
-    __sigset_t uc_sigmask;
+    sigset_t uc_sigmask;
     struct _libc_fpstate __fpregs_mem;
   } ucontext_t;