Skip to content

Commit

Permalink
signal: Make struct sigevent compatible with glibc
Browse files Browse the repository at this point in the history
This patch added compatible struct sigevent definition with glibc.

Signed-off-by: ouyangxiangzhen <[email protected]>
  • Loading branch information
Fix-Point authored and xiaoxiang781216 committed Sep 17, 2024
1 parent 5a01f0f commit 5975cc9
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions include/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) */
struct
{
/* Notification function */

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;

pid_t sigev_notify_thread_id; /* ID of thread to signal */
};
#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 */

Expand Down

0 comments on commit 5975cc9

Please sign in to comment.