From: Simone Piccardi Date: Thu, 10 Jan 2002 23:26:15 +0000 (+0000) Subject: Proseguito con mount e statfs X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=commitdiff_plain;h=707eaacf08258c80e480b416856bcba020d0a0a6 Proseguito con mount e statfs --- diff --git a/system.tex b/system.tex index 55d09ee..aa60c2a 100644 --- a/system.tex +++ b/system.tex @@ -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}