The sigwaitinfo and the sigtimedwait system calls

The sigwaitinfo(2) system call is similar to sigwait: provided with a set of signals to watch out for, the function puts the caller to sleep until any one of those signals (in set) are pending. Here are their prototypes:

#include <signal.h>int sigwaitinfo(const sigset_t *set, siginfo_t *info);int sigtimedwait(const sigset_t *set, siginfo_t *info,    const struct timespec *timeout);

In terms of a return, the sigwait API was able to provide us with the signal number of the signal that got delivered to the calling process. However, recall that there is a much more powerful feature of the sigaction(2) API—the ability to return valuable diagnostic and other information within the siginfo_t data structure. ...

Get Hands-On System Programming with Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.