diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-10-30 02:12:49 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-10-30 02:12:49 +0000 |
commit | a27888aa88617c03fa8acc2f08bd1088b522b4e3 (patch) | |
tree | 09f966509a2a1a97712bab71d4b04e8aa24b07e2 /sys/sys/signal.h | |
parent | 45548c80dfecacc27ec58acc52a4c590d87eda77 (diff) | |
download | FreeBSD-src-a27888aa88617c03fa8acc2f08bd1088b522b4e3.zip FreeBSD-src-a27888aa88617c03fa8acc2f08bd1088b522b4e3.tar.gz |
Fix sigevent's POSIX incompatible problem by adding member fields
sigev_notify_function and sigev_notify_attributes. AIO syscalls
use sigevent, so they have to be adjusted.
Reviewed by: alc
Diffstat (limited to 'sys/sys/signal.h')
-rw-r--r-- | sys/sys/signal.h | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h index 7e273e3..d6dc895 100644 --- a/sys/sys/signal.h +++ b/sys/sys/signal.h @@ -158,28 +158,31 @@ union sigval { #if __POSIX_VISIBLE >= 199309 struct sigevent { int sigev_notify; /* Notification type */ - union { - int __sigev_signo; /* Signal number */ - int __sigev_notify_kqueue; - } __sigev_u; + int sigev_signo; /* Signal number */ union sigval sigev_value; /* Signal value */ -/* - * XXX missing sigev_notify_function, sigev_notify_attributes. - */ + union { + __lwpid_t _threadid; + struct { + void (*_function)(union sigval *); + void *_attribute; /* pthread_attr_t * */ + } _sigev_thread; + } _sigev_un; }; -#define sigev_signo __sigev_u.__sigev_signo + #if __BSD_VISIBLE -#define sigev_notify_kqueue __sigev_u.__sigev_notify_kqueue +#define sigev_notify_kqueue sigev_signo +#define sigev_notify_thread_id _sigev_un._threadid #endif +#define sigev_notify_function _sigev_un._sigev_thread._function +#define sigev_notify_attributes _sigev_un._sigev_thread._attribute -#define SIGEV_NONE 0 /* No async notification */ -#define SIGEV_SIGNAL 1 /* Generate a queued signal */ +#define SIGEV_NONE 0 /* No async notification. */ +#define SIGEV_SIGNAL 1 /* Generate a queued signal. */ +#define SIGEV_THREAD 2 /* Call back from another pthread. */ #if __BSD_VISIBLE -#define SIGEV_KEVENT 3 /* Generate a kevent */ +#define SIGEV_KEVENT 3 /* Generate a kevent. */ +#define SIGEV_THREAD_ID 4 /* Send signal to a kernel thread. */ #endif -/* - * XXX missing SIGEV_THREAD. - */ #endif /* __POSIX_VISIBLE >= 199309 */ #if __POSIX_VISIBLE >= 199309 || __XSI_VISIBLE |