| 1 | #ifndef __sigevent_t_defined |
| 2 | #define __sigevent_t_defined 1 |
| 3 | |
| 4 | #include <bits/wordsize.h> |
| 5 | #include <bits/types.h> |
| 6 | #include <bits/types/__sigval_t.h> |
| 7 | |
| 8 | #define __SIGEV_MAX_SIZE 64 |
| 9 | #if __WORDSIZE == 64 |
| 10 | # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 4) |
| 11 | #else |
| 12 | # define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3) |
| 13 | #endif |
| 14 | |
| 15 | /* Forward declaration. */ |
| 16 | #ifndef __have_pthread_attr_t |
| 17 | typedef union pthread_attr_t pthread_attr_t; |
| 18 | # define __have_pthread_attr_t 1 |
| 19 | #endif |
| 20 | |
| 21 | /* Structure to transport application-defined values with signals. */ |
| 22 | typedef struct sigevent |
| 23 | { |
| 24 | __sigval_t sigev_value; |
| 25 | int sigev_signo; |
| 26 | int sigev_notify; |
| 27 | |
| 28 | union |
| 29 | { |
| 30 | int _pad[__SIGEV_PAD_SIZE]; |
| 31 | |
| 32 | /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the |
| 33 | thread to receive the signal. */ |
| 34 | __pid_t _tid; |
| 35 | |
| 36 | struct |
| 37 | { |
| 38 | void (*_function) (__sigval_t); /* Function to start. */ |
| 39 | pthread_attr_t *_attribute; /* Thread attributes. */ |
| 40 | } _sigev_thread; |
| 41 | } _sigev_un; |
| 42 | } sigevent_t; |
| 43 | |
| 44 | /* POSIX names to access some of the members. */ |
| 45 | #define sigev_notify_function _sigev_un._sigev_thread._function |
| 46 | #define sigev_notify_attributes _sigev_un._sigev_thread._attribute |
| 47 | |
| 48 | #endif |
| 49 | |