1 #ifndef _SYS_SIGTYPES_H_
2 #define _SYS_SIGTYPES_H_
5 * This header file defines various signal-related types. We also keep
6 * the macros to manipulate sigset_t here, to encapsulate knowledge of
10 #include <sys/featuretest.h>
11 #include <machine/int_types.h>
12 #include <machine/ansi.h>
15 typedef _BSD_SIZE_T_
size_t;
19 #if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \
20 defined(_NETBSD_SOURCE)
21 typedef unsigned long sigset_t
;
24 * Macro for manipulating signal masks.
27 #define __sigmask(n) (1 << (((unsigned int)(n) - 1)))
29 #define __sigmask(n) (1 << (unsigned int)(n))
31 #define __sigaddset(s, n) \
33 *(s) = *(unsigned long *)(s) | __sigmask(n); \
35 #define __sigdelset(s, n) \
37 *(s) = *(unsigned long *)(s) & ~__sigmask(n); \
40 #define __sigismember(s, n) (((*(const unsigned long *)(s)) & __sigmask(n)) != 0)
41 #define __sigemptyset(s) (*(unsigned long *)(s) = 0)
42 #define __sigsetequal(s1, s2) (*(unsigned long *)(s1) = *(unsigned long *)(s2))
43 #define __sigfillset(s) (*(long *)(s) = -1L)
44 #define __sigplusset(s, t) \
46 *(t) = *(unsigned long *)(t) | *(unsigned long *)(s); \
48 #define __sigminusset(s, t) \
50 *(t) = *(unsigned long *)(t) & ~*(unsigned long *)(s); \
52 #define __sigandset(s, t) \
54 *(t) = *(unsigned long *)(t) & *(unsigned long *)(s); \
57 #if (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED)) || \
58 (_XOPEN_SOURCE - 0) >= 500 || defined(_NETBSD_SOURCE)
60 #if defined(_NETBSD_SOURCE)
62 #endif /* _NETBSD_SOURCE */
64 void *ss_sp
; /* signal stack base */
65 size_t ss_size
; /* signal stack length */
66 int ss_flags
; /* SS_DISABLE and/or SS_ONSTACK */
69 #endif /* _XOPEN_SOURCE_EXTENDED || XOPEN_SOURCE >= 500 || _NETBSD_SOURCE */
71 #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || ... */
72 #endif /* !_SYS_SIGTYPES_H_ */