Proseguito con mount e statfs
[gapil.git] / system.tex
index 55d09eec1d56e3b8dd85c93cfb782d35ceab8751..aa60c2a187e9655ab62c068b09cda910deaba1a5 100644 (file)
@@ -624,8 +624,9 @@ del kernel, nella directory \file{Documentation/sysctl}.
 Come accennato in \secref{sec:file_organization} per poter accedere ai file
 occorre prima rendere disponibile al sistema il filesystem su cui essi sono
 memorizzati; l'operazione di attivazione del filesystem è chiamata
-\textsl{montaggio}, per far questo si usa la funzione \func{mount} il cui
-prototipo è:
+\textsl{montaggio}, per far questo in Linux\footnote{la funzione è specifica
+  di Linux e non è portabile} si usa la funzione \func{mount} il cui prototipo
+è:
 \begin{prototype}{sys/mount.h}
 {mount(const char *source, const char *target, const char *filesystemtype, 
   unsigned long mountflags, const void *data)}
@@ -661,11 +662,33 @@ sulla directory \param{target}.
   \macro{ENAMETOOLONG}, \macro{ENOENT} o \macro{ELOOP}.}
 \end{prototype}
 
+La funzione monta sulla directory \param{target} il filesystem contenuto in
+\param{source}, di norma questo è un file di dispositivo, ma può anche essere
+un file normale che contiene un filesystem, (che può essere montato \textit{in
+  loopback}).
+
 
 
+Due funzioni, utili per ottenere in maniera diretta informazioni riguardo al
+filesystem su cui si trova un certo file, sono \func{statfs} e \func{fstatfs},
+i cui prototipi sono:
+\begin{functions}
+  \headdecl{sys/vfs.h} \funcdecl{int statfs(const char *path, struct statfs
+    *buf)} \funcdecl{int fstatfs(int fd, struct statfs *buf)} Restituisce in
+  \param{buf} le informazioni relative al filesystem su cui è posto il file
+  specificato.
+
+\bodydesc{La funzione restituisce 0 in caso di successo e -1 in caso di
+  errore, nel qual caso \var{errno} viene settato ai valori:
+  \begin{errlist}
+  \item[\macro{ENOSYS}] il filesystem su cui si trova il file specificato non
+  supporta la funzione.
+  \end{errlist}
+  e \macro{EFAULT} ed \macro{EIO} per entrambe, \macro{EBADF} per
+  \func{fstatfs}, \macro{ENOTDIR}, \macro{ENAMETOOLONG}, \macro{ENOENT},
+  \macro{EACCES}, \macro{ELOOP} per \func{statfs}.}
+\end{functions}
 
-\subsection{La funzione \func{statfs}}
-\label{sec:sys_file_stafs}
 
 
 \subsection{La gestione di utenti e gruppi}