Altro lavoro di correzione. Passato alla nuova versione di listings.
authorSimone Piccardi <piccardi@gnulinux.it>
Thu, 3 Apr 2003 22:30:13 +0000 (22:30 +0000)
committerSimone Piccardi <piccardi@gnulinux.it>
Thu, 3 Apr 2003 22:30:13 +0000 (22:30 +0000)
13 files changed:
elemtcp.tex
fileadv.tex
filedir.tex
fileintro.tex
filestd.tex
gapil.tex
ipc.tex
process.tex
prochand.tex
session.tex
signal.tex
socket.tex
system.tex

index 6cf1129c91857f2cc05c01db1d79ce6d1767a04f..efd8a05810496e08f9d12053cdf117608bab15b9 100644 (file)
@@ -701,8 +701,8 @@ Per specificare un indirizzo generico con IPv4 si usa il valore
 è pari a zero, nell'esempio \figref{fig:net_serv_code} si è usata
 un'assegnazione immediata del tipo:
 
 è pari a zero, nell'esempio \figref{fig:net_serv_code} si è usata
 un'assegnazione immediata del tipo:
 
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-serv_add.sin_addr.s_addr = htonl(INADDR_ANY);   /* connect from anywhere */
+\begin{lstlisting}[stepnumber=0,frame=]{}
+    serv_add.sin_addr.s_addr = htonl(INADDR_ANY);   /* connect from anywhere */
 \end{lstlisting}
 
 Si noti che si è usato \func{htonl} per assegnare il valore
 \end{lstlisting}
 
 Si noti che si è usato \func{htonl} per assegnare il valore
@@ -741,8 +741,8 @@ Per questo motivo nell'header \file{netinet/in.h} 
 \const{in6addr\_any} (dichiarata come \direct{extern}, ed inizializzata dal
 sistema al valore \const{IN6ADRR\_ANY\_INIT}) che permette di effettuare una
 assegnazione del tipo:
 \const{in6addr\_any} (dichiarata come \direct{extern}, ed inizializzata dal
 sistema al valore \const{IN6ADRR\_ANY\_INIT}) che permette di effettuare una
 assegnazione del tipo:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-serv_add.sin6_addr = in6addr_any;   /* connect from anywhere */
+\begin{lstlisting}[stepnumber=0,frame=]{}
+    serv_add.sin6_addr = in6addr_any;   /* connect from anywhere */
 \end{lstlisting}
 in maniera analoga si può utilizzare la variabile \const{in6addr\_loopback}
 per indicare l'indirizzo di \textit{loopback}, che a sua volta viene
 \end{lstlisting}
 in maniera analoga si può utilizzare la variabile \const{in6addr\_loopback}
 per indicare l'indirizzo di \textit{loopback}, che a sua volta viene
index 5203d17744dea60987154e798317d27c9a4391af..9980d895a06ce42c75840ee22a1aff8f3f75dd21 100644 (file)
@@ -211,7 +211,7 @@ negativo indica un'attesa indefinita).
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct pollfd {
         int fd;           /* file descriptor */
         short events;     /* requested events */
 struct pollfd {
         int fd;           /* file descriptor */
         short events;     /* requested events */
@@ -421,7 +421,7 @@ disponibilit
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct aiocb
 {
     int aio_fildes;               /* File descriptor.  */
 struct aiocb
 {
     int aio_fildes;               /* File descriptor.  */
@@ -471,7 +471,7 @@ esse.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sigevent
 {
     sigval_t sigev_value;
 struct sigevent
 {
     sigval_t sigev_value;
@@ -818,7 +818,7 @@ il secondo, \var{iov\_len}, la dimensione dello stesso.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct iovec {
     __ptr_t iov_base;    /* Starting address */
     size_t iov_len;      /* Length in bytes  */
 struct iovec {
     __ptr_t iov_base;    /* Starting address */
     size_t iov_len;      /* Length in bytes  */
@@ -1512,12 +1512,12 @@ regione bloccata.
 \begin{figure}[!bht]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!bht]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct flock {
     short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
 struct flock {
     short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
-    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
+    short int l_whence; /* Where `l_start' is relative to (like `lseek').*/
     off_t l_start;      /* Offset where the lock begins.  */
     off_t l_start;      /* Offset where the lock begins.  */
-    off_t l_len;        /* Size of the locked area; zero means until EOF.  */
+    off_t l_len;        /* Size of the locked area; zero means until EOF.*/
     pid_t l_pid;        /* Process holding the lock.  */
 };
     \end{lstlisting}
     pid_t l_pid;        /* Process holding the lock.  */
 };
     \end{lstlisting}
index 191179b3a8468963c93575350a8dbdb5a6e17b40..b5a19109890e7f5ca02842cd6f89462e9f7c1583 100644 (file)
@@ -787,7 +787,7 @@ inode cui il file 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct dirent {
     ino_t d_ino;                    /* inode number */
     off_t d_off;                    /* offset to the next dirent */
 struct dirent {
     ino_t d_ino;                    /* inode number */
     off_t d_off;                    /* offset to the next dirent */
@@ -1434,7 +1434,7 @@ riservati per estensioni come tempi pi
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct stat {
     dev_t         st_dev;      /* device */
     ino_t         st_ino;      /* inode */
 struct stat {
     dev_t         st_dev;      /* device */
     ino_t         st_ino;      /* inode */
@@ -1555,7 +1555,7 @@ un'opportuna combinazione.
 Ad esempio se si volesse impostare una condizione che permetta di controllare
 se un file è una directory o un file ordinario si potrebbe definire la macro
 di preprocessore:
 Ad esempio se si volesse impostare una condizione che permetta di controllare
 se un file è una directory o un file ordinario si potrebbe definire la macro
 di preprocessore:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
 #define IS_FILE_DIR(x) (((x) & S_IFMT) & (S_IFDIR | S_IFREG))
 \end{lstlisting}
 in cui prima si estraggono da \var{st\_mode} i bit relativi al tipo di file e
 #define IS_FILE_DIR(x) (((x) & S_IFMT) & (S_IFDIR | S_IFREG))
 \end{lstlisting}
 in cui prima si estraggono da \var{st\_mode} i bit relativi al tipo di file e
@@ -1808,7 +1808,7 @@ valori che si vogliono impostare per tempi.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct utimbuf {
         time_t actime;  /* access time */
         time_t modtime; /* modification time */
 struct utimbuf {
         time_t actime;  /* access time */
         time_t modtime; /* modification time */
index bb3ab7ea075248ab0d0703e55913abc0834f95d8..f780bfe377147e48437adb3ddd45d9a9020e59cb 100644 (file)
@@ -409,7 +409,7 @@ Il VFS usa una tabella mantenuta dal kernel che contiene il nome di ciascun
 filesystem supportato: quando si vuole inserire il supporto di un nuovo
 filesystem tutto quello che occorre è chiamare la funzione
 \code{register\_filesystem} passandole un'apposita struttura
 filesystem supportato: quando si vuole inserire il supporto di un nuovo
 filesystem tutto quello che occorre è chiamare la funzione
 \code{register\_filesystem} passandole un'apposita struttura
-(\struct{file\_system\_type}) che contiene i dettagli per il riferimento
+\code{file\_system\_type} che contiene i dettagli per il riferimento
 all'implementazione del medesimo, che sarà aggiunta alla citata tabella.
 
 In questo modo quando viene effettuata la richiesta di montare un nuovo disco
 all'implementazione del medesimo, che sarà aggiunta alla citata tabella.
 
 In questo modo quando viene effettuata la richiesta di montare un nuovo disco
index c8ae3c22d0aac2a62eb934f0773377ee74bfe1a5..d69d7d42172d8ac3408681e8f1ec5eef98822cc6 100644 (file)
@@ -117,7 +117,7 @@ Nelle \acr{glibc} \var{stdin}, \var{stdout} e \var{stderr} sono
 effettivamente tre variabili di tipo \ctyp{FILE *} che possono essere
 usate come tutte le altre, ad esempio si può effettuare una redirezione
 dell'output di un programma con il semplice codice:
 effettivamente tre variabili di tipo \ctyp{FILE *} che possono essere
 usate come tutte le altre, ad esempio si può effettuare una redirezione
 dell'output di un programma con il semplice codice:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
     fclose(stdout);
     stdout = fopen("standard-output-file", "w");
 \end{lstlisting}
     fclose(stdout);
     stdout = fopen("standard-output-file", "w");
 \end{lstlisting}
@@ -488,7 +488,7 @@ blocchi di dati binari in maniera compatta e veloce; un primo caso di uso
 tipico è quello in cui si salva un vettore (o un certo numero dei suoi
 elementi) con una chiamata del tipo:
 %\footnotesize
 tipico è quello in cui si salva un vettore (o un certo numero dei suoi
 elementi) con una chiamata del tipo:
 %\footnotesize
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
 int WriteVect(FILE *stream, double *vec, size_t nelem) 
 {
     int size, nread;
 int WriteVect(FILE *stream, double *vec, size_t nelem) 
 {
     int size, nread;
@@ -505,7 +505,7 @@ elemento ed il numero di quelli che si vogliono scrivere. Un secondo
 caso è invece quello in cui si vuole trasferire su file una struttura;
 si avrà allora una chiamata tipo:
 %\footnotesize
 caso è invece quello in cui si vuole trasferire su file una struttura;
 si avrà allora una chiamata tipo:
 %\footnotesize
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
 struct histogram {
     int nbins; 
     double max, min;
 struct histogram {
     int nbins; 
     double max, min;
@@ -906,7 +906,7 @@ e \var{*n} 
 necessaria a contenere la linea. In tutti i casi si ottiene dalla funzione un
 puntatore all'inizio del testo della linea letta. Un esempio di codice può
 essere il seguente:
 necessaria a contenere la linea. In tutti i casi si ottiene dalla funzione un
 puntatore all'inizio del testo della linea letta. Un esempio di codice può
 essere il seguente:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
     size_t n = 0; 
     char *ptr = NULL;
     int nread;
     size_t n = 0; 
     char *ptr = NULL;
     int nread;
index bc8621d96efc774a2e6e5e6542e13a4a3bb7734d..f26a9b8835f1b1bc6cd33ee0ad7a44d57c9bb92c 100644 (file)
--- a/gapil.tex
+++ b/gapil.tex
@@ -15,7 +15,8 @@
 %% gapil.tex: file principale, gli altri vanno inclusi da questo.
 %%
 \documentclass[a4paper,11pt,twoside]{book}
 %% gapil.tex: file principale, gli altri vanno inclusi da questo.
 %%
 \documentclass[a4paper,11pt,twoside]{book}
-%\usepackage[T1]{fontenc}
+\usepackage[T1]{fontenc}
+\usepackage{ae,aecompl}
 \usepackage[latin1]{inputenc}
 %\usepackage[tex4ht, bookmarks=true]{hyperref}
 \usepackage[bookmarks=true]{hyperref}
 \usepackage[latin1]{inputenc}
 %\usepackage[tex4ht, bookmarks=true]{hyperref}
 \usepackage[bookmarks=true]{hyperref}
 \usepackage{pst-node}
 \usepackage{graphicx}
 \usepackage[italian]{babel}
 \usepackage{pst-node}
 \usepackage{graphicx}
 \usepackage[italian]{babel}
-\newcommand{\mkinputlistingplain}[1]{\lstinputlisting[labelstep=0,frame=,indent=1cm]{#1}}{}
-\newcommand{\mkinputlistinglines}[1]{\lstinputlisting[labelstep=0]{#1}}{}
+%\newcommand{\mkinputlistingplain}[1]{\lstinputlisting[labelstep=0,frame=,indent=1cm]{#1}}{}
+%\newcommand{\mkinputlistinglines}[1]{\lstinputlisting[labelstep=0]{#1}}{}
+
+\newcommand{\includecodesnip}[1]{\lstinputlisting[stepnumber=0,frame=]{#1}}{}
+\newcommand{\includestruct}[1]{\lstinputlisting[labelstep=0]{#1}}{}
+\newcommand{\includecodesample}[1]{\lstinputlisting{#1}}{}
+
 \usepackage{cite}
 \usepackage{amsmath}
 \usepackage{amsfonts}
 \usepackage{cite}
 \usepackage{amsmath}
 \usepackage{amsfonts}
 \usepackage{multirow}
 %\usepackage{footnote} 
 %\usepackage{mdwtab} 
 \usepackage{multirow}
 %\usepackage{footnote} 
 %\usepackage{mdwtab} 
+
+\def\tild{\char'176}
+
+
 %
 % Setting page layout
 %
 %
 % Setting page layout
 %
 \lstset{language=C++} 
 
 \lstset{basicstyle=\small,
 \lstset{language=C++} 
 
 \lstset{basicstyle=\small,
-  labelstyle=\tiny,
-  labelstep=1,
-  labelsep=2pt, 
+  numbers=left,
+  numberstyle=\tiny,
+  stepnumber=1,
+  numbersep=2pt, 
   frame=TB,
   frame=TB,
-  frametextsep=5pt,
-  indent=0.3cm,
+  framesep=5pt,
+%  xleftmargin=0.3cm,
   basicstyle=\ttfamily,
   keywordstyle=\color{blue}\ttfamily,
   ndkeywordstyle=\color{yellow}\ttfamily,
   basicstyle=\ttfamily,
   keywordstyle=\color{blue}\ttfamily,
   ndkeywordstyle=\color{yellow}\ttfamily,
diff --git a/ipc.tex b/ipc.tex
index 7bd296fa6bc6c29a8018f0af51491c6d7c39d42f..e4c32b7bca1b8eaa53e26ab804fde1b6b1aeda6b 100644 (file)
--- a/ipc.tex
+++ b/ipc.tex
@@ -1002,7 +1002,7 @@ mantiene varie propriet
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm ]{}
+    \begin{lstlisting}[stepnumber=0]{}%,frame=,indent=1cm ]{}
 struct ipc_perm
 {
     key_t key;                        /* Key.  */
 struct ipc_perm
 {
     key_t key;                        /* Key.  */
@@ -1415,7 +1415,7 @@ kernel.\footnote{lo schema illustrato in \figref{fig:ipc_mq_schema} 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct msqid_ds {
     struct ipc_perm msg_perm;     /* structure for operation permission */
     time_t msg_stime;             /* time of last msgsnd command */
 struct msqid_ds {
     struct ipc_perm msg_perm;     /* structure for operation permission */
     time_t msg_stime;             /* time of last msgsnd command */
@@ -1595,7 +1595,7 @@ dovr
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
     struct msgbuf {
          long mtype;          /* message type, must be > 0 */
          char mtext[LENGTH];  /* message data */
     struct msgbuf {
          long mtype;          /* message type, must be > 0 */
          char mtext[LENGTH];  /* message data */
@@ -2087,7 +2087,7 @@ semaforo all'uscita del processo.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct semid_ds
 {
     struct ipc_perm sem_perm;           /* operation permission struct */
 struct semid_ds
 {
     struct ipc_perm sem_perm;           /* operation permission struct */
@@ -2137,7 +2137,7 @@ controllo.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sem {
   short   sempid;         /* pid of last operation */
   ushort  semval;         /* current value */
 struct sem {
   short   sempid;         /* pid of last operation */
   ushort  semval;         /* current value */
@@ -2234,7 +2234,7 @@ specificata con \param{cmd}, ed opera o sull'intero insieme specificato da
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 union semun {
       int val;                  /* value for SETVAL */
       struct semid_ds *buf;     /* buffer for IPC_STAT, IPC_SET */
 union semun {
       int val;                  /* value for SETVAL */
       struct semid_ds *buf;     /* buffer for IPC_STAT, IPC_SET */
@@ -2388,7 +2388,7 @@ effettivamente eseguite se e soltanto se 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sembuf
 {
   unsigned short int sem_num;   /* semaphore number */
 struct sembuf
 {
   unsigned short int sem_num;   /* semaphore number */
@@ -2749,7 +2749,7 @@ norma, significa insieme a dei semafori.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct shmid_ds {
      struct    ipc_perm shm_perm;  /* operation perms */
      int  shm_segsz;               /* size of segment (bytes) */
 struct shmid_ds {
      struct    ipc_perm shm_perm;  /* operation perms */
      int  shm_segsz;               /* size of segment (bytes) */
@@ -3924,7 +3924,7 @@ per
 Benedyczak,\footnote{i patch al kernel e la relativa libreria possono essere
 trovati su
 \href{http://www.mat.uni.torun.pl/~wrona/posix_ipc}
 Benedyczak,\footnote{i patch al kernel e la relativa libreria possono essere
 trovati su
 \href{http://www.mat.uni.torun.pl/~wrona/posix_ipc}
-{http://www.mat.uni.torun.pl/\~{}wrona/posix\_ipc}.}.
+{http://www.mat.uni.torun.pl/\tild{}wrona/posix\_ipc}.}.
 In generale, come le corrispettive del SysV IPC, le code di messaggi sono poco
 usate, dato che i socket\index{socket}, nei casi in cui sono sufficienti, sono
 più comodi, e che in casi più complessi la comunicazione può essere gestita
 In generale, come le corrispettive del SysV IPC, le code di messaggi sono poco
 usate, dato che i socket\index{socket}, nei casi in cui sono sufficienti, sono
 più comodi, e che in casi più complessi la comunicazione può essere gestita
@@ -4037,7 +4037,7 @@ struttura \struct{mq\_attr}, la cui definizione 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct mq_attr {
         long    mq_flags;       /* message queue flags                  */
         long    mq_maxmsg;      /* maximum number of messages           */
 struct mq_attr {
         long    mq_flags;       /* message queue flags                  */
         long    mq_maxmsg;      /* maximum number of messages           */
index b484b17501d8713af29616ad8fe1e6e0034ed41f..17c6e37d58a6537bb9a8185d78fded8f2f405c74 100644 (file)
@@ -59,9 +59,7 @@ si suppone iniziare l'esecuzione; in ogni caso senza questa funzione lo stesso
 Lo standard ISO C specifica che la funzione \func{main} può non avere 
 argomenti o prendere due argomenti che rappresentano gli argomenti passati da
 linea di comando, in sostanza un prototipo che va sempre bene è il seguente:
 Lo standard ISO C specifica che la funzione \func{main} può non avere 
 argomenti o prendere due argomenti che rappresentano gli argomenti passati da
 linea di comando, in sostanza un prototipo che va sempre bene è il seguente:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-    int main (int argc, char *argv[])
-\end{lstlisting}
+\includecodesnip{listati/main_def.c}
 
 In realtà nei sistemi Unix esiste un'altro modo per definire la funzione
 \func{main}, che prevede la presenza di un terzo parametro, \code{char
 
 In realtà nei sistemi Unix esiste un'altro modo per definire la funzione
 \func{main}, che prevede la presenza di un terzo parametro, \code{char
@@ -358,9 +356,7 @@ seguenti segmenti:
   La prima parte è il segmento dei dati inizializzati, che contiene le
   variabili il cui valore è stato assegnato esplicitamente. Ad esempio
   se si definisce:
   La prima parte è il segmento dei dati inizializzati, che contiene le
   variabili il cui valore è stato assegnato esplicitamente. Ad esempio
   se si definisce:
-  \begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-    double pi = 3.14;
-  \end{lstlisting}
+\includecodesnip{listati/pi.c}
   questo valore sarà immagazzinato in questo segmento. La memoria di questo
   segmento viene preallocata all'avvio del programma e inizializzata ai valori
   specificati.
   questo valore sarà immagazzinato in questo segmento. La memoria di questo
   segmento viene preallocata all'avvio del programma e inizializzata ai valori
   specificati.
@@ -368,9 +364,7 @@ seguenti segmenti:
   La seconda parte è il segmento dei dati non inizializzati, che contiene le
   variabili il cui valore non è stato assegnato esplicitamente. Ad esempio se
   si definisce:
   La seconda parte è il segmento dei dati non inizializzati, che contiene le
   variabili il cui valore non è stato assegnato esplicitamente. Ad esempio se
   si definisce:
-  \begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-    int vect[100];
-  \end{lstlisting}
+\includecodesnip{listati/vect.c}
   questo vettore sarà immagazzinato in questo segmento. Anch'esso viene
   allocato all'avvio, e tutte le variabili vengono inizializzate a zero (ed i
   puntatori a \val{NULL}).\footnote{si ricordi che questo vale solo per le
   questo vettore sarà immagazzinato in questo segmento. Anch'esso viene
   allocato all'avvio, e tutte le variabili vengono inizializzate a zero (ed i
   puntatori a \val{NULL}).\footnote{si ricordi che questo vale solo per le
@@ -961,37 +955,11 @@ ritornato il carattere \texttt{':'}, infine se viene incontrato il valore
 elementi di \param{argv} che cominciano con il carattere \texttt{'-'}.
 
 \begin{figure}[htb]
 elementi di \param{argv} che cominciano con il carattere \texttt{'-'}.
 
 \begin{figure}[htb]
-  \footnotesize
-    \begin{lstlisting}{}
-    opterr = 0;  /* don't want writing to stderr */
-    while ( (i = getopt(argc, argv, "hp:c:e:")) != -1) {
-        switch (i) {
-        /* 
-         * Handling options 
-         */ 
-        case 'h':   /* help option */
-            printf("Wrong -h option use\n");
-            usage();
-            return -1;
-            break;
-        case 'c':   /* take wait time for children */
-            wait_child = strtol(optarg, NULL, 10);    /* convert input */
-            break;
-        case 'p':   /* take wait time for children */
-            wait_parent = strtol(optarg, NULL, 10);   /* convert input */
-            break;
-        case 'e':   /* take wait before parent exit */
-            wait_end = strtol(optarg, NULL, 10);      /* convert input */
-            break;
-        case '?':   /* unrecognized options */
-            printf("Unrecognized options -%c\n",optopt);
-            usage();
-        default:    /* should not reached */
-            usage();
-        }
-    }
-    debug("Optind %d, argc %d\n",optind,argc);
-  \end{lstlisting}
+  \footnotesize \centering
+  \begin{minipage}[c]{15cm}
+  \includecodesample{listati/option_code.c}
+  \end{minipage}
+  \normalsize
   \caption{Esempio di codice per la gestione delle opzioni.}
   \label{fig:proc_options_code}
 \end{figure}
   \caption{Esempio di codice per la gestione delle opzioni.}
   \label{fig:proc_options_code}
 \end{figure}
@@ -1067,9 +1035,7 @@ terminata da un puntatore nullo.
 L'indirizzo della lista delle variabili di ambiente è passato attraverso la
 variabile globale \var{environ}, a cui si può accedere attraverso una semplice
 dichiarazione del tipo:
 L'indirizzo della lista delle variabili di ambiente è passato attraverso la
 variabile globale \var{environ}, a cui si può accedere attraverso una semplice
 dichiarazione del tipo:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-extern char ** environ;
-\end{lstlisting}
+\includecodesnip{listati/env_ptr.c}
 un esempio della struttura di questa lista, contenente alcune delle variabili
 più comuni che normalmente sono definite dal sistema, è riportato in
 \figref{fig:proc_envirno_list}.
 un esempio della struttura di questa lista, contenente alcune delle variabili
 più comuni che normalmente sono definite dal sistema, è riportato in
 \figref{fig:proc_envirno_list}.
@@ -1353,9 +1319,7 @@ abbia sempre almeno un argomento fisso; prima di effettuare la dichiarazione
 deve essere incluso l'apposito header file \file{stdarg.h}; un esempio di
 dichiarazione è il prototipo della funzione \func{execl} che vedremo in
 \secref{sec:proc_exec}:
 deve essere incluso l'apposito header file \file{stdarg.h}; un esempio di
 dichiarazione è il prototipo della funzione \func{execl} che vedremo in
 \secref{sec:proc_exec}:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-  int execl(const char *path, const char *arg, ...);
-\end{lstlisting}
+\includecodesnip{listati/exec_sample.c}
 in questo caso la funzione prende due parametri fissi ed un numero variabile
 di altri parametri (che verranno a costituire gli elementi successivi al primo
 del vettore \param{argv} passato al nuovo processo). Lo standard ISO C richiede
 in questo caso la funzione prende due parametri fissi ed un numero variabile
 di altri parametri (che verranno a costituire gli elementi successivi al primo
 del vettore \param{argv} passato al nuovo processo). Lo standard ISO C richiede
index 5fe5845314eab353f3866216f577efe4110fc74a..1e3b69e106f0bc133269877ebda5682c024c9d08 100644 (file)
@@ -126,13 +126,14 @@ struttura, alla cui base c'
 processi.
 
 Il kernel mantiene una tabella dei processi attivi, la cosiddetta
 processi.
 
 Il kernel mantiene una tabella dei processi attivi, la cosiddetta
-\textit{process table}; per ciascun processo viene mantenuta una voce nella
-tabella dei processi costituita da una struttura \struct{task\_struct}, che
-contiene tutte le informazioni rilevanti per quel processo. Tutte le strutture
-usate a questo scopo sono dichiarate nell'header file \file{linux/sched.h}, ed
-uno schema semplificato, che riporta la struttura delle principali informazioni
-contenute nella \struct{task\_struct} (che in seguito incontreremo a più
-riprese), è mostrato in \figref{fig:proc_task_struct}.
+\textit{process table}; per ciascun processo viene mantenuta una voce,
+costituita da una struttura \struct{task\_struct}, nella tabella dei processi
+che contiene tutte le informazioni rilevanti per quel processo. Tutte le
+strutture usate a questo scopo sono dichiarate nell'header file
+\file{linux/sched.h}, ed uno schema semplificato, che riporta la struttura
+delle principali informazioni contenute nella \struct{task\_struct} (che in
+seguito incontreremo a più riprese), è mostrato in
+\figref{fig:proc_task_struct}.
 
 \begin{figure}[htb]
   \centering
 
 \begin{figure}[htb]
   \centering
@@ -263,7 +264,7 @@ prototipi sono:
 \bodydesc{Entrambe le funzioni non riportano condizioni di errore.}
 \end{functions}
 \noindent esempi dell'uso di queste funzioni sono riportati in
 \bodydesc{Entrambe le funzioni non riportano condizioni di errore.}
 \end{functions}
 \noindent esempi dell'uso di queste funzioni sono riportati in
-\figref{fig:proc_fork_code}, nel programma di esempio \file{ForkTest.c}.
+\figref{fig:proc_fork_code}, nel programma \file{ForkTest.c}.
 
 Il fatto che il \acr{pid} sia un numero univoco per il sistema lo rende un
 candidato per generare ulteriori indicatori associati al processo di cui
 
 Il fatto che il \acr{pid} sia un numero univoco per il sistema lo rende un
 candidato per generare ulteriori indicatori associati al processo di cui
@@ -349,53 +350,11 @@ sempre un solo padre (il cui \acr{pid} pu
 che non è il \acr{pid} di nessun processo.
 
 \begin{figure}[!htb]
 che non è il \acr{pid} di nessun processo.
 
 \begin{figure}[!htb]
-  \footnotesize
-  \begin{lstlisting}{}
-#include <errno.h>       /* error definitions and routines */ 
-#include <stdlib.h>      /* C standard library */
-#include <unistd.h>      /* unix standard library */
-#include <stdio.h>       /* standard I/O library */
-#include <string.h>      /* string functions */
-
-/* Help printing routine */
-void usage(void);
-
-int main(int argc, char *argv[])
-{
-/* 
- * Variables definition  
- */
-    int nchild, i;
-    pid_t pid;
-    int wait_child  = 0;
-    int wait_parent = 0;
-    int wait_end    = 0;
-    ...        /* handling options */
-    nchild = atoi(argv[optind]);
-    printf("Test for forking %d child\n", nchild);
-    /* loop to fork children */
-    for (i=0; i<nchild; i++) {
-        if ( (pid = fork()) < 0) { 
-            /* on error exit */ 
-            printf("Error on %d child creation, %s\n", i+1, strerror(errno));
-            exit(-1); 
-        }
-        if (pid == 0) {   /* child */
-            printf("Child %d successfully executing\n", ++i);
-            if (wait_child) sleep(wait_child);
-            printf("Child %d, parent %d, exiting\n", i, getppid());
-            exit(0);
-        } else {          /* parent */
-            printf("Spawned %d child, pid %d \n", i+1, pid);
-            if (wait_parent) sleep(wait_parent);
-            printf("Go to next child \n");
-        }
-    }
-    /* normal exit */
-    if (wait_end) sleep(wait_end);
-    return 0;
-}
-  \end{lstlisting}
+  \footnotesize \centering
+  \begin{minipage}[c]{15cm}
+  \includecodesample{listati/ForkTest.c}
+  \end{minipage}
+  \normalsize
   \caption{Esempio di codice per la creazione di nuovi processi.}
   \label{fig:proc_fork_code}
 \end{figure}
   \caption{Esempio di codice per la creazione di nuovi processi.}
   \label{fig:proc_fork_code}
 \end{figure}
@@ -1171,9 +1130,7 @@ questo vettore \emph{deve} essere terminato da un puntatore nullo.
 
 Nel secondo caso le stringhe degli argomenti sono passate alla funzione come
 lista di puntatori, nella forma:
 
 Nel secondo caso le stringhe degli argomenti sono passate alla funzione come
 lista di puntatori, nella forma:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
-  char *arg0, char *arg1,  ..., char *argn, NULL
-\end{lstlisting}
+\includecodesnip{listati/char_list.c}
 che deve essere terminata da un puntatore nullo.  In entrambi i casi vale la
 convenzione che il primo argomento (\var{arg0} o \var{argv[0]}) viene usato
 per indicare il nome del file che contiene il programma che verrà eseguito.
 che deve essere terminata da un puntatore nullo.  In entrambi i casi vale la
 convenzione che il primo argomento (\var{arg0} o \var{argv[0]}) viene usato
 per indicare il nome del file che contiene il programma che verrà eseguito.
@@ -2269,7 +2226,7 @@ zero 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sched_param {
     int sched_priority;
 };
 struct sched_param {
     int sched_priority;
 };
index 45ca8e7cab3b1d30809d2c810398d1ae0fcce0bb..b53320ce2f6196f8a8a2088bd13b4b870d5ac2e9 100644 (file)
@@ -1092,7 +1092,7 @@ ulteriori informazioni.\footnote{la definizione della struttura si trova in
 \begin{figure}[!htb] 
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb] 
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct termios {
     tcflag_t c_iflag;      /* input modes */
     tcflag_t c_oflag;      /* output modes */
 struct termios {
     tcflag_t c_iflag;      /* input modes */
     tcflag_t c_oflag;      /* output modes */
@@ -1284,7 +1284,7 @@ della maschera, i valori da immettere infatti (quelli riportati nella
 spiegazione corrispondente) sono numerici e non per bit, per cui possono
 sovrapporsi fra di loro. Occorrerà perciò utilizzare un codice del tipo:
 
 spiegazione corrispondente) sono numerici e non per bit, per cui possono
 sovrapporsi fra di loro. Occorrerà perciò utilizzare un codice del tipo:
 
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}%
+\begin{lstlisting}[stepnumber=0,frame=]{}
     c_oflag &= (~CRDLY);
     c_oflag |= CR1;
 \end{lstlisting}
     c_oflag &= (~CRDLY);
     c_oflag |= CR1;
 \end{lstlisting}
@@ -1556,7 +1556,7 @@ completo dei caratteri di controllo, con le costanti e delle funzionalit
 associate è riportato in \tabref{tab:sess_termios_cc}, usando quelle
 definizioni diventa possibile assegnare un nuovo carattere di controllo con un
 codice del tipo:
 associate è riportato in \tabref{tab:sess_termios_cc}, usando quelle
 definizioni diventa possibile assegnare un nuovo carattere di controllo con un
 codice del tipo:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}%
+\begin{lstlisting}[stepnumber=0,frame=]{}
     value.c_cc[VEOL2] = '\n';
 \end{lstlisting}
 
     value.c_cc[VEOL2] = '\n';
 \end{lstlisting}
 
@@ -1652,7 +1652,7 @@ chiamata a \func{tcgetattr} che essi siano stati eseguiti tutti quanti.
 
 \begin{figure}[!htb]
   \footnotesize 
 
 \begin{figure}[!htb]
   \footnotesize 
-  \begin{lstlisting}{}%
+  \begin{lstlisting}{}
 #include <unistd.h>
 #include <termios.h>
 #include <errno.h>
 #include <unistd.h>
 #include <termios.h>
 #include <errno.h>
@@ -1704,7 +1704,7 @@ o uscendo normalmente.
 
 \begin{figure}[!htb]
   \footnotesize 
 
 \begin{figure}[!htb]
   \footnotesize 
-  \begin{lstlisting}{}%
+  \begin{lstlisting}{}
 int UnSetTermAttr(int fd, tcflag_t flag) 
 {
     struct termios values;
 int UnSetTermAttr(int fd, tcflag_t flag) 
 {
     struct termios values;
index b304add091eda2b4ea159f14aa3e820c41f920f4..525e8598c4ce35677b0f71a38bac1fbd1d8108ae 100644 (file)
@@ -740,7 +740,7 @@ Una modalit
 \func{strsignal} e \func{psignal} è quello di fare usare la variabile
 \var{sys\_siglist}, che è definita in \file{signal.h} e può essere acceduta
 con la dichiarazione:
 \func{strsignal} e \func{psignal} è quello di fare usare la variabile
 \var{sys\_siglist}, che è definita in \file{signal.h} e può essere acceduta
 con la dichiarazione:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
     extern const char *const sys_siglist[]
 \end{lstlisting}
 l'array \var{sys\_siglist} contiene i puntatori alle stringhe di descrizione,
     extern const char *const sys_siglist[]
 \end{lstlisting}
 l'array \var{sys\_siglist} contiene i puntatori alle stringhe di descrizione,
@@ -879,14 +879,14 @@ In questa definizione si 
 una estensione GNU, definita dalle \acr{glibc}, che permette di riscrivere il
 prototipo di \func{signal} nella forma appena vista, molto più leggibile di
 quanto non sia la versione originaria, che di norma è definita come:
 una estensione GNU, definita dalle \acr{glibc}, che permette di riscrivere il
 prototipo di \func{signal} nella forma appena vista, molto più leggibile di
 quanto non sia la versione originaria, che di norma è definita come:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
     void (*signal(int signum, void (*handler)(int)))int)
 \end{lstlisting}
 questa infatti, per la poca chiarezza della sintassi del C quando si vanno a
 trattare puntatori a funzioni, è molto meno comprensibile.  Da un confronto
 con il precedente prototipo si può dedurre la definizione di
 \type{sighandler\_t} che è:
     void (*signal(int signum, void (*handler)(int)))int)
 \end{lstlisting}
 questa infatti, per la poca chiarezza della sintassi del C quando si vanno a
 trattare puntatori a funzioni, è molto meno comprensibile.  Da un confronto
 con il precedente prototipo si può dedurre la definizione di
 \type{sighandler\_t} che è:
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
     typedef void (* sighandler_t)(int) 
 \end{lstlisting}
 e cioè un puntatore ad una funzione \ctyp{void} (cioè senza valore di ritorno)
     typedef void (* sighandler_t)(int) 
 \end{lstlisting}
 e cioè un puntatore ad una funzione \ctyp{void} (cioè senza valore di ritorno)
@@ -1164,7 +1164,7 @@ questo modo il ciclo verr
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct itimerval 
 {
     struct timeval it_interval; /* next value */
 struct itimerval 
 {
     struct timeval it_interval; /* next value */
@@ -1188,7 +1188,7 @@ in termini di \func{setitimer}, come evidenziato dal manuale delle \acr{glibc}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 unsigned int alarm(unsigned int seconds)
 {
     struct itimerval old, new;
 unsigned int alarm(unsigned int seconds)
 {
     struct itimerval old, new;
@@ -1811,7 +1811,7 @@ pi
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sigaction 
 {
     void (*sa_handler)(int);
 struct sigaction 
 {
     void (*sa_handler)(int);
@@ -1902,7 +1902,7 @@ riportata in \figref{fig:sig_siginfo_t}.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 siginfo_t {
     int      si_signo;  /* Signal number */
     int      si_errno;  /* An errno value */
 siginfo_t {
     int      si_signo;  /* Signal number */
     int      si_errno;  /* An errno value */
@@ -2298,7 +2298,7 @@ successivo ripristino).
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 typedef struct {
     void  *ss_sp;     /* Base address of stack */
     int    ss_flags;  /* Flags */
 typedef struct {
     void  *ss_sp;     /* Base address of stack */
     int    ss_flags;  /* Flags */
@@ -2475,7 +2475,7 @@ cui pu
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 union sigval_t {
         int sival_int;
         void *sival_ptr;
 union sigval_t {
         int sival_int;
         void *sival_ptr;
index 37bc64204ebca686d04ef98cd0be2a6b990ac4a2..1c9d1a746b528ee4472f1e8534321920528c8b1c 100644 (file)
@@ -361,7 +361,7 @@ una struttura generica per gli indirizzi dei socket, \struct{sockaddr}, che si
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sockaddr {
     sa_family_t  sa_family;     /* address family: AF_xxx */
     char         sa_data[14];   /* address (protocol-specific) */
 struct sockaddr {
     sa_family_t  sa_family;     /* address family: AF_xxx */
     char         sa_data[14];   /* address (protocol-specific) */
@@ -442,7 +442,7 @@ si usa IPv4) 
 \begin{figure}[!htb]
   \footnotesize\centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize\centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sockaddr_in {
     sa_family_t     sin_family; /* address family: AF_INET */
     in_port_t       sin_port;   /* port in network byte order */
 struct sockaddr_in {
     sa_family_t     sin_family; /* address family: AF_INET */
     in_port_t       sin_port;   /* port in network byte order */
@@ -503,7 +503,7 @@ in \figref{fig:sock_sa_ipv6_struct}.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sockaddr_in6 {
     uint16_t        sin6_family;   /* AF_INET6 */
     in_port_t       sin6_port;     /* port number */
 struct sockaddr_in6 {
     uint16_t        sin6_family;   /* AF_INET6 */
     in_port_t       sin6_port;     /* port number */
@@ -555,7 +555,7 @@ ad uno di questi socket si deve usare una struttura degli indirizzi di tipo
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 #define UNIX_PATH_MAX    108
 struct sockaddr_un {
     sa_family_t  sun_family;              /* AF_UNIX */
 #define UNIX_PATH_MAX    108
 struct sockaddr_un {
     sa_family_t  sun_family;              /* AF_UNIX */
@@ -603,7 +603,7 @@ file \file{netatalk/at.h}.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sockaddr_atalk {
     sa_family_t     sat_family; /* address family */
     uint8_t         sat_port;   /* port */
 struct sockaddr_atalk {
     sa_family_t     sat_family; /* address family */
     uint8_t         sat_port;   /* port */
@@ -684,7 +684,7 @@ occorre usare la funzione \func{bind} per agganciare il socket a quest'ultima.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct sockaddr_ll {
     unsigned short  sll_family;    /* Always AF_PACKET */
     unsigned short  sll_protocol;  /* Physical layer protocol */
 struct sockaddr_ll {
     unsigned short  sll_family;    /* Always AF_PACKET */
     unsigned short  sll_protocol;  /* Physical layer protocol */
index 924935adb4daad23f90cf8760dc8c3515d56e645..e5fe228b30d7bd41f80270be16f10a1bc2c37b4b 100644 (file)
@@ -157,7 +157,7 @@ file, riportate in \tabref{tab:sys_file_macro}).
 \begin{table}[htb]
   \centering
   \footnotesize
 \begin{table}[htb]
   \centering
   \footnotesize
-  \begin{tabular}[c]{|l|r|p{8cm}|}
+  \begin{tabular}[c]{|l|r|p{7cm}|}
     \hline
     \textbf{Costante}&\textbf{Valore}&\textbf{Significato}\\
     \hline
     \hline
     \textbf{Costante}&\textbf{Valore}&\textbf{Significato}\\
     \hline
@@ -201,7 +201,7 @@ riportati in \tabref{tab:sys_posix1_general}.
 \begin{table}[htb]
   \centering
   \footnotesize
 \begin{table}[htb]
   \centering
   \footnotesize
-  \begin{tabular}[c]{|l|r|p{8cm}|}
+  \begin{tabular}[c]{|l|r|p{7cm}|}
     \hline
     \textbf{Costante}&\textbf{Valore}&\textbf{Significato}\\
     \hline
     \hline
     \textbf{Costante}&\textbf{Valore}&\textbf{Significato}\\
     \hline
@@ -366,7 +366,7 @@ sostituendolo a \code{\_POSIX\_} per le macro definite dagli gli altri due.
 In generale si dovrebbe fare uso di \func{sysconf} solo quando la relativa
 macro non è definita, quindi con un codice analogo al seguente:
 %\footnotesize
 In generale si dovrebbe fare uso di \func{sysconf} solo quando la relativa
 macro non è definita, quindi con un codice analogo al seguente:
 %\footnotesize
-\begin{lstlisting}[labelstep=0,frame=,indent=1cm]{}
+\begin{lstlisting}[stepnumber=0,frame=]{}
 get_child_max(void)
 {
 #ifdef CHILD_MAX
 get_child_max(void)
 {
 #ifdef CHILD_MAX
@@ -521,7 +521,7 @@ solo definendo \macro{\_GNU\_SOURCE}.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-  \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+  \begin{lstlisting}[stepnumber=0]{}
 struct utsname {
     char sysname[];
     char nodename[];
 struct utsname {
     char sysname[];
     char nodename[];
@@ -896,7 +896,7 @@ genere 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-  \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+  \begin{lstlisting}[stepnumber=0]{}
 struct statfs {
    long    f_type;     /* tipo di filesystem */
    long    f_bsize;    /* dimensione ottimale dei blocchi di I/O */
 struct statfs {
    long    f_type;     /* tipo di filesystem */
    long    f_bsize;    /* dimensione ottimale dei blocchi di I/O */
@@ -983,7 +983,7 @@ il significato dei vari campi.
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct passwd {
     char    *pw_name;       /* user name */
     char    *pw_passwd;     /* user password */
 struct passwd {
     char    *pw_name;       /* user name */
     char    *pw_passwd;     /* user password */
@@ -1070,7 +1070,7 @@ in questo caso le informazioni vengono restituite in una struttura di tipo
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct group {
     char    *gr_name;        /* group name */
     char    *gr_passwd;      /* group password */
 struct group {
     char    *gr_name;        /* group name */
     char    *gr_passwd;      /* group password */
@@ -1239,7 +1239,7 @@ eseguire una ricerca.
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct utmp
 {
     short int ut_type;            /* Type of login.  */
 struct utmp
 {
     short int ut_type;            /* Type of login.  */
@@ -1377,7 +1377,7 @@ di tipo \struct{rusage}, la cui definizione (che si trova in
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct rusage {
     struct timeval ru_utime; /* user time used */
     struct timeval ru_stime; /* system time used */
 struct rusage {
     struct timeval ru_utime; /* user time used */
     struct timeval ru_stime; /* system time used */
@@ -1473,7 +1473,7 @@ corrente e limite massimo.
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct rlimit {
      rlim_t    rlim_cur;
      rlim_t    rlim_max;
 struct rlimit {
      rlim_t    rlim_cur;
      rlim_t    rlim_max;
@@ -1578,13 +1578,13 @@ poi effettuato attraverso la struttura \struct{rlimit} puntata da
   evitare la creazione di \file{core} file (al proposito si veda
   \secref{sec:sig_prog_error}).}
 
   evitare la creazione di \file{core} file (al proposito si veda
   \secref{sec:sig_prog_error}).}
 
-Nello specificare un limite, oltre a dei valori specifici, si può anche usare
-la costante \const{RLIM\_INFINITY} che permette di sbloccare l'uso di una
-risorsa; ma si ricordi che solo un processo con i privilegi di amministratore
-può innalzare un limite al di sopra del valore corrente del limite massimo. Si
-tenga conto infine che tutti i limiti vengono ereditati dal processo padre
-attraverso una \func{fork} (vedi \secref{sec:proc_fork}) e mantenuti per gli
-altri programmi eseguiti attraverso una \func{exec} (vedi
+Nello specificare un limite, oltre a fornire dei valori specifici, si può
+anche usare la costante \const{RLIM\_INFINITY} che permette di sbloccare l'uso
+di una risorsa; ma si ricordi che solo un processo con i privilegi di
+amministratore può innalzare un limite al di sopra del valore corrente del
+limite massimo. Si tenga conto infine che tutti i limiti vengono ereditati dal
+processo padre attraverso una \func{fork} (vedi \secref{sec:proc_fork}) e
+mantenuti per gli altri programmi eseguiti attraverso una \func{exec} (vedi
 \secref{sec:proc_exec}).
 
 
 \secref{sec:proc_exec}).
 
 
@@ -1808,7 +1808,7 @@ struttura di tipo \struct{tms}, la cui definizione 
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct tms {
        clock_t tms_utime;  /* user time */
        clock_t tms_stime;  /* system time */
 struct tms {
        clock_t tms_utime;  /* user time */
        clock_t tms_stime;  /* system time */
@@ -1908,7 +1908,7 @@ nanosecondo.\footnote{la precisione 
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct timeval 
 {
     long tv_sec;            /* seconds */
 struct timeval 
 {
     long tv_sec;            /* seconds */
@@ -1971,7 +1971,7 @@ effettuato.
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct timex {
     unsigned int modes;   /* mode selector */
     long int offset;      /* time offset (usec) */
 struct timex {
     unsigned int modes;   /* mode selector */
     long int offset;      /* time offset (usec) */
@@ -2131,7 +2131,7 @@ stata introdotta una ulteriore rappresentazione, detta \textit{broken-down
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
 \begin{figure}[!htb]
   \footnotesize \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 struct tm {
         int     tm_sec;         /* seconds */
         int     tm_min;         /* minutes */
 struct tm {
         int     tm_sec;         /* seconds */
         int     tm_min;         /* minutes */
@@ -2242,7 +2242,7 @@ verr
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
   \footnotesize
   \centering
   \begin{minipage}[c]{15cm}
-    \begin{lstlisting}[labelstep=0]{}%,frame=,indent=1cm]{}
+    \begin{lstlisting}[stepnumber=0]{}
 extern char *tzname[2];
 extern long timezone;
 extern int daylight;
 extern char *tzname[2];
 extern long timezone;
 extern int daylight;