X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=signal.tex;h=15a9412ff7249cdc7118ae2459f1c5b433c0e5c1;hp=d8468d8e8b5d209c47287c0ed64d43c6f18cf8a2;hb=2270251f0f94d61ec0eaf6e32291854d1834f282;hpb=f226d67a85c76d482da1f06f2c34c6231dfb5312 diff --git a/signal.tex b/signal.tex index d8468d8..15a9412 100644 --- a/signal.tex +++ b/signal.tex @@ -59,8 +59,7 @@ in cui si vuole che il signal handler esterno resti attivo. 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 */ @@ -92,7 +91,7 @@ quello in cui si usa il manipolatore per settare un flag che riporta al 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 () { @@ -279,6 +278,7 @@ anche al successivo del valore numerico assegnato all'ultimo segnale definito. 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 @@ -305,8 +305,8 @@ In \ntab\ si 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 \\ @@ -586,10 +586,16 @@ resto del sistema. L'azione di default di questi segnali è di terminare il processo, questi segnali sono: \begin{description} -\item \texttt{SIGPIPE} -\item \texttt{SIGLOST} -\item \texttt{SIGXCPU} -\item \texttt{SIGXFSZ} +\item \texttt{SIGPIPE} Sta per \textit{Broken pipe}. Se si usano delle pipes o + delle FIFO è necessario che, prima che un processo inizi a scrivere su di + essa, un'altro abbia aperto la pipe in lettura (si veda + \secref{sec:ipc_pipes}). Se il processo in lettura non è partito o è + terminato inavvertitamente alla scrittura sulla pipe il kernel genera questo + segnale. Se il segnale è bloccato, intercettato o ignorato la chiamata che + lo ha causato fallisce restituendo l'errore \macro{EPIPE} +\item \texttt{SIGLOST} Sta per \textit{Resource lost}. +\item \texttt{SIGXCPU} Sta per \textit{CPU time limit exceeded}. +\item \texttt{SIGXFSZ} Sta per \textit{File size limit exceeded}. \end{description}