Let's take a quick look at how you fill in the struct sigevent structure.
Regardless of the notification scheme you choose, you'll need to fill in a struct sigevent structure:
struct sigevent { int sigev_notify; union { int sigev_signo; int sigev_coid; int sigev_id; void (*sigev_notify_function) (union sigval); }; union sigval sigev_value; union { struct { short sigev_code; short sigev_priority; }; pthread_attr_t *sigev_notify_attributes; }; };
The first field you have to fill in is the sigev_notify member. This determines the notification type you've selected:
Since we're going to be using the struct sigevent with timers, we're concerned only with the SIGEV_PULSE, SIGEV_SIGNAL* and SIGEV_THREAD values for sigev_notify; we'll see the other types as mentioned in the list above.