aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/signal.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-02-12 07:38:19 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-02-12 07:38:19 +0000
commit90edf67ecf94bce51e6c823ee2a10a7b65f416f8 (patch)
tree783f901008bac7a377fe9c52843c1f80c9e84512 /sys/sys/signal.h
parent411c83ccd691eec84686df54c5cc7ee3cdbeb265 (diff)
downloadsrc-90edf67ecf94bce51e6c823ee2a10a7b65f416f8.tar.gz
src-90edf67ecf94bce51e6c823ee2a10a7b65f416f8.zip
POSIX states that #include <signal.h> shall make both mcontext_t and
ucontext_t available. Our code even has XXX comment about this. Add a bit of compliance by moving struct __ucontext definition into sys/_ucontext.h and including it into signal.h and sys/ucontext.h. Several machine/ucontext.h headers were changed to use namespace-safe types (like uint64_t->__uint64_t) to not depend on sys/types.h. struct __stack_t from sys/signal.h is made always visible in private namespace to satisfy sys/_ucontext.h requirements. Apparently mips _types.h pollutes global namespace with f_register_t type definition. This commit does not try to fix the issue. PR: 207079 Reported and tested by: Ting-Wei Lan <lantw44@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=295561
Diffstat (limited to 'sys/sys/signal.h')
-rw-r--r--sys/sys/signal.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 259c39aed4f9..ab8fcf48647a 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -354,18 +354,10 @@ typedef void __siginfohandler_t(int, struct __siginfo *, void *);
#endif
#if __XSI_VISIBLE
-/*
- * Structure used in sigaltstack call.
- */
#if __BSD_VISIBLE
-typedef struct sigaltstack {
-#else
-typedef struct {
+#define __stack_t sigaltstack
#endif
- void *ss_sp; /* signal stack base */
- __size_t ss_size; /* signal stack length */
- int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
-} stack_t;
+typedef struct __stack_t stack_t;
#define SS_ONSTACK 0x0001 /* take signal on alternate stack */
#define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */
@@ -373,6 +365,17 @@ typedef struct {
#define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */
#endif
+/*
+ * Structure used in sigaltstack call. Its definition is always
+ * needed for __ucontext. If __BSD_VISIBLE is defined, the structure
+ * tag is actually sigaltstack.
+ */
+struct __stack_t {
+ void *ss_sp; /* signal stack base */
+ __size_t ss_size; /* signal stack length */
+ int ss_flags; /* SS_DISABLE and/or SS_ONSTACK */
+};
+
#if __BSD_VISIBLE
/*
* 4.3 compatibility: