Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ hasmntopt(3) — A/UX 3.0.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fstab(4)

mtab(4)




getmntent(3) getmntent(3)
NAME setmntent, getmntent, addmntent, endmntent, hasmntopt - get file system descriptor file entry SYNOPSIS #include <stdio.h> #include <mntent.h> FILE *setmntent(filep, type) char *filep; char *type; struct mntent *getmntent(filep) FILE *filep; int addmntent(filep, mnt) FILE *filep; struct mntent *mnt; char *hasmntopt(mnt, opt) struct mntent *mnt; char *opt; int endmntent(filep) FILE *filep; DESCRIPTION These routines replace the getfsent(3) routines for accessing the file system description file /etc/fstab, and the mounted file system description file /etc/mtab. setmntent opens a file system description file and returns a file pointer for use with getmntent, addmntent, or endmntent. The type argument is the same as in fopen(3). getmntent reads the next line from filep and returns a pointer to an object with the following structure containing broken-out fields of a line in the file system description file, <mntent.h>. The fields have meanings described in fstab(4). struct mntent { char *mnt_fsname; /* file system name */ char *mnt_dir; /* file system path prefix */ char *mnt_type; /* 4.2, 5.2, nfs, swap, or ignore */ char *mnt_opts; /* ro, rw, quota, noquota, hard, soft */ int mnt_freq; /* dump frequency, in days */ int mnt_passno; /* pass number on parallel fsck */ }; addmntent adds the mntent structure mnt to the end of the open file filep. Note that filep has to be opened for writing if this is to work. hasmntopt scans the mnt_opts January 1992 1



getmntent(3) getmntent(3)
field of the mntent structure mnt for a substring that matches opt. It returns the address of the substring if a match is found, 0 otherwise. endmntent closes the file. STATUS MESSAGES AND VALUES A null pointer (0) is returned on EOF or error. LIMITATIONS The returned mntent structure points to static information that is overwritten in each call. FILES /etc/fstab File containing file system table /etc/mtab File containing mount table SEE ALSO fstab(4), mtab(4) 2 January 1992

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