From 63f75c2bcd061336dd717b197bff0198b5194837 Mon Sep 17 00:00:00 2001 From: Simone Piccardi Date: Fri, 17 Aug 2001 20:41:24 +0000 Subject: [PATCH] Aggiunti un po' di codici di errore --- errors.tex | 193 +++++++++++++++++++++++++-------------------------- filedir.tex | 8 +-- prochand.tex | 33 ++++++++- 3 files changed, 127 insertions(+), 107 deletions(-) diff --git a/errors.tex b/errors.tex index a2aaa74..3dc5189 100644 --- a/errors.tex +++ b/errors.tex @@ -45,7 +45,6 @@ libreria che operano sui file. scrivere, o viceversa. \item \macro{ENOMEM} \textit{No memory available}. Il kernel non è in grado di allocare ulteriore memoria per completare l'operazione richiesta. - \item \macro{EACCESS} \textit{Permission denied}. Permesso negato: l'accesso al file non è consentito: i permessi del file o della directory non consentono l'operazione. @@ -63,14 +62,14 @@ libreria che operano sui file. \item \macro{EMFILE} \textit{Too many open files}. \item \macro{ENFILE} \textit{File table overflow}. \item \macro{ENOTTY} \textit{Not a terminal}. -\item \macro{ETXTBSY} \textit{}. +\item \macro{ETXTBSY} \textit{Text file busy}. \item \macro{EFBIG} \textit{File too big}. \item \macro{ENOSPC} \textit{No space left on device}. la directory in cui si vuole creare il link non ha spazio per ulteriori voci. \item \macro{ESPIPE} \textit{Invalid seek operation}. -\item \macro{EROFS} \textit{}. il file risiede su un filesystem read-only. +\item \macro{EROFS} \textit{Read-only file system}. il file risiede su un filesystem read-only. \item \macro{EMLINK} \textit{Too many links}. Ci sono troppi link al file (il numero massimo è specificato dalla variabile \macro{LINK\_MAX}, vedi @@ -80,49 +79,48 @@ libreria che operano sui file. \item \macro{EDOM} \textit{Domain error}. \item \macro{ERANGE} \textit{Range error}. \item \macro{EAGAIN} \textit{Resource temporarily unavailable}. -\item \macro{EWOULDBLOCK} \textit{}. -\item \macro{EINPROGRESS} \textit{}. -\item \macro{EALREADY} \textit{}. -\item \macro{ENOTSOCK} \textit{}. -\item \macro{EMSGSIZE} \textit{}. -\item \macro{EALREADY} \textit{}. -\item \macro{ENOTSOCK} \textit{}. -\item \macro{EMSGSIZE} \textit{}. -\item \macro{EPROTOTYPE} \textit{}. -\item \macro{ENOPROTOOPT} \textit{}. -\item \macro{EPROTONOSUPPORT} \textit{}. -\item \macro{ESOCKTNOSUPPORT} \textit{}. -\item \macro{EOPNOTSUPP} \textit{}. -\item \macro{EPFNOSUPPORT} \textit{}. -\item \macro{EAFNOSUPPORT} \textit{}. -\item \macro{EADDRINUSE} \textit{}. -\item \macro{EADDRNOTAVAIL} \textit{}. -\item \macro{ENETDOWN} \textit{}. -\item \macro{ENETUNREACH} \textit{}. -\item \macro{ENETRESET} \textit{}. -\item \macro{ECONNABORTED} \textit{}. -\item \macro{ECONNRESET} \textit{}. -\item \macro{ENOBUFS} \textit{}. -\item \macro{EISCONN} \textit{}. -\item \macro{ENOTCONN} \textit{}. -\item \macro{EDESTADDRREQ} \textit{}. -\item \macro{ESHUTDOWN} \textit{}. -\item \macro{ETOOMANYREFS} \textit{}. -\item \macro{ETIMEDOUT} \textit{}. -\item \macro{ECONNREFUSED} \textit{}. - -\item \macro{ELOOP} ci sono troppi link simbolici nella risoluzione di un - pathname. - -\item \macro{ENAMETOOLONG} si è indicato un pathname troppo lungo. - -\item \macro{EHOSTDOWN} \textit{}. -\item \macro{EHOSTUNREACH} \textit{}. -\item \macro{ENOTEMPTY} \textit{}. +\item \macro{EWOULDBLOCK} \textit{Operation would block}. In Linux è identico + a \macro{EAGAIN}. +\item \macro{EINPROGRESS} \textit{Operation now in progress}. +\item \macro{EALREADY} \textit{Operation already in progress}. +\item \macro{ENOTSOCK} \textit{Socket operation on non-socket}. +\item \macro{EMSGSIZE} \textit{Message too long}. +\item \macro{EPROTOTYPE} \textit{Protocol wrong type for socket}. +\item \macro{ENOPROTOOPT} \textit{Protocol not available}. +\item \macro{EPROTONOSUPPORT} \textit{Protocol not supported}. +\item \macro{ESOCKTNOSUPPORT} \textit{Socket type not supported}. +\item \macro{EOPNOTSUPP} \textit{Operation not supported on transport endpoint}. +\item \macro{EPFNOSUPPORT} \textit{Protocol family not supported}. +\item \macro{EAFNOSUPPORT} \textit{Address family not supported by protocol}. +\item \macro{EADDRINUSE} \textit{Address already in use}. +\item \macro{EADDRNOTAVAIL} \textit{Cannot assign requested address}. +\item \macro{ENETDOWN} \textit{Network is down}. +\item \macro{ENETUNREACH} \textit{Network is unreachable}. +\item \macro{ENETRESET} \textit{Network dropped connection because of reset}. +\item \macro{ECONNABORTED} \textit{Software caused connection abort}. +\item \macro{ECONNRESET} \textit{Connection reset by peer}. +\item \macro{ENOBUFS} \textit{No buffer space available}. +\item \macro{EISCONN} \textit{Transport endpoint is already connected}. +\item \macro{ENOTCONN} \textit{Transport endpoint is not connected}. +\item \macro{EDESTADDRREQ} \textit{Destination address required}. +\item \macro{ESHUTDOWN} \textit{Cannot send after transport endpoint shutdown}. +\item \macro{ETOOMANYREFS} \textit{Too many references: cannot splice}. +\item \macro{ETIMEDOUT} \textit{Connection timed out}. +\item \macro{ECONNREFUSED} \textit{Connection refused}. + +\item \macro{ELOOP} \textit{Too many symbolic links encountered}. ci sono + troppi link simbolici nella risoluzione di un pathname. + +\item \macro{ENAMETOOLONG} \textit{File name too long}. si è indicato un + pathname troppo lungo. + +\item \macro{EHOSTDOWN} \textit{Host is down}. +\item \macro{EHOSTUNREACH} \textit{No route to host}. +\item \macro{ENOTEMPTY} \textit{Directory not empty}. \item \macro{EPROCLIM} \textit{}. -\item \macro{EUSERS} \textit{}. -\item \macro{EDQUOT} \textit{}. -\item \macro{ESTALE} \textit{}. +\item \macro{EUSERS} \textit{Too many users}. +\item \macro{EDQUOT} \textit{Quota exceeded}. +\item \macro{ESTALE} \textit{Stale NFS file handle}. \item \macro{EREMOTE} \textit{}. \item \macro{EBADRPC} \textit{}. \item \macro{ERPCMISMATCH} \textit{}. @@ -135,73 +133,68 @@ libreria che operano sui file. \item \macro{ENEEDAUTH} \textit{}. \item \macro{ENOSYS} \textit{Function not implemented}. \item \macro{ENOTSUP} \textit{Not supported}. -\item \macro{EILSEQ} \textit{}. +\item \macro{EILSEQ} \textit{Illegal byte sequence}. \item \macro{EBACKGROUND} \textit{}. \item \macro{EDIED} \textit{}. \item \macro{ED} \textit{}. \item \macro{EGREGIOUS} \textit{}. \item \macro{EIEIO} \textit{}. \item \macro{EGRATUITOUS} \textit{}. -\item \macro{EBADMSG} \textit{}. -\item \macro{EIDRM} \textit{}. -\item \macro{EMULTIHOP} \textit{}. -\item \macro{ENODATA} \textit{}. -\item \macro{ENOLINK} \textit{}. -\item \macro{ENOMSG} \textit{}. -\item \macro{ENOSR} \textit{}. -\item \macro{ENOSTR} \textit{}. -\item \macro{EOVERFLOW} \textit{}. -\item \macro{EPROTO} \textit{}. -\item \macro{ETIME} \textit{}. +\item \macro{EBADMSG} \textit{Not a data message}. +\item \macro{EIDRM} \textit{Identifier removed}. +\item \macro{EMULTIHOP} \textit{Multihop attempted}. +\item \macro{ENODATA} \textit{No data available}. +\item \macro{ENOLINK} \textit{Link has been severed}. +\item \macro{ENOMSG} \textit{No message of desired type}. +\item \macro{ENOSR} \textit{Out of streams resources}. +\item \macro{ENOSTR} \textit{Device not a stream}. +\item \macro{EOVERFLOW} \textit{Value too large for defined data type}. +\item \macro{EPROTO} \textit{Protocol error}. +\item \macro{ETIME} \textit{Timer expired}. \section{Errori del kernel} \label{sec:err_kernel_err} -\item \macro{ERESTART} \textit{}. -\item \macro{ECHRNG} \textit{}. -\item \macro{EL2NSYNC} \textit{}. -\item \macro{EL3HLT} \textit{}. -\item \macro{EL3RST} \textit{}. -\item \macro{ELNRNG} \textit{}. -\item \macro{EUNATCH} \textit{}. -\item \macro{ENOCSI} \textit{}. -\item \macro{EL2HLT} \textit{}. -\item \macro{EBADE} \textit{}. -\item \macro{EBADR} \textit{}. -\item \macro{EXFULL} \textit{}. -\item \macro{ENOANO} \textit{}. -\item \macro{EBADRQC} \textit{}. -\item \macro{EBADSLT} \textit{}. -\item \macro{EDEADLOCK} \textit{}. -\item \macro{EBFONT} \textit{}. -\item \macro{ENONET} \textit{}. -\item \macro{ENOPKG} \textit{}. -\item \macro{EADV} \textit{}. -\item \macro{ESRMNT} \textit{}. -\item \macro{ECOMM} \textit{}. -\item \macro{EDOTDOT} \textit{}. -\item \macro{ENOTUNIQ} \textit{}. -\item \macro{EBADFD} \textit{}. -\item \macro{EREMCHG} \textit{}. -\item \macro{ELIBACC} \textit{}. -\item \macro{ELIBBAD} \textit{}. -\item \macro{ELIBSCN} \textit{}. -\item \macro{ELIBMAX} \textit{}. -\item \macro{ELIBEXEC} \textit{}. -\item \macro{ESTRPIPE} \textit{}. -\item \macro{EUCLEAN} \textit{}. -\item \macro{ENAVAIL} \textit{}. -\item \macro{EISNAM} \textit{}. -\item \macro{EREMOTEIO} \textit{}. -\item \macro{ENOMEDIUM} \textit{}. -\item \macro{EMEDIUMTYPE} \textit{}. -\item \macro{} \textit{}. -\item \macro{} \textit{}. -\item \macro{} \textit{}. -\item \macro{} \textit{}. -\item \macro{} \textit{}. +\item \macro{ERESTART/} \textit{Interrupted system call should be restarted}. +\item \macro{ECHRNG} \textit{Channel number out of range}. +\item \macro{EL2NSYNC} \textit{Level 2 not synchronized}. +\item \macro{EL3HLT} \textit{Level 3 halted}. +\item \macro{EL3RST} \textit{Level 3 reset}. +\item \macro{ELNRNG} \textit{Link number out of range}. +\item \macro{EUNATCH} \textit{Protocol driver not attached}. +\item \macro{ENOCSI} \textit{No CSI structure available}. +\item \macro{EL2HLT} \textit{Level 2 halted}. +\item \macro{EBADE} \textit{Invalid exchange}. +\item \macro{EBADR} \textit{Invalid request descriptor}. +\item \macro{EXFULL} \textit{Exchange full}. +\item \macro{ENOANO} \textit{No anode}. +\item \macro{EBADRQC} \textit{Invalid request code}. +\item \macro{EBADSLT} \textit{Invalid slot}. +\item \macro{EDEADLOCK} Identico a \macro{EDEADLK}. +\item \macro{EBFONT} \textit{Bad font file format}. +\item \macro{ENONET} \textit{Machine is not on the network}. +\item \macro{ENOPKG} \textit{Package not installed}. +\item \macro{EADV} \textit{Advertise error}. +\item \macro{ESRMNT} \textit{Srmount error}. +\item \macro{ECOMM} \textit{Communication error on send}. +\item \macro{EDOTDOT} \textit{RFS specific error}. +\item \macro{ENOTUNIQ} \textit{Name not unique on network}. +\item \macro{EBADFD} \textit{File descriptor in bad state}. +\item \macro{EREMCHG} \textit{Remote address changed}. +\item \macro{ELIBACC} \textit{Can not access a needed shared library}. +\item \macro{ELIBBAD} \textit{Accessing a corrupted shared library}. +\item \macro{ELIBSCN} \textit{.lib section in a.out corrupted}. +\item \macro{ELIBMAX} \textit{Attempting to link in too many shared libraries}. +\item \macro{ELIBEXEC} \textit{Cannot exec a shared library directly}. +\item \macro{ESTRPIPE} \textit{Streams pipe error}. +\item \macro{EUCLEAN} \textit{Structure needs cleaning}. +\item \macro{ENAVAIL} \textit{No XENIX semaphores available}. +\item \macro{EISNAM} \textit{Is a named type file}. +\item \macro{EREMOTEIO} \textit{Remote I/O error}. +\item \macro{ENOMEDIUM} \textit{No medium found}. +\item \macro{EMEDIUMTYPE} \textit{Wrong medium type}. \item \macro{} \textit{}. diff --git a/filedir.tex b/filedir.tex index f6ad01f..cbd718b 100644 --- a/filedir.tex +++ b/filedir.tex @@ -22,10 +22,10 @@ le funzioni usate per gestirne i vari aspetti. \subsection{I permessi per l'accesso ai file} \label{sec:file_perm_overview} -Il controllo di accesso ai file in unix segue un modello abbastanza semplice, -ma adatto alla gran parte delle esigenze, in cui si dividono i permessi su tre -livelli. Si tenga conto poi che quanto diremo è vero solo per filesystem di -tipo unix, e non è detto che sia applicabile a un filesystem +Il controllo di accesso ai file in unix segue un modello abbastanza semplice +(ma adatto alla gran parte delle esigenze) in cui si dividono i permessi su +tre livelli. Si tenga conto poi che quanto diremo è vero solo per filesystem +di tipo unix, e non è detto che sia applicabile a un filesystem qualunque\footnote{ed infatti non è vero per il filesystem vfat di Windows, per il quale i permessi vengono assegnati in maniera fissa con un opzione in fase di montaggio}. Esistono inoltre estensioni che permettono di diff --git a/prochand.tex b/prochand.tex index b337e4d..e7db230 100644 --- a/prochand.tex +++ b/prochand.tex @@ -131,10 +131,10 @@ processo il processo di avvio (init) ha sempre il pid uguale a uno. Ogni processo è identificato univocamente dal sistema per il suo pid; quest'ultimo è un tipo di dato standard, il \texttt{pid\_t} che in genere è un intero con segno (nel caso di Linux e delle glibc il tipo usato è -\texttt{int}). +\type{int}). Tutti i processi inoltre portano traccia del pid del genitore, chiamato in -genere \textit{ppid} (da \textit{Parente Process Id}). Questi identificativi +genere \textit{ppid} (da \textit{parent process id}). Questi identificativi possono essere ottenuti da un programma usando le funzioni: \begin{functions} \headdecl{sys/types.h} @@ -142,9 +142,36 @@ possono essere ottenuti da un programma usando le funzioni: \funcdecl{pid\_t getpid(void)} restituisce il pid del processo corrente. \funcdecl{pid\_t getppid(void)} restituisce il pid del padre del processo corrente. -\end{functions} +Entrambe le funzioni non riportano condizioni di errore. +\end{functions} +Come accennato in \secref{sec:file_perm_overview} ciascun processo porta con +se un gruppo di identificatori (riportati in \ntab) che indicano l'utente che +lo ha posto in esecuzione, e sono usati per il controllo di accesso. + + +\begin{table}[htb] + \centering + \begin{tabular}[c]{|c|l|l|} + \hline + Sigla & Significato & Utilizzo \\ + \hline + \hline + \acr{ruid} & \textit{real user id} & indica l'utente reale \\ + \acr{rgid} & \textit{real group id} & indica il gruppo reale \\ + \acr{euid} & \textit{effective user id} & indica l'utente reale \\ + \acr{egid} & \textit{effective group id} & indica il gruppo reale \\ + & \textit{supplementaru group id} & indica il gruppo \\ + \acr{suid} & \textit{saved user id} & indica l'utente reale \\ + \acr{sgid} & \textit{daved group id} & indica il gruppo reale \\ + \acr{fsuid} & \textit{real user id} & indica l'utente reale \\ + \acr{fsgid} & \textit{real group id} & indica il gruppo reale \\ + \hline + \end{tabular} + \caption{Identificatori di utente e gruppo associati a ciascun processo.} + \label{tab:proc_uid_gid} +\end{table} \subsection{La funzione \func{fork}} \label{sec:proc_fork} -- 2.30.2