1 \chapter{I codici di errore}
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
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.
20 \section{Gli errori dei file}
21 \label{sec:err_file_errors}
23 In questa sezione riassumeremo gli errori restituiti dalle funzioni di
24 libreria che operano sui file.
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.
34 \item \macro{EIO} \textit{Input/output error}. Errore di input/output: usato
35 per riportare errori hardware in lettura/scrittura (su un dispositivo).
36 \item \macro{ENXIO} \textit{No such device or address}. Device inesistente: il
37 sistema ha tentato di usare un dispositivo attraverso il file specificato,
38 ma non lo ha trovato. Può significare che il file di dispositivo non è
39 corretto, che il modulo relativo non è stato caricato nel kernel, o che il
40 dispositico è fisicamente assente o non funzionante.
41 \item \macro{ENOEXEC} \textit{Invalid executable file format}. Il file non ha
42 un formato eseguibile, è un errore riscontrato dalle funzioni \func{exec}.
43 \item \macro{EBADF} \textit{Bad file descriptor}. File descriptor non valido:
44 si è usato un file descriptor inesistente, o aperto in sola lettura per
45 scrivere, o viceversa.
46 \item \macro{ENOMEM} \textit{No memory available}. Il kernel non è in grado di
47 allocare ulteriore memoria per completare l'operazione richiesta.
48 \item \macro{EACCESS} \textit{Permission denied}. Permesso negato: l'accesso
49 al file non è consentito: i permessi del file o della directory non
50 consentono l'operazione.
53 \item \macro{EXDEV} \textit{Cross-device link}.
54 \item \macro{ENOTBLK} \textit{}.
55 \item \macro{EBUSY} \textit{Resource busy}.
56 \item \macro{EEXIST} \textit{File exists}.
57 \item \macro{ENODEV} \textit{No such device}.
58 \item \macro{ENOTDIR} \textit{Not a directory}. un componente del pathname non è una directory.
60 \item \macro{EISDIR} \textit{Is a directory}.
61 \item \macro{EINVAL} \textit{Invalid argument}.
62 \item \macro{EMFILE} \textit{Too many open files}.
63 \item \macro{ENFILE} \textit{File table overflow}.
64 \item \macro{ENOTTY} \textit{Not a terminal}.
65 \item \macro{ETXTBSY} \textit{Text file busy}.
66 \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.
71 \item \macro{ESPIPE} \textit{Invalid seek operation}.
72 \item \macro{EROFS} \textit{Read-only file system}. il file risiede su un filesystem read-only.
74 \item \macro{EMLINK} \textit{Too many links}. Ci sono troppi link al file (il
75 numero massimo è specificato dalla variabile \macro{LINK\_MAX}, vedi
76 \secref{sec:xxx_limits}).
78 \item \macro{EPIPE} \textit{Broken pipe}.
79 \item \macro{EDOM} \textit{Domain error}.
80 \item \macro{ERANGE} \textit{Range error}.
81 \item \macro{EAGAIN} \textit{Resource temporarily unavailable}.
82 \item \macro{EWOULDBLOCK} \textit{Operation would block}. In Linux è identico
84 \item \macro{EINPROGRESS} \textit{Operation now in progress}.
85 \item \macro{EALREADY} \textit{Operation already in progress}.
86 \item \macro{ENOTSOCK} \textit{Socket operation on non-socket}.
87 \item \macro{EMSGSIZE} \textit{Message too long}.
88 \item \macro{EPROTOTYPE} \textit{Protocol wrong type for socket}.
89 \item \macro{ENOPROTOOPT} \textit{Protocol not available}.
90 \item \macro{EPROTONOSUPPORT} \textit{Protocol not supported}.
91 \item \macro{ESOCKTNOSUPPORT} \textit{Socket type not supported}.
92 \item \macro{EOPNOTSUPP} \textit{Operation not supported on transport endpoint}.
93 \item \macro{EPFNOSUPPORT} \textit{Protocol family not supported}.
94 \item \macro{EAFNOSUPPORT} \textit{Address family not supported by protocol}.
95 \item \macro{EADDRINUSE} \textit{Address already in use}.
96 \item \macro{EADDRNOTAVAIL} \textit{Cannot assign requested address}.
97 \item \macro{ENETDOWN} \textit{Network is down}.
98 \item \macro{ENETUNREACH} \textit{Network is unreachable}.
99 \item \macro{ENETRESET} \textit{Network dropped connection because of reset}.
100 \item \macro{ECONNABORTED} \textit{Software caused connection abort}.
101 \item \macro{ECONNRESET} \textit{Connection reset by peer}.
102 \item \macro{ENOBUFS} \textit{No buffer space available}.
103 \item \macro{EISCONN} \textit{Transport endpoint is already connected}.
104 \item \macro{ENOTCONN} \textit{Transport endpoint is not connected}.
105 \item \macro{EDESTADDRREQ} \textit{Destination address required}.
106 \item \macro{ESHUTDOWN} \textit{Cannot send after transport endpoint shutdown}.
107 \item \macro{ETOOMANYREFS} \textit{Too many references: cannot splice}.
108 \item \macro{ETIMEDOUT} \textit{Connection timed out}.
109 \item \macro{ECONNREFUSED} \textit{Connection refused}.
111 \item \macro{ELOOP} \textit{Too many symbolic links encountered}. ci sono
112 troppi link simbolici nella risoluzione di un pathname.
114 \item \macro{ENAMETOOLONG} \textit{File name too long}. si è indicato un
115 pathname troppo lungo.
117 \item \macro{EHOSTDOWN} \textit{Host is down}.
118 \item \macro{EHOSTUNREACH} \textit{No route to host}.
119 \item \macro{ENOTEMPTY} \textit{Directory not empty}.
120 \item \macro{EPROCLIM} \textit{}.
121 \item \macro{EUSERS} \textit{Too many users}.
122 \item \macro{EDQUOT} \textit{Quota exceeded}.
123 \item \macro{ESTALE} \textit{Stale NFS file handle}.
124 \item \macro{EREMOTE} \textit{}.
125 \item \macro{EBADRPC} \textit{}.
126 \item \macro{ERPCMISMATCH} \textit{}.
127 \item \macro{EPROGUNAVAIL} \textit{}.
128 \item \macro{EPROGMISMATCH} \textit{}.
129 \item \macro{EPROCUNAVAIL} \textit{}.
130 \item \macro{ENOLCK} \textit{No locks available}.
131 \item \macro{EFTYPE} \textit{Inappropriate file type or format}.
132 \item \macro{EAUTH} \textit{}.
133 \item \macro{ENEEDAUTH} \textit{}.
134 \item \macro{ENOSYS} \textit{Function not implemented}.
135 \item \macro{ENOTSUP} \textit{Not supported}.
136 \item \macro{EILSEQ} \textit{Illegal byte sequence}.
137 \item \macro{EBACKGROUND} \textit{}.
138 \item \macro{EDIED} \textit{}.
139 \item \macro{ED} \textit{}.
140 \item \macro{EGREGIOUS} \textit{}.
141 \item \macro{EIEIO} \textit{}.
142 \item \macro{EGRATUITOUS} \textit{}.
143 \item \macro{EBADMSG} \textit{Not a data message}.
144 \item \macro{EIDRM} \textit{Identifier removed}.
145 \item \macro{EMULTIHOP} \textit{Multihop attempted}.
146 \item \macro{ENODATA} \textit{No data available}.
147 \item \macro{ENOLINK} \textit{Link has been severed}.
148 \item \macro{ENOMSG} \textit{No message of desired type}.
149 \item \macro{ENOSR} \textit{Out of streams resources}.
150 \item \macro{ENOSTR} \textit{Device not a stream}.
151 \item \macro{EOVERFLOW} \textit{Value too large for defined data type}.
152 \item \macro{EPROTO} \textit{Protocol error}.
153 \item \macro{ETIME} \textit{Timer expired}.
156 \section{Errori del kernel}
157 \label{sec:err_kernel_err}
160 \item \macro{ERESTART/} \textit{Interrupted system call should be restarted}.
161 \item \macro{ECHRNG} \textit{Channel number out of range}.
162 \item \macro{EL2NSYNC} \textit{Level 2 not synchronized}.
163 \item \macro{EL3HLT} \textit{Level 3 halted}.
164 \item \macro{EL3RST} \textit{Level 3 reset}.
165 \item \macro{ELNRNG} \textit{Link number out of range}.
166 \item \macro{EUNATCH} \textit{Protocol driver not attached}.
167 \item \macro{ENOCSI} \textit{No CSI structure available}.
168 \item \macro{EL2HLT} \textit{Level 2 halted}.
169 \item \macro{EBADE} \textit{Invalid exchange}.
170 \item \macro{EBADR} \textit{Invalid request descriptor}.
171 \item \macro{EXFULL} \textit{Exchange full}.
172 \item \macro{ENOANO} \textit{No anode}.
173 \item \macro{EBADRQC} \textit{Invalid request code}.
174 \item \macro{EBADSLT} \textit{Invalid slot}.
175 \item \macro{EDEADLOCK} Identico a \macro{EDEADLK}.
176 \item \macro{EBFONT} \textit{Bad font file format}.
177 \item \macro{ENONET} \textit{Machine is not on the network}.
178 \item \macro{ENOPKG} \textit{Package not installed}.
179 \item \macro{EADV} \textit{Advertise error}.
180 \item \macro{ESRMNT} \textit{Srmount error}.
181 \item \macro{ECOMM} \textit{Communication error on send}.
182 \item \macro{EDOTDOT} \textit{RFS specific error}.
183 \item \macro{ENOTUNIQ} \textit{Name not unique on network}.
184 \item \macro{EBADFD} \textit{File descriptor in bad state}.
185 \item \macro{EREMCHG} \textit{Remote address changed}.
186 \item \macro{ELIBACC} \textit{Can not access a needed shared library}.
187 \item \macro{ELIBBAD} \textit{Accessing a corrupted shared library}.
188 \item \macro{ELIBSCN} \textit{.lib section in a.out corrupted}.
189 \item \macro{ELIBMAX} \textit{Attempting to link in too many shared libraries}.
190 \item \macro{ELIBEXEC} \textit{Cannot exec a shared library directly}.
191 \item \macro{ESTRPIPE} \textit{Streams pipe error}.
192 \item \macro{EUCLEAN} \textit{Structure needs cleaning}.
193 \item \macro{ENAVAIL} \textit{No XENIX semaphores available}.
194 \item \macro{EISNAM} \textit{Is a named type file}.
195 \item \macro{EREMOTEIO} \textit{Remote I/O error}.
196 \item \macro{ENOMEDIUM} \textit{No medium found}.
197 \item \macro{EMEDIUMTYPE} \textit{Wrong medium type}.
198 \item \macro{} \textit{}.
203 \section{Gli errori dei processi}
204 \label{sec:err_proc_errors}
206 In questa sezione riassumeremo gli errori restituiti dalle funzioni di
207 libreria che operano sui processi.
211 \item \macro{ESRCH} \textit{No process matches the specified process ID}. Non
212 esiste un processo con il \acr{pid} specificato.
213 \item \macro{EINTR} \textit{Interrupted function call}. Una funzione di
214 libreria è stata interrotta. In genere questo avviene causa di un segnale
215 asincrono al processo che impedisce la conclusione della chiamata. In questo
216 caso è necessario ripetere la chiamata alla funzione.
217 \item \macro{E2BIG} \textit{Argument list too long}. Lista degli argomenti
218 troppo lunga: è una condizione prevista da POSIX quando la lista degli
219 argomenti passata ad una delle funzioni \func{exec} occupa troppa memoria,
220 non può mai accadere in GNU/Linux.
221 \item \macro{ECHILD} \textit{There are no child processes}. Non esiste un
222 processo figlio. Viene rilevato dalle funzioni per la gestione dei processi
224 \item \macro{EDEADLK} \textit{Deadlock avoided}. L'allocazione di una risorsa
225 avrebbe causato un deadlock. Non sempre il sistema è in grado di riconoscere
226 queste situazioni, nel qual caso si avrebbe in blocco.
227 \item \macro{EFAULT} \textit{Bad address} una stringa passata come parametro è
228 fuori dello spazio di indirizzi del processo, in genere questa situazione