Tutorial by Examples

Using alarm, user can schedule SIGALARM signal to be raised after specified interval. In case user did not blocked, ignored or specified explicit signal handler for this signal, the default action for this signal will be performed on arrival. Per specification default action for SIGALARM is to termi...
In order for a program to react to a certain signal, other than using default action, custom signal handler can be installed using sigaction. sigaction receives three arguments - signal to act on, pointer to sigaction_t structure which, if not NULL, is describing new behaviour and pointer to sigacti...
A process can (try to) send a signal to any other process using the kill() function. To do so, the sending process needs to known the receiving process' PID. As, without introducing a race, a process can only be sure of its own PID (and the PIDs of its children) the most simple example to demonstra...
When write() is called for a named or unnamed pipe or stream socket whose reading end is closed, two things happen: POSIX.1-2001 SIGPIPE signal is sent to the process that called write() POSIX.1-2004 SIGPIPE signal is sent to the thread that called write() EPIPE error is returned ...

Page 1 of 1