Pending Signals


The following program takes one argument: the number of seconds to count down. The program then blocks the SIGINT signal, performs the count down, and then unblocks SIGINT. Before unblocking, the program prints whether there is a pending SIGINT signal that will be delivered once the signal is unblocked.

The program demonstrates the following system and library calls:

sigemptyset
Clear a sigset_t
sigaddset
Add a signal to a sigset_t
sigismember
Test if a signal is a member of a sigset_t
sigprocmask
Examin and change blocked signals
sigpending
Examine pending signals
strsignal
Return string describing a signal
getpid
Get process identification
pending.c