summaryrefslogtreecommitdiffstats
path: root/sys/sys/ucontext.h
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>1999-10-04 19:33:58 +0000
committermarcel <marcel@FreeBSD.org>1999-10-04 19:33:58 +0000
commit05e89da65f3f17ac5d45847a1070dff333d05e7a (patch)
tree5374ca102220e75048c919ed852c428f9646cddf /sys/sys/ucontext.h
parent77802960193ff746b91be4aae32ed2a9ed8b5090 (diff)
downloadFreeBSD-src-05e89da65f3f17ac5d45847a1070dff333d05e7a.zip
FreeBSD-src-05e89da65f3f17ac5d45847a1070dff333d05e7a.tar.gz
Re-introduction of sigcontext.
struct sigcontext and ucontext_t/mcontext_t are defined in such a way that both (ie struct sigcontext and ucontext_t) can be passed on to sigreturn. The signal handler is still given a ucontext_t for maximum flexibility. For backward compatibility sigreturn restores the state for the alternate signal stack from sigcontext.sc_onstack and not from ucontext_t.uc_stack. A good way to determine which value the application has set and thus which value to use, is still open for discussion. NOTE: This change should only affect those binaries that use sigcontext and/or ucontext_t. In the source tree itself this is only doscmd. Recompilation is required for those applications. This commit also fixes a lot of style bugs without hopefully adding new ones. NOTE: struct sigaltstack.ss_size now has type size_t again. For some reason I changed that into unsigned int. Parts submitted by: bde sigaltstack bug found by: bde
Diffstat (limited to 'sys/sys/ucontext.h')
-rw-r--r--sys/sys/ucontext.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/sys/sys/ucontext.h b/sys/sys/ucontext.h
index fda8bcd..b28c685 100644
--- a/sys/sys/ucontext.h
+++ b/sys/sys/ucontext.h
@@ -29,16 +29,25 @@
*/
#ifndef _SYS_UCONTEXT_H_
-#define _SYS_UCONTEXT_H_ 1
+#define _SYS_UCONTEXT_H_
#include <machine/ucontext.h>
typedef struct __ucontext {
- struct __ucontext *uc_link;
- stack_t uc_stack;
- sigset_t uc_sigmask;
- mcontext_t uc_mcontext;
- int __spare__[8];
+ /*
+ * Keep the order of the first three fields. Also,
+ * keep them the first to fields in the structure.
+ * This way we can have a union with struct
+ * sigcontext and ucontext_t. This allows us to
+ * support them both at the same time.
+ * note: the union is not defined, though.
+ */
+ sigset_t uc_sigmask;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+
+ struct __ucontext_t *uc_link;
+ int __spare__[8];
} ucontext_t;
-#endif /* _SYS_UCONTEXT_H_ */
+#endif /* !_SYS_UCONTEXT_H_ */
OpenPOWER on IntegriCloud