Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ endmntent(3) — sys5 — Apollo Domain/OS SR10.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fopen(3S)

fstab(4)

mnttab(4)

GETMNTENT(3)                         SysV                         GETMNTENT(3)



NAME
     getmntent, setmntent, addmntent, endmntent - fstab, mnttab manipulation
     routines

SYNOPSIS
     #include <stdio.h>
     #include <sys/types.h>
     #include <mnttab.h>

     FILE *setmntent(file)
     int file;

     struct mntent *getmntent(file)
     int file;

     int addmntent(ent)
     struct mntent *ent;

     int endmntent(file)
     int file;

DESCRIPTION
     setmntent opens the file indicated by file for reading, where file can be
     either MNTTAB_FILE for /etc/mnttab or FSTAB_FILE for /etc/fstab.  If the
     file indicated by file was already open, setmntent closes and then
     reopens it.

     getmntent returns a pointer to an object with the following structure
     containing the broken-out fields of a line in the file indicated by file.
     The fields have meanings described in fstab(4).

          struct mntent{
                 char   *mnt_fsname; /* name of mounted file system */
                 char   *mnt_dir;    /* file system path prefix */
                 char   *mnt_type;   /* MNTTYPE_* */
                 char   *mnt_opts;   /* MNTOPT* */
                 time_t mnt_time;    /* Time of mount */
                 int    mnt_freq;    /* dump frequency, in days */
                 int    mnt_passno;  /* pass number on parallel fsck */
          };

     addmntent adds the structure pointed to by ent to the end of /etc/mnttab.
     addmntent works only when file is set to MNTTAB_FILE.  endmntent closes
     the file indicated by file.

FILES
     /etc/fstab    file system table
     /etc/mnttab   mounted file system table

SEE ALSO
     fopen(3S), fstab(4), mnttab(4).

DIAGNOSTICS
     These routines return the NULL pointer on EOF or error.  setmntent
     returns 1 if it opens the file indicated by file successfully.

BUGS
     All information is contained in a static area, so it must be copied if it
     is to be saved.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026