aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/signal.h
diff options
context:
space:
mode:
authorEd Schouten <ed@FreeBSD.org>2016-05-31 19:05:41 +0000
committerEd Schouten <ed@FreeBSD.org>2016-05-31 19:05:41 +0000
commit08c8d10cf34b0b4a2ce3317ad0b00c4310116db1 (patch)
treee21f2c68a54ba38ea2af492d9c0ecad7bed112cc /sys/sys/signal.h
parente0db04b3dee196337fb8701c5aaf89734f502f48 (diff)
downloadsrc-08c8d10cf34b0b4a2ce3317ad0b00c4310116db1.tar.gz
src-08c8d10cf34b0b4a2ce3317ad0b00c4310116db1.zip
Improve POSIX conformance of <signal.h>.
- This header file has always depended on pthread_t, pthread_attr_t, struct timespec, size_t and uid_t. Only as of POSIX 2008, these dependencies have been states explicitly. They should now be defined. - In our implementation, struct sigevent::sigev_notify_attributes has type "void *" instead of "pthread_attr_t *". My guess is that this was done to prevent pulling in the pthread types, but this can easily be avoided by using the underlying structure types.
Notes
Notes: svn path=/head/; revision=301071
Diffstat (limited to 'sys/sys/signal.h')
-rw-r--r--sys/sys/signal.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index ab8fcf48647a..86a07e167c86 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -45,6 +45,23 @@
#include <machine/_limits.h> /* __MINSIGSTKSZ */
#include <machine/signal.h> /* sig_atomic_t; trap codes; sigcontext */
+#if __POSIX_VISIBLE >= 200809
+
+#include <sys/_pthreadtypes.h>
+#include <sys/_timespec.h>
+
+#ifndef _SIZE_T_DECLARED
+typedef __size_t size_t;
+#define _SIZE_T_DECLARED
+#endif
+
+#ifndef _UID_T_DECLARED
+typedef __uid_t uid_t;
+#define _UID_T_DECLARED
+#endif
+
+#endif /* __POSIX_VISIBLE >= 200809 */
+
/*
* System defined signals.
*/
@@ -160,6 +177,9 @@ union sigval {
#endif
#if __POSIX_VISIBLE >= 199309
+
+struct pthread_attr;
+
struct sigevent {
int sigev_notify; /* Notification type */
int sigev_signo; /* Signal number */
@@ -168,7 +188,7 @@ struct sigevent {
__lwpid_t _threadid;
struct {
void (*_function)(union sigval);
- void *_attribute; /* pthread_attr_t * */
+ struct pthread_attr **_attribute;
} _sigev_thread;
unsigned short _kevent_flags;
long __spare__[8];
@@ -190,6 +210,7 @@ struct sigevent {
#define SIGEV_KEVENT 3 /* Generate a kevent. */
#define SIGEV_THREAD_ID 4 /* Send signal to a kernel thread. */
#endif
+
#endif /* __POSIX_VISIBLE >= 199309 */
#if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE