diff --git a/include/signal.h b/include/signal.h index 39718d7963..d2765a07f1 100644 --- a/include/signal.h +++ b/include/signal.h @@ -337,19 +337,33 @@ union sigval typedef CODE void (*sigev_notify_function_t)(union sigval value); -struct sigevent +typedef struct sigevent { uint8_t sigev_notify; /* Notification method: SIGEV_SIGNAL, SIGEV_NONE, or SIGEV_THREAD */ uint8_t sigev_signo; /* Notification signal */ union sigval sigev_value; /* Data passed with notification */ + union + { #ifdef CONFIG_SIG_EVTHREAD - sigev_notify_function_t sigev_notify_function; /* Notification function */ - FAR struct pthread_attr_s *sigev_notify_attributes; /* Notification attributes (not used) */ -#endif + struct + { + /* Notification function */ - pid_t sigev_notify_thread_id; /* ID of thread to signal */ -}; + sigev_notify_function_t _function; + + /* Notification attributes (not used) */ + + FAR struct pthread_attr_s *_attribute; + } _sigev_thread; +#endif + pid_t _tid; /* ID of thread to signal */ + } _sigev_un; +} sigevent_t; + +#define sigev_notify_function _sigev_un._sigev_thread._function +#define sigev_notify_attributes _sigev_un._sigev_thread._attribute +#define sigev_notify_thread_id _sigev_un._tid /* The following types is used to pass parameters to/from signal handlers */