Could anyone please explain in a really easy way to understand what sigemptyset() does? Why is it useful? I\'ve read a bunch of definitions but i just don\'t understand. Fro
The name says it all. sigemptyset()
empties (a variable describing) a set of signals.
That is
sigset_t ss;
sigemptyset(&ss);
initialises a variable of type sigset_t
(ss
here) to "contain" no signals.
From man sigemptyset (Linux):
sigemptyset() initializes the signal set given by set to empty, with all signals excluded from the set.
[...]
Objects of type sigset_t must be initialized by a call to either sigemptyset() or sigfillset() before being passed to the functions sigaddset(), sigdelset() and sigismember() [...]
From the POSIX specs:
int sigemptyset(sigset_t *set);
[...]
The sigemptyset() function initializes the signal set pointed to by set, such that all signals defined in POSIX.1-2008 are excluded.