1 /* Utilities for reading/writing fstab, mtab, etc.
2 Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public License as
7 published by the Free Software Foundation; either version 2 of the
8 License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
15 You should have received a copy of the GNU Library General Public
16 License along with the GNU C Library; see the file COPYING.LIB. If not,
17 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. */
29 /* File listing canonical interesting mount points. */
30 #define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
32 /* File listing currently active mount points. */
33 #define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
36 /* General filesystem types. */
37 #define MNTTYPE_IGNORE "ignore" /* Ignore this entry. */
38 #define MNTTYPE_NFS "nfs" /* Network file system. */
39 #define MNTTYPE_SWAP "swap" /* Swap device. */
42 /* Generic mount options. */
43 #define MNTOPT_DEFAULTS "defaults" /* Use all default options. */
44 #define MNTOPT_RO "ro" /* Read only. */
45 #define MNTOPT_RW "rw" /* Read/write. */
46 #define MNTOPT_SUID "suid" /* Set uid allowed. */
47 #define MNTOPT_NOSUID "nosuid" /* No set uid allowed. */
48 #define MNTOPT_NOAUTO "noauto" /* Do not auto mount. */
53 /* Structure describing a mount table entry. */
56 char *mnt_fsname
; /* Device or server for filesystem. */
57 char *mnt_dir
; /* Directory mounted on. */
58 char *mnt_type
; /* Type of filesystem: ufs, nfs, etc. */
59 char *mnt_opts
; /* Comma-separated options for fs. */
60 int mnt_freq
; /* Dump frequency (in days). */
61 int mnt_passno
; /* Pass number for `fsck'. */
65 /* Prepare to begin reading and/or writing mount table entries from the
66 beginning of FILE. MODE is as for `fopen'. */
67 extern FILE *__setmntent
__P ((__const
char *__file
, __const
char *__mode
));
68 extern FILE *setmntent
__P ((__const
char *__file
, __const
char *__mode
));
70 /* Read one mount table entry from STREAM. Returns a pointer to storage
71 reused on the next call, or null for EOF or error (use feof/ferror to
73 extern struct mntent
*getmntent
__P ((FILE *__stream
));
76 /* Reentrant version of the above function. */
77 extern struct mntent
*__getmntent_r
__P ((FILE *__stream
,
78 struct mntent
*__result
,
79 char *__buffer
, int __bufsize
));
80 extern struct mntent
*getmntent_r
__P ((FILE *__stream
,
81 struct mntent
*__result
,
82 char *__buffer
, int __bufsize
));
85 /* Write the mount table entry described by MNT to STREAM.
86 Return zero on success, nonzero on failure. */
87 extern int __addmntent
__P ((FILE *__stream
, __const
struct mntent
*__mnt
));
88 extern int addmntent
__P ((FILE *__stream
, __const
struct mntent
*__mnt
));
90 /* Close a stream opened with `setmntent'. */
91 extern int __endmntent
__P ((FILE *__stream
));
92 extern int endmntent
__P ((FILE *__stream
));
94 /* Search MNT->mnt_opts for an option matching OPT.
95 Returns the address of the substring, or null if none found. */
96 extern char *__hasmntopt
__P ((__const
struct mntent
*__mnt
,
97 __const
char *__opt
));
98 extern char *hasmntopt
__P ((__const
struct mntent
*__mnt
,
99 __const
char *__opt
));
104 #endif /* mntent.h */