Aggiunto materiale sugli errori
[gapil.git] / errors.tex
1 \chapter{I codici di errore}
2 \label{cha:errors}
3
4 Si riportano in questa appendice tutti i codici di errore. Essi sono
5 accessibili attraverso l'inclusione del file di header \file{errno.h}, che
6 definisce anche la variabile globale \var{errno}. Per ogni errore definito
7 riporteremo la stringa stampata da \func{perror} ed una breve spiegazione. Si
8 tenga presente che spiegazioni più particolareggiate, qualora necessarie per
9 il caso specifico, possono essere trovate nella descrizione del prototipo
10 della funzione.
11
12 I codici di errore sono riportati come costanti di tipo \type{int}, i valori
13 delle costanti sono definiti da macro di preprocessore nel file citato, e
14 possono variare da architettura a architettura; è pertanto necessario
15 riferirsi ad essi tramite i nomi simbolici. Le funzioni \func{perror} e
16 \func{strerror} (vedi \secref{sec:intro_strerror}) possono essere usate per
17 ottene dei messaggi di errore.
18
19
20 \section{Gli errori dei file}
21 \label{sec:err_file_errors}
22
23 In questa sezione riassumeremo gli errori restituiti dalle funzioni di
24 libreria che operano sui file.
25
26 \begin{description}
27   
28 \item \macro{EPERM} \textit{Operation not permitted}. L'operazione non è
29   permessa: solo il proprietario del file o un processo con sufficienti
30   privilegi può eseguire l'operazione.
31 \item \macro{ENOENT} \textit{No such file or directory}. Il file indicato dal
32   pathname non esiste: o una delle componenti non esiste o il pathname
33   contiene un link simbolico spezzato. Errore tipico di un riferimento ad un
34   file che si suppone erroneamente essere esistente.
35 \item \macro{EIO} \textit{Input/output error}. Errore di input/output: usato
36   per riportare errori hardware in lettura/scrittura su un dispositivo.
37 \item \macro{ENXIO} \textit{No such device or address}. Device inesistente: il
38   sistema ha tentato di usare un dispositivo attraverso il file specificato,
39   ma non lo ha trovato. Può significare che il file di dispositivo non è
40   corretto, che il modulo relativo non è stato caricato nel kernel, o che il
41   dispositivo è fisicamente assente o non funzionante.
42 \item \macro{ENOEXEC} \textit{Invalid executable file format}. Il file non ha
43   un formato eseguibile, è un errore riscontrato dalle funzioni \func{exec}.
44 \item \macro{EBADF} \textit{Bad file descriptor}. File descriptor non valido:
45   si è usato un file descriptor inesistente, o aperto in sola lettura per
46   scrivere, o viceversa, o si è cercato di eseguire un'operazione non
47   consentita per quel tipo di file descriptor.
48 \item \macro{ENOMEM} \textit{No memory available}. Il kernel non è in grado di
49   allocare ulteriore memoria per completare l'operazione richiesta.
50 \item \macro{EACCESS} \textit{Permission denied}. Permesso negato; l'accesso
51   al file non è consentito: i permessi del file o della directory non
52   consentono l'operazione.
53 \item \macro{ELOOP} \textit{Too many symbolic links encountered}. Ci sono
54   troppi link simbolici nella risoluzione di un pathname.  
55 \item \macro{ENAMETOOLONG} \textit{File name too long}. Si è indicato un
56   pathname troppo lungo.
57 \item \macro{EEXIST} \textit{File exists}. 
58 \item \macro{ENODEV} \textit{No such device}. 
59 \item \macro{ENOTDIR} \textit{Not a directory}. Un componente del pathname non
60   è una directory.
61 \item \macro{EISDIR} \textit{Is a directory}. 
62 \item \macro{EINVAL} \textit{Invalid argument}. 
63 \item \macro{EMFILE} \textit{Too many open files}. 
64 \item \macro{ENFILE} \textit{File table overflow}. 
65 \item \macro{ENOTTY} \textit{Not a terminal}. 
66 \item \macro{ETXTBSY} \textit{Text file busy}. 
67 \item \macro{EFBIG} \textit{File too big}. 
68 \item \macro{ENOSPC} \textit{No space left on device}. la directory in cui si
69   vuole creare il link non ha spazio per ulteriori voci.
70 \item \macro{ESPIPE} \textit{Invalid seek operation}. 
71 \item \macro{EROFS} \textit{Read-only file system}.  il file risiede su un filesystem read-only.
72 \item \macro{EMLINK} \textit{Too many links}. Ci sono troppi link al file (il
73    numero massimo è specificato dalla variabile \macro{LINK\_MAX}, vedi
74   \secref{sec:xxx_limits}).
75 \item \macro{EPIPE} \textit{Broken pipe}. 
76
77
78
79 \section{Gli errori dei processi}
80 \label{sec:err_proc_errors}
81
82 In questa sezione riassumeremo gli errori restituiti dalle funzioni di
83 libreria che operano sui processi.
84
85 \begin{description}
86
87 \item \macro{ESRCH} \textit{No process matches the specified process ID}. Non
88   esiste un processo con il \acr{pid} specificato.
89 \item \macro{EINTR} \textit{Interrupted function call}. Una funzione di
90   libreria è stata interrotta. In genere questo avviene causa di un segnale
91   asincrono al processo che impedisce la conclusione della chiamata. In questo
92   caso è necessario ripetere la chiamata alla funzione. 
93 \item \macro{E2BIG} \textit{Argument list too long}. Lista degli argomenti
94   troppo lunga: è una condizione prevista da POSIX quando la lista degli
95   argomenti passata ad una delle funzioni \func{exec} occupa troppa memoria,
96   non può mai accadere in GNU/Linux.
97 \item \macro{ECHILD} \textit{There are no child processes}. Non esiste un
98   processo figlio. Viene rilevato dalle funzioni per la gestione dei processi
99   figli. 
100 \item \macro{EDEADLK} \textit{Deadlock avoided}. L'allocazione di una risorsa
101   avrebbe causato un deadlock. Non sempre il sistema è in grado di riconoscere
102   queste situazioni, nel qual caso si avrebbe in blocco. 
103 \item \macro{EFAULT} \textit{Bad address} una stringa passata come parametro è
104   fuori dello spazio di indirizzi del processo, in genere questa situazione
105   provova.
106
107
108
109
110 \section{Gli errori di rete}
111 \label{sec:err_network}
112
113
114 \item \macro{EXDEV} \textit{Cross-device link}. 
115 \item \macro{ENOTBLK} \textit{}. 
116 \item \macro{EBUSY} \textit{Resource busy}. 
117 \item \macro{EDOM} \textit{Domain error}. 
118 \item \macro{ERANGE} \textit{Range error}. 
119 \item \macro{EAGAIN} \textit{Resource temporarily unavailable}. 
120 \item \macro{EWOULDBLOCK} \textit{Operation would block}. In Linux è identico
121   a \macro{EAGAIN}.
122 \item \macro{EINPROGRESS} \textit{Operation now in progress}. 
123 \item \macro{EALREADY} \textit{Operation already in progress}. 
124 \item \macro{ENOTSOCK} \textit{Socket operation on non-socket}. 
125 \item \macro{EMSGSIZE} \textit{Message too long}. 
126 \item \macro{EPROTOTYPE} \textit{Protocol wrong type for socket}. 
127 \item \macro{ENOPROTOOPT} \textit{Protocol not available}. 
128 \item \macro{EPROTONOSUPPORT} \textit{Protocol not supported}. 
129 \item \macro{ESOCKTNOSUPPORT} \textit{Socket type not supported}. 
130 \item \macro{EOPNOTSUPP} \textit{Operation not supported on transport endpoint}. 
131 \item \macro{EPFNOSUPPORT} \textit{Protocol family not supported}. 
132 \item \macro{EAFNOSUPPORT} \textit{Address family not supported by protocol}. 
133 \item \macro{EADDRINUSE} \textit{Address already in use}. 
134 \item \macro{EADDRNOTAVAIL} \textit{Cannot assign requested address}. 
135 \item \macro{ENETDOWN} \textit{Network is down}. 
136 \item \macro{ENETUNREACH} \textit{Network is unreachable}. 
137 \item \macro{ENETRESET} \textit{Network dropped connection because of reset}. 
138 \item \macro{ECONNABORTED} \textit{Software caused connection abort}. 
139 \item \macro{ECONNRESET} \textit{Connection reset by peer}. 
140 \item \macro{ENOBUFS} \textit{No buffer space available}. 
141 \item \macro{EISCONN} \textit{Transport endpoint is already connected}. 
142 \item \macro{ENOTCONN} \textit{Transport endpoint is not connected}. 
143 \item \macro{EDESTADDRREQ} \textit{Destination address required}. 
144 \item \macro{ESHUTDOWN} \textit{Cannot send after transport endpoint shutdown}. 
145 \item \macro{ETOOMANYREFS} \textit{Too many references: cannot splice}. 
146 \item \macro{ETIMEDOUT} \textit{Connection timed out}. 
147 \item \macro{ECONNREFUSED} \textit{Connection refused}. 
148   
149 \item \macro{EHOSTDOWN} \textit{Host is down}. 
150 \item \macro{EHOSTUNREACH} \textit{No route to host}. 
151 \item \macro{ENOTEMPTY} \textit{Directory not empty}. 
152 \item \macro{EPROCLIM} \textit{}. 
153 \item \macro{EUSERS} \textit{Too many users}. 
154 \item \macro{EDQUOT} \textit{Quota exceeded}. 
155 \item \macro{ESTALE} \textit{Stale NFS file handle}. 
156 \item \macro{EREMOTE} \textit{}. 
157 \item \macro{EBADRPC} \textit{}. 
158 \item \macro{ERPCMISMATCH} \textit{}. 
159 \item \macro{EPROGUNAVAIL} \textit{}. 
160 \item \macro{EPROGMISMATCH} \textit{}. 
161 \item \macro{EPROCUNAVAIL} \textit{}. 
162 \item \macro{ENOLCK} \textit{No locks available}. 
163 \item \macro{EFTYPE} \textit{Inappropriate file type or format}. 
164 \item \macro{EAUTH} \textit{}. 
165 \item \macro{ENEEDAUTH} \textit{}. 
166 \item \macro{ENOSYS} \textit{Function not implemented}. 
167 \item \macro{ENOTSUP} \textit{Not supported}. 
168 \item \macro{EILSEQ} \textit{Illegal byte sequence}. 
169 \item \macro{EBACKGROUND} \textit{}. 
170 \item \macro{EDIED} \textit{}. 
171 \item \macro{ED} \textit{}. 
172 \item \macro{EGREGIOUS} \textit{}. 
173 \item \macro{EIEIO} \textit{}. 
174 \item \macro{EGRATUITOUS} \textit{}. 
175 \item \macro{EBADMSG} \textit{Not a data message}. 
176 \item \macro{EIDRM} \textit{Identifier removed}. 
177 \item \macro{EMULTIHOP} \textit{Multihop attempted}. 
178 \item \macro{ENODATA} \textit{No data available}. 
179 \item \macro{ENOLINK} \textit{Link has been severed}. 
180 \item \macro{ENOMSG} \textit{No message of desired type}. 
181 \item \macro{ENOSR} \textit{Out of streams resources}. 
182 \item \macro{ENOSTR} \textit{Device not a stream}. 
183 \item \macro{EOVERFLOW} \textit{Value too large for defined data type}. 
184 \item \macro{EPROTO} \textit{Protocol error}. 
185 \item \macro{ETIME} \textit{Timer expired}. 
186
187
188 \section{Errori del kernel}
189 \label{sec:err_kernel_err}
190
191 \item \macro{ERESTART} \textit{Interrupted system call should be restarted}. 
192 \item \macro{ECHRNG} \textit{Channel number out of range}. 
193 \item \macro{EL2NSYNC} \textit{Level 2 not synchronized}. 
194 \item \macro{EL3HLT} \textit{Level 3 halted}. 
195 \item \macro{EL3RST} \textit{Level 3 reset}. 
196 \item \macro{ELNRNG} \textit{Link number out of range}. 
197 \item \macro{EUNATCH} \textit{Protocol driver not attached}. 
198 \item \macro{ENOCSI} \textit{No CSI structure available}. 
199 \item \macro{EL2HLT} \textit{Level 2 halted}. 
200 \item \macro{EBADE} \textit{Invalid exchange}. 
201 \item \macro{EBADR} \textit{Invalid request descriptor}. 
202 \item \macro{EXFULL} \textit{Exchange full}. 
203 \item \macro{ENOANO} \textit{No anode}. 
204 \item \macro{EBADRQC} \textit{Invalid request code}. 
205 \item \macro{EBADSLT} \textit{Invalid slot}. 
206 \item \macro{EDEADLOCK} Identico a \macro{EDEADLK}. 
207 \item \macro{EBFONT} \textit{Bad font file format}. 
208 \item \macro{ENONET} \textit{Machine is not on the network}. 
209 \item \macro{ENOPKG} \textit{Package not installed}. 
210 \item \macro{EADV} \textit{Advertise error}. 
211 \item \macro{ESRMNT} \textit{Srmount error}. 
212 \item \macro{ECOMM} \textit{Communication error on send}. 
213 \item \macro{EDOTDOT} \textit{RFS specific error}. 
214 \item \macro{ENOTUNIQ} \textit{Name not unique on network}. 
215 \item \macro{EBADFD} \textit{File descriptor in bad state}. 
216 \item \macro{EREMCHG} \textit{Remote address changed}. 
217 \item \macro{ELIBACC} \textit{Can not access a needed shared library}. 
218 \item \macro{ELIBBAD} \textit{Accessing a corrupted shared library}. 
219 \item \macro{ELIBSCN} \textit{.lib section in a.out corrupted}. 
220 \item \macro{ELIBMAX} \textit{Attempting to link in too many shared libraries}. 
221 \item \macro{ELIBEXEC} \textit{Cannot exec a shared library directly}. 
222 \item \macro{ESTRPIPE} \textit{Streams pipe error}. 
223 \item \macro{EUCLEAN} \textit{Structure needs cleaning}. 
224 \item \macro{ENAVAIL} \textit{No XENIX semaphores available}. 
225 \item \macro{EISNAM} \textit{Is a named type file}. 
226 \item \macro{EREMOTEIO} \textit{Remote I/O error}. 
227 \item \macro{ENOMEDIUM} \textit{No medium found}. 
228 \item \macro{EMEDIUMTYPE} \textit{Wrong medium type}. 
229 \item \macro{} \textit{}. 
230
231
232 \end{description}
233
234
235
236 \section{Altri errori}
237 \label{sec:err_others}
238
239
240
241
242 \end{description}
243
244