MirBSD manpage: endfsent(3), getfsent(3), getfsfile(3), getfsspec(3), getfstype(3), setfsent(3)

GETFSENT(3)                BSD Programmer's Manual                 GETFSENT(3)

NAME

     getfsent, getfsspec, getfsfile, setfsent, endfsent - get filesystem
     descriptor file entry

SYNOPSIS

     #include <fstab.h>

     struct fstab *
     getfsent(void);

     struct fstab *
     getfsspec(const char *spec);

     struct fstab *
     getfsfile(const char *file);

     int
     setfsent(void);

     void
     endfsent(void);

DESCRIPTION

     The getfsent(), getfsspec(), and getfsfile() functions each return a
     pointer to an object with the following structure containing the broken-
     out fields of a line in the filesystem description file, <fstab.h>.

           struct fstab {
                   char    *fs_spec;       /* block special device name */
                   char    *fs_file;       /* filesystem path prefix */
                   char    *fs_vfstype;    /* type of filesystem */
                   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 fsck */
           };

     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.

     The getfsspec() and getfsfile() functions search the entire file (opening
     it if necessary) for a matching special file name or filesystem 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 ig-
     nored.

RETURN VALUES

     The getfsent(), getfsspec(), and getfsfile() functions return a null
     pointer on EOF or error. The setfsent() function returns 0 on failure or
     1 on success. The endfsent() function returns nothing.

FILES

     /etc/fstab  filesystem table

SEE ALSO

     fstab(5)

HISTORY

     The getfsent() function appeared in 4.0BSD; the endfsent(), getfsfile(),
     getfsspec(), and setfsent() functions appeared in 4.3BSD.

BUGS

     These functions use static data storage; if the data is needed for future
     use, it should be copied before any subsequent calls overwrite it.

MirBSD #10-current               June 4, 1993                                1

Generated on 2021-12-07 11:07:08 by $MirOS: src/scripts/roff2htm,v 1.103 2021/01/23 20:24:35 tg Exp $ — This product includes material provided by mirabilos.

These manual pages and other documentation are copyrighted by their respective writers; their sources are available at the project’s CVSweb, AnonCVS and other mirrors. The rest is Copyright © 2002–2021 MirBSD.

This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report — diffs preferred.