]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Split up bits/sigstack.h.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 19 May 2017 20:35:07 +0000 (20:35 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 19 May 2017 20:35:07 +0000 (20:35 +0000)
bits/sigstack.h contains four things: the legacy struct sigstack type,
the preferred stack_t type, the SS_* enum values and macros for signal
stack sizes.

These vary in different ways between glibc configurations; in
particular, the stack sizes vary much more than any of the other
pieces.  Furthermore, these pieces have different standard namespace
rules for when they should be visible (not currently visible in
conform/ results both because the relevant tests are XFAILed for
sys/ucontext.h namespace issues, and because some of the expectations
are incorrect in the same way as the headers, e.g. neither
expectations nor headers reflect that current POSIX no longer has
either the sigstack function or the sigstack structure).

To reduce duplication of identical definitions, and facilitate
namespace fixes without requiring the same feature test macro
conditions to be repeated in many versions of the same header, this
patch splits bits/sigstack.h up into four headers.  It keeps the stack
size macros, while new bits/types/struct_sigstack.h,
bits/types/stack_t.h and bits/ss_flags.h are added for the other
pieces.  bits/types/struct_sigstack.h is the same everywhere,
bits/types/stack_t.h has three variants different in the order of the
structure elements (generic = MIPS Linux, and other Linux), and
bits/ss_flags.h has generic and Linux variants.

This patch includes the new headers everywhere that included
<bits/sigstack.h>, so should cause no difference to what any public
header defines.  Subsequent namespace fixes would then remove or
condition some of those includes.

There should be no conflicts with Zack's changes to signal.h types,
beyond the trivial conflict of both making additions to
signal/Makefile's headers list; the two patches affect disjoint sets
of types and other definitions.

Tested for x86_64 and x86, and with build-many-glibcs.py.

* bits/ss_flags.h: New file.
* bits/types/stack_t.h: Likewise.
* include/bits/types/struct_sigstack.h: Likewise.
* signal/bits/types/struct_sigstack.h: Likewise.
* sysdeps/unix/sysv/linux/bits/ss_flags.h: Likewise.
* sysdeps/unix/sysv/linux/bits/types/stack_t.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h: Likewise.
* signal/Makefile (headers): Add bits/types/struct_sigstack.h,
bits/types/stack_t.h and bits/ss_flags.h.
* signal/signal.h [__USE_XOPEN_EXTENDED || __USE_XOPEN2K8]:
Include <bits/types/struct_sigstack.h>, <bits/types/stack_t.h> and
<bits/ss_flags.h>.
* bits/sigstack.h (struct sigstack): Remove.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
(struct sigstack): Likewise.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/sigstack.h (struct sigstack):
Likewise.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/unix/sysv/linux/bits/sigstack.h (struct sigstack):
Likewise.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/unix/sysv/linux/mips/bits/sigstack.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/sigstack.h (struct sigstack):
Likewise.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
(struct sigstack): Likewise.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/sigstack.h (struct sigstack):
Likewise.
(stack_t): Likewise.
(SS_ONSTACK): Likewise.
(SS_DISABLE): Likewise.
* sysdeps/arm/sys/ucontext.h: Include
<bits/types/struct_sigstack.h>, <bits/types/stack_t.h> and
<bits/ss_flags.h>.
* sysdeps/generic/sys/ucontext.h: Likewise.
* sysdeps/i386/sys/ucontext.h: Likewise.
* sysdeps/m68k/sys/ucontext.h: Likewise.
* sysdeps/mips/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Likewise.
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Likewise.

37 files changed:
ChangeLog
bits/sigstack.h
bits/ss_flags.h [new file with mode: 0644]
bits/types/stack_t.h [new file with mode: 0644]
include/bits/types/struct_sigstack.h [new file with mode: 0644]
signal/Makefile
signal/bits/types/struct_sigstack.h [new file with mode: 0644]
signal/signal.h
sysdeps/arm/sys/ucontext.h
sysdeps/generic/sys/ucontext.h
sysdeps/i386/sys/ucontext.h
sysdeps/m68k/sys/ucontext.h
sysdeps/mips/sys/ucontext.h
sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
sysdeps/unix/sysv/linux/alpha/bits/sigstack.h
sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
sysdeps/unix/sysv/linux/arm/sys/ucontext.h
sysdeps/unix/sysv/linux/bits/sigstack.h
sysdeps/unix/sysv/linux/bits/ss_flags.h [moved from sysdeps/unix/sysv/linux/mips/bits/sigstack.h with 59% similarity]
sysdeps/unix/sysv/linux/bits/types/stack_t.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
sysdeps/unix/sysv/linux/ia64/bits/sigstack.h
sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/mips/sys/ucontext.h
sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
sysdeps/unix/sysv/linux/s390/sys/ucontext.h
sysdeps/unix/sysv/linux/sh/sys/ucontext.h
sysdeps/unix/sysv/linux/sparc/bits/sigstack.h
sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
sysdeps/unix/sysv/linux/tile/sys/ucontext.h
sysdeps/unix/sysv/linux/x86/sys/ucontext.h

index b9fbdb8351839ee6891d1875718df4d2012fda3d..f25eb14ca93387855a94be6ebdd70dc2ebc8f5b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,75 @@
+2017-05-19  Joseph Myers  <joseph@codesourcery.com>
+
+       * bits/ss_flags.h: New file.
+       * bits/types/stack_t.h: Likewise.
+       * include/bits/types/struct_sigstack.h: Likewise.
+       * signal/bits/types/struct_sigstack.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/ss_flags.h: Likewise.
+       * sysdeps/unix/sysv/linux/bits/types/stack_t.h: Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h: Likewise.
+       * signal/Makefile (headers): Add bits/types/struct_sigstack.h,
+       bits/types/stack_t.h and bits/ss_flags.h.
+       * signal/signal.h [__USE_XOPEN_EXTENDED || __USE_XOPEN2K8]:
+       Include <bits/types/struct_sigstack.h>, <bits/types/stack_t.h> and
+       <bits/ss_flags.h>.
+       * bits/sigstack.h (struct sigstack): Remove.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h
+       (struct sigstack): Likewise.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/unix/sysv/linux/alpha/bits/sigstack.h (struct sigstack):
+       Likewise.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/unix/sysv/linux/bits/sigstack.h (struct sigstack):
+       Likewise.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/unix/sysv/linux/mips/bits/sigstack.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/sigstack.h (struct sigstack):
+       Likewise.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h
+       (struct sigstack): Likewise.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/sigstack.h (struct sigstack):
+       Likewise.
+       (stack_t): Likewise.
+       (SS_ONSTACK): Likewise.
+       (SS_DISABLE): Likewise.
+       * sysdeps/arm/sys/ucontext.h: Include
+       <bits/types/struct_sigstack.h>, <bits/types/stack_t.h> and
+       <bits/ss_flags.h>.
+       * sysdeps/generic/sys/ucontext.h: Likewise.
+       * sysdeps/i386/sys/ucontext.h: Likewise.
+       * sysdeps/m68k/sys/ucontext.h: Likewise.
+       * sysdeps/mips/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/alpha/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/arm/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/hppa/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/ia64/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/mips/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/s390/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/sh/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/tile/sys/ucontext.h: Likewise.
+       * sysdeps/unix/sysv/linux/x86/sys/ucontext.h: Likewise.
+
 2017-05-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/i386/i686/multiarch/memchr-sse2.S (MEMCHR): Use
index 42143e363a5401d943e9a086b01af3a31c79e5af..3127c325e5218d8373b31508367cd2ed6e066eed 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    __ptr_t ss_sp;             /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    __ptr_t ss_sp;
-    size_t ss_size;
-    int ss_flags;
-  } stack_t;
-
-
-/* Possible values for `ss_flags.'.  */
-enum
-{
-  SS_ONSTACK = 0x0001,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE = 0x0004
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minumum stack size for a signal handler.  */
 #define MINSIGSTKSZ    8192
 
diff --git a/bits/ss_flags.h b/bits/ss_flags.h
new file mode 100644 (file)
index 0000000..fa3836c
--- /dev/null
@@ -0,0 +1,35 @@
+/* ss_flags values for stack_t.
+   Copyright (C) 1998-2017 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef _BITS_SS_FLAGS_H
+#define _BITS_SS_FLAGS_H 1
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never include this file directly.  Use <signal.h> instead"
+#endif
+
+/* Possible values for `ss_flags.'.  */
+enum
+{
+  SS_ONSTACK = 0x0001,
+#define SS_ONSTACK     SS_ONSTACK
+  SS_DISABLE = 0x0004
+#define SS_DISABLE     SS_DISABLE
+};
+
+#endif /* bits/ss_flags.h */
diff --git a/bits/types/stack_t.h b/bits/types/stack_t.h
new file mode 100644 (file)
index 0000000..3cf0a40
--- /dev/null
@@ -0,0 +1,33 @@
+/* Define stack_t.
+   Copyright (C) 1998-2017 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef __stack_t_defined
+#define __stack_t_defined 1
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Structure describing a signal stack.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    size_t ss_size;
+    int ss_flags;
+  } stack_t;
+
+#endif
diff --git a/include/bits/types/struct_sigstack.h b/include/bits/types/struct_sigstack.h
new file mode 100644 (file)
index 0000000..05f1ee5
--- /dev/null
@@ -0,0 +1 @@
+#include "../../signal/bits/types/struct_sigstack.h"
index b65bf6b40888080dd0e3ce543b49833a8dbc8621..077aaea6ad9a7c5ebbe6ed56764c466bba26da73 100644 (file)
@@ -24,7 +24,8 @@ include ../Makeconfig
 
 headers        := signal.h sys/signal.h bits/signum.h bits/sigcontext.h \
           bits/sigaction.h bits/sigset.h bits/siginfo.h bits/sigstack.h \
-          bits/sigthread.h
+          bits/sigthread.h bits/types/struct_sigstack.h bits/types/stack_t.h \
+          bits/ss_flags.h
 
 routines       := signal raise killpg \
                   sigaction sigprocmask kill \
diff --git a/signal/bits/types/struct_sigstack.h b/signal/bits/types/struct_sigstack.h
new file mode 100644 (file)
index 0000000..5e93ce0
--- /dev/null
@@ -0,0 +1,29 @@
+/* Define struct sigstack.
+   Copyright (C) 1998-2017 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef __sigstack_defined
+#define __sigstack_defined 1
+
+/* Structure describing a signal stack (obsolete).  */
+struct sigstack
+  {
+    void *ss_sp;               /* Signal stack pointer.  */
+    int ss_onstack;            /* Nonzero if executing on this stack.  */
+  };
+
+#endif
index 6db2d2f100ede40c9c4a640ac6ef52dc6061dfb8..d01df3290a2d0ab963edc14a365fedd806aff37b 100644 (file)
@@ -314,6 +314,9 @@ extern int sigreturn (struct sigcontext *__scp) __THROW;
 extern int siginterrupt (int __sig, int __interrupt) __THROW;
 
 # include <bits/sigstack.h>
+# include <bits/types/struct_sigstack.h>
+# include <bits/types/stack_t.h>
+# include <bits/ss_flags.h>
 # if defined __USE_XOPEN || defined __USE_XOPEN2K8
 /* This will define `ucontext_t' and `mcontext_t'.  */
 #  include <sys/ucontext.h>
index 09fe418b3c393e7e9f91151c82e40e382a2184ad..49d60395dd2e3a87f4312d38f5fad7c995af272b 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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;
index 6c475b5a4a7b02195d6f5b29258589fabb21c45c..052c5401cb32a5b549e9936c95e791c171e9571f 100644 (file)
@@ -29,6 +29,9 @@
    by <signal.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;
index c632e50ebada9d5ff777081bc6f43311f43ae0f5..241f270a9961c865e0df09cc22001d49b87b6cb8 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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.  */
index cbec1db5d6874a6860de0196c50107797caa0b8f..4e5ec3b0908ff6b9ba160a37e574a89f6c3b46a2 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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.  */
index 137246f96103db0aa6c93031ca0e745beb88da39..cb8fbcd3d2c4627e860f559c136b4a412da9414c 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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>
 
index a1f2accfaa457ad38a7abc1caa28131d6f24cc4a..434b24e92633f7a269d4a603ef75e7b587288db0 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    void *ss_sp;               /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    void *ss_sp;
-    int ss_flags;
-    size_t ss_size;
-  } stack_t;
-
-/* Possible values for `ss_flags'.  */
-enum
-{
-  SS_ONSTACK = 1,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minimum stack size for a signal handler.  */
 #define MINSIGSTKSZ    5120
 
index 536404dd710125f076588dd531eb5cf18607d571..1a5fa29ce8aa6bf1101d6fafff2c7ee0ae489eac 100644 (file)
@@ -28,6 +28,9 @@
    by <signal.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>
index bba02126b15d27ce4fc55bc22323219ce6a6379a..9a30c9d9d5bf5f9d5aa0b0397798c100a2d779e8 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    __ptr_t ss_sp;             /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    __ptr_t ss_sp;
-    int ss_flags;
-    size_t ss_size;
-  } stack_t;
-
-/* Possible values for `ss_flags'.  */
-enum
-{
-  SS_ONSTACK = 1,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minimum stack size for a signal handler.  */
 #define MINSIGSTKSZ    4096
 
index dc76e491905b2c6c30d741587751994a8c343eb9..912c61c841da61993a3719ae9ffdbcda5447372c 100644 (file)
@@ -25,6 +25,9 @@
    by <signal.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.  */
index aedeccdabef991686f24c99471974bb5c37fc6e5..8a5ea71a20549a71dd3de7e8a27a0953649da907 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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
index a0c3a9f50d50ced243b7483b220c9f8ad5682dc5..e6b6c7edcff271bfcb8a09f23fffd534915c2b56 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    void *ss_sp;               /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    void *ss_sp;
-    int ss_flags;
-    size_t ss_size;
-  } stack_t;
-
-/* Possible values for `ss_flags'.  */
-enum
-{
-  SS_ONSTACK = 1,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minimum stack size for a signal handler.  */
 #define MINSIGSTKSZ    2048
 
similarity index 59%
rename from sysdeps/unix/sysv/linux/mips/bits/sigstack.h
rename to sysdeps/unix/sysv/linux/bits/ss_flags.h
index 215f2ff459006e074c93e4ad4ba0c3819cc92955..497b613a8c9335fe5e32a8dccefd294432e8c695 100644 (file)
@@ -1,4 +1,4 @@
-/* sigstack, sigaltstack definitions.
+/* ss_flags values for stack_t.  Linux version.
    Copyright (C) 1998-2017 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
+   License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#ifndef _BITS_SIGSTACK_H
-#define _BITS_SIGSTACK_H 1
+#ifndef _BITS_SS_FLAGS_H
+#define _BITS_SS_FLAGS_H 1
 
 #if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    void *ss_sp;               /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    void *ss_sp;
-    size_t ss_size;
-    int ss_flags;
-  } stack_t;
-
 /* Possible values for `ss_flags'.  */
 enum
 {
@@ -50,10 +32,4 @@ enum
 #define SS_DISABLE     SS_DISABLE
 };
 
-/* Minimum stack size for a signal handler.  */
-#define MINSIGSTKSZ    2048
-
-/* System default stack size.  */
-#define SIGSTKSZ       8192
-
-#endif /* bits/sigstack.h */
+#endif /* bits/ss_flags.h */
diff --git a/sysdeps/unix/sysv/linux/bits/types/stack_t.h b/sysdeps/unix/sysv/linux/bits/types/stack_t.h
new file mode 100644 (file)
index 0000000..497e42b
--- /dev/null
@@ -0,0 +1,33 @@
+/* Define stack_t.  Linux version.
+   Copyright (C) 1998-2017 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef __stack_t_defined
+#define __stack_t_defined 1
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Structure describing a signal stack.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    int ss_flags;
+    size_t ss_size;
+  } stack_t;
+
+#endif
index 31eb77e01b634d9f55bc66cdc69ba64d3da71ae9..50e585d1632f290e60a482d1ea2523d3bd7dfe7f 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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
index c9a068957b6309284e4cef234643ba8a4926dedc..c81463d8096810a337a7b6abe4ba909bf2fd2994 100644 (file)
@@ -26,6 +26,9 @@
 #define __need_size_t
 #include <stddef.h>
 #include <bits/sigstack.h>
+#include <bits/types/struct_sigstack.h>
+#include <bits/types/stack_t.h>
+#include <bits/ss_flags.h>
 
 struct __ia64_fpreg
   {
index abae4c985e84af3c348980ca89259de61b95ac40..aabefbb1e3d7b20000003e38065714e88dbb879e 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    __ptr_t ss_sp;             /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    __ptr_t ss_sp;
-    int ss_flags;
-    size_t ss_size;
-  } stack_t;
-
-/* Possible values for `ss_flags'.  */
-enum
-{
-  SS_ONSTACK = 1,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minimum stack size for a signal handler.
 
    Yes, this should be 131072 but the constant got defined incorrectly
index b2dab0e29e0624b37d54c822479ae708c7e9219f..17474a55c7728eff96e1f3a9ee2ca7bf8a54911f 100644 (file)
@@ -25,6 +25,9 @@
    by <signal.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>
 
 
 /*
index 3c5dce5b73c4902ba5957f14728b0982b76cab17..18ff02233f7318e25dd3fc784f2b8768ace5cd25 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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.  */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h b/sysdeps/unix/sysv/linux/mips/bits/types/stack_t.h
new file mode 100644 (file)
index 0000000..ef06072
--- /dev/null
@@ -0,0 +1,33 @@
+/* Define stack_t.  MIPS Linux version.
+   Copyright (C) 1998-2017 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
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#ifndef __stack_t_defined
+#define __stack_t_defined 1
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Structure describing a signal stack.  */
+typedef struct sigaltstack
+  {
+    void *ss_sp;
+    size_t ss_size;
+    int ss_flags;
+  } stack_t;
+
+#endif
index f766dacd205f49a479f17b19df476a8103f55a2e..f933780dbe6fbbf31fecb263e6d1443a366653f5 100644 (file)
@@ -26,6 +26,9 @@
    by <signal.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>
 
index 3b0a615abe7a5c55d17833c29f991bc0c5bcf82a..c961e5be40cf8268fd8a724831cc0615421b0a51 100644 (file)
@@ -28,6 +28,9 @@
    by <signal.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.  */
index 4a36ad1a4e559c70c255dd5dda1bdfe14fd38cd0..74670cb037cdc3ecd9426c783397e57de340d7e2 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    void *ss_sp;               /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    void *ss_sp;
-    int ss_flags;
-    size_t ss_size;
-  } stack_t;
-
-/* Possible values for `ss_flags'.  */
-enum
-{
-  SS_ONSTACK = 1,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minimum stack size for a signal handler.  */
 #define MINSIGSTKSZ    4096
 
index c3f9622e354981dff7a133f448aa8591b23203cb..d9fad4cf8b81926f3c6df8e71464144af4cfa46a 100644 (file)
@@ -26,6 +26,9 @@
    by <signal.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>
 
 
 #if __WORDSIZE == 32
index 9790c0cd7c776bfb17a5493c6a0fed7d5a9f0bf9..955a8fef9cd7bdd5cdeec885c3a2c5ecaa488553 100644 (file)
@@ -26,6 +26,9 @@
    by in <signal.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.  */
index 5c6a5e4a7ad2af7ac5a4b036924c1431a2042f3a..3ce381d2c62ef6c67770e470fedeac7dfa413fe8 100644 (file)
@@ -27,6 +27,9 @@
    by <signal.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;
index 4a36ad1a4e559c70c255dd5dda1bdfe14fd38cd0..74670cb037cdc3ecd9426c783397e57de340d7e2 100644 (file)
 # error "Never include this file directly.  Use <signal.h> instead"
 #endif
 
-#define __need_size_t
-#include <stddef.h>
-
-/* Structure describing a signal stack (obsolete).  */
-struct sigstack
-  {
-    void *ss_sp;               /* Signal stack pointer.  */
-    int ss_onstack;            /* Nonzero if executing on this stack.  */
-  };
-
-/* Alternate, preferred interface.  */
-typedef struct sigaltstack
-  {
-    void *ss_sp;
-    int ss_flags;
-    size_t ss_size;
-  } stack_t;
-
-/* Possible values for `ss_flags'.  */
-enum
-{
-  SS_ONSTACK = 1,
-#define SS_ONSTACK     SS_ONSTACK
-  SS_DISABLE
-#define SS_DISABLE     SS_DISABLE
-};
-
 /* Minimum stack size for a signal handler.  */
 #define MINSIGSTKSZ    4096
 
index b8f3ca769e3c8f67c419cad49a8264845d945292..0d6cbe6e6b5faaa2456e8112930015febf61e595 100644 (file)
@@ -25,6 +25,9 @@
    by <signal.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>
 
index 95e6dd68f5dedb3613dbcaff5d6914ca9ad5bed2..8fc2f13834c2e23282ffc7ca0f48cba8aee82ffa 100644 (file)
@@ -26,6 +26,9 @@
    by <signal.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. */
index 6dad48fb2c1a4d4db773cd62a52914f462831649..5dd72acf4867bae76c0cebc0ea12122a5af0af03 100644 (file)
@@ -25,6 +25,9 @@
    by <signal.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__