In questo caso è possibile una situazione in cui i segnali possono essere
perduti; si consideri il seguente segmento di codice in cui la prima
operazione del manipolatore è quella di reinstallare se stesso:
-\begin{lstlisting}{showlines=false}
-
+\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
int sig_handler(); /* handler function */
...
signal(SIGINT, sig_handler); /* establish handler */
processo l'occorrenza del segnale. Si consideri il seguente segmento di
codice il cui scopo sarebbe quello di fermare il processo fino all'occorrenza
di un opportuno segnale:
-\begin{lstlisting}{}
+\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
int signal_flag = 0;
main ()
{
In \ntab\ si è riportato l'elenco completo dei segnali definiti in Linux
(estratto dalle man page), comparati con quelli definiti in vari standard.
\begin{table}[htb]
+ \footnotesize
\centering
\begin{tabular}[c]{|l|c|c|c||c|p{8cm}|}
\hline
SIGTSTP &$\bullet$&&$\bullet$& D & Stop typed at tty \\
SIGTTIN &$\bullet$&&$\bullet$& D & tty input for background process \\
SIGTTOU &$\bullet$&&$\bullet$& D & tty output for background process \\
- SIGBUS &&$\bullet$&$\bullet$& C & Bus error (bad memory access) \\
- SIGPOLL &&$\bullet$&$\bullet$& A & Pollable event (Sys V). Synonym of SIGIO\\
+ SIGBUS &&$\bullet$&$\bullet$& C & Bus error (bad memory access) \\
+ SIGPOLL &&$\bullet$&$\bullet$& A & Pollable event (Sys V). Synonym of SIGIO\\
SIGPROF &&$\bullet$&$\bullet$& A & Profiling timer expired \\
SIGSYS &&$\bullet$&$\bullet$& C & Bad argument to routine (SVID)\\
SIGTRAP &&$\bullet$&$\bullet$& C & Trace/breakpoint trap \\