*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> getmntent (3c)              
Title
Content
Arch
Section
 

Contents


GETMNTENT(3)							  GETMNTENT(3)


NAME    [Toc]    [Back]

     setmntent,	getmntent, addmntent, getmntany, endmntent, hasmntopt -	get
     file system descriptor file entry

SYNOPSIS    [Toc]    [Back]

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

     FILE *setmntent(char *filep, char *type);

     struct mntent *getmntent(FILE *filep);

     int addmntent(FILE	*filep,	struct mntent *mnt);

     int getmntany (FILE *filep, struct	mntent *mp, struct mntent *mpref);

     char *hasmntopt(struct mntent *mnt, char *opt);

     int endmntent(FILE	*filep);

DESCRIPTION    [Toc]    [Back]

     These routines replace the	getfsent routines for accessing	the file
     system description	file /etc/fstab.  They are also	used to	access the
     mounted file system description file /etc/mtab.

     Setmntent opens a file system description file and	returns	a file pointer
     which can then be used with getmntent, addmntent, getmntany, or
     endmntent.	 The type argument is the same as in fopen(3S).

     Getmntent reads the next line from	filep and returns a pointer to an
     object with the following structure containing the	broken-out fields of a
     line in the filesystem 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;	   /* dbg, efs,	nfs */
	       char *mnt_opts;	   /* ro, hide,	etc. */
	       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.
     Addmntent returns 0 if successful,	otherwise it returns 1.

     Getmntany searches	the file referenced by fp until	a match	is found
     between a line in the file	and mpref.  Mpref matches the line if all
     non-null entries in mpref match the corresponding fields in the file.
     Note that option string matching is performed by matching the entire



									Page 1






GETMNTENT(3)							  GETMNTENT(3)



     option string, not	by matching indivudual option substrings.  If a	match
     is	found, the matching entry is copied to the area	pointed	by by mp, and
     getmntany returns 0.  Otherwise, -1 is returned.

     Hasmntopt scans the mnt_opts 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 and always returns 1.

FILES    [Toc]    [Back]

     /etc/fstab
     /etc/mtab

SEE ALSO    [Toc]    [Back]

      
      
     delmntent(3), fstab(4)

BUGS    [Toc]    [Back]

     The returned mntent structure points to static information	that is
     overwritten in each call.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
fattach Tru64 Attach a STREAMS-based file descriptor to a file in the file system name space
fdetach Tru64 Detach a STREAMS-based file descriptor from a file in the file system name space
mount_fdesc OpenBSD mount the file-descriptor file system
fdescfs FreeBSD file-descriptor file system
pxfisatty IRIX Determines if file descriptor corresponds to a valid file descriptor
AFopenfile IRIX allocate an AFfilehandle structure for an audio file identified by name / by a Unix file descriptor
AFidentifyfd IRIX retrieve the audio file format of a file descriptor / open AFfilehandle
dirent IRIX file system independent directory entry
fdetach Tru64 Detaches a STREAMS-based file descriptor from a file
isfdtype Tru64 Test a file descriptor for a specific file type
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service