delorie.com/djgpp/doc/libc/libc_706.html
|
search
|
libc.a reference
setmntent
Syntax
| #include <mntent.h>
FILE *setmntent(char *filename, const char *mode);
|
Description
This function returns an open FILE*
pointer which can be used by
getmntent
(see section getmntent). The arguments filename and
mode are always ignored under MS-DOS, but for portability should
be set, accordingly, to the name of the file which describes the mounted
filesystems and the open mode of that file (like the mode argument
to fopen
, see section fopen). (There is no single standard for the
name of the file that keeps the mounted filesystems, but it is usually,
although not always, listed in the header <mntent.h>
.)
Return Value
The FILE*
pointer is returned. For MS-DOS, this FILE*
is
not a real pointer and may only be used by getmntent
.
Portability
Example
| #include <mntent.h>
#if defined(MNT_MNTTAB)
#define MNTTAB_FILE MNT_MNTTAB
#elif defined(MNTTABNAME)
#define MNTTAB_FILE MNTTABNAME
#else
#define MNTTAB_FILE "/etc/mnttab"
#endif
FILE *mnt_fp = setmntent (MNTTAB_FILE, "r");
|