setmntent -- (deprecated)


#include <stdio.h>
#include <mntent.hgrt;

FILE *setmntent(const char *filename, const char *type);


setmntent is expected to disappear from a future version of the LSB; applications should avoid its use. [1]

setnmtent accesses the file system description file /etc/fstab and the mounted file system description file /etc/mtab.

setmntent opens the file system description file filep and returns a file pointer that can be used by getmntent. type is the type of access required and can take the same values as the mode argument of fopen(3).

The mntent structure is defined in mntent.h as follows:
  struct mntent {
             char  *mnt_fsname;  /* name of mounted file system */
             char  *mnt_dir;     /* file system path prefix */
             char  *mnt_type;    /* mount type (see mntent.h) */
             char  *mnt_opts;    /* mount options (see mntent.h) */
             int   mnt_freq;     /* dump frequency in days */
             int   mnt_passno;   /* pass number on parallel fsck */


/etc/fstab file system description file /etc/mtab mounted file system description file



setmntent is believed to be mainly of interest to system administration packages. Most other uses can be accomplished in better ways (for example, compare st_dev values to detect crossing a file system or call statvfs to check available space on the file system containing a particular directory). In addition the specification that the LSB has had for setmntent is incomplete; for example it is of little use without the missing function getmntent.