xref: /original-bsd/lib/libc/gen/getfsent.3 (revision 252ddc1c)
Copyright (c) 1983 The Regents of the University of California.
All rights reserved.

%sccs.include.redist.man%

@(#)getfsent.3 6.8 (Berkeley) 06/23/90

GETFSENT 3 ""
C 4
NAME
getfsent, getfsspec, getfsfile, setfsent, endfsent - get file system descriptor file entry
SYNOPSIS
 #include <fstab.h> 

struct fstab *getfsent()

struct fstab *getfsspec(spec) char *spec;

struct fstab *getfsfile(file) char *file;

int setfsent()

void endfsent()

DESCRIPTION
Getfsent , getfsspec , and getfsfile each return a pointer to an object with the following structure containing the broken-out fields of a line in the file system description file, < fstab.h >.

struct fstab {
 char *fs_spec; /* block special device name */
 char *fs_file; /* file system path prefix */
 char *fs_vfstype; /* type of file system */
 char *fs_mntops; /* comma separated mount options */
 char *fs_type; /* rw, ro, sw, or xx */
 int fs_freq; /* dump frequency, in days */
 int fs_passno; /* pass number on parallel dump */
};

The fields have meanings described in fstab (5).

Setfsent opens the file (closing any previously opened file) or rewinds it if it is already open.

Endfsent closes the file.

Getfsspec and getfsfile search the entire file (opening it if necessary) for a matching special file name or file system file name.

For programs wishing to read the entire database, getfsent reads the next entry (opening the file if necessary).

All entries in the file with a type field equivalent to FSTAB_XX are ignored.

FILES
/etc/fstab
"SEE ALSO"
fstab(5)
DIAGNOSTICS
Getfsent , getfsspec , and getfsfile return a null pointer (0) on EOF or error. Setfsent returns 0 on failure, 1 on success. Endfsent returns nothing.
BUGS
All information is contained in a static area so it must be copied if it is to be saved.