The internal representation for entries of the file is struct
fstab
, defined in `fstab.h'.
getfsent
, getfsspec
, and
getfsfile
functions.
char *fs_spec
const
it shouldn't be
modified. The missing const
has historic reasons, since this
function predates ISO C. The same is true for the other string
elements of this structure.
char *fs_file
char *fs_vfstype
char *fs_mntops
mount
call. Again, this can be almost anything. There can be
more than one option, separated from the others by a comma. Each option
consists of a name and an optional value part, introduced by an =
character.
If the value of this element must be processed it should ideally be done
using the getsubopt
function; see section Parsing of Suboptions.
const char *fs_type
fs_mntops
string) which describes the modes with which the
filesystem is mounted. `fstab' defines five macros to describe the
possible values:
FSTAB_RW
FSTAB_RQ
FSTAB_RO
FSTAB_SW
FSTAB_XX
strcmp
since these are all strings. Comparing the pointer will probably always
fail.
int fs_freq
int fs_passno
dump
utility used on Unix systems.
To read the entire content of the of the `fstab' file the GNU libc contains a set of three functions which are designed in the usual way.
Since the file handle is internal to the libc this function is not thread-safe.
This function returns a non-zero value if the operation was successful
and the getfs*
functions can be used to read the entries of the
file.
setfsent
(explicitly or implicitly by calling getfsent
) are
freed.
endfsent
, the file will be
opened.
The function returns a pointer to a variable of type struct
fstab
. This variable is shared by all threads and therefore this
function is not thread-safe. If an error occurred getfsent
returns a NULL
pointer.
fs_spec
element.
Since there is normally exactly one entry for each special device it
makes no sense to call this function more than once for the same
argument. If this is the first call to any of the functions handling
`fstab' since program start or the last call of endfsent
,
the file will be opened.
The function returns a pointer to a variable of type struct
fstab
. This variable is shared by all threads and therefore this
function is not thread-safe. If an error occurred getfsent
returns a NULL
pointer.
fs_file
element.
Since there is normally exactly one entry for each mount point it
makes no sense to call this function more than once for the same
argument. If this is the first call to any of the functions handling
`fstab' since program start or the last call of endfsent
,
the file will be opened.
The function returns a pointer to a variable of type struct
fstab
. This variable is shared by all threads and therefore this
function is not thread-safe. If an error occurred getfsent
returns a NULL
pointer.
Go to the first, previous, next, last section, table of contents.