Sun Dec 17 15:56:35 1995 Miles Bader <miles@gnu.ai.mit.edu>
[glibc.git] / misc / mntent.h
blob99fa56ded4fe3f851d54448f29abbd2e9caa5aba
1 /* <mntent.h> -- Utilities for reading/writing fstab, mtab, etc.
2 Copyright (C) 1995 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
17 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18 Cambridge, MA 02139, USA. */
20 #ifndef _MNTENT_H
21 #define _MNTENT_H 1
23 #include <features.h>
24 #define __need_FILE
25 #include <stdio.h>
28 /* File listing canonical interesting mount points. */
29 #define _PATH_MNTTAB "/etc/fstab"
30 #define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
32 /* File listing currently active mount points. */
33 #define _PATH_MOUNTED "/var/run/mtab"
34 #define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
37 __BEGIN_DECLS
39 /* Structure describing a mount table entry. */
40 struct mntent
42 char *mnt_fsname; /* Device or server for filesystem. */
43 char *mnt_dir; /* Directory mounted on. */
44 char *mnt_type; /* Type of filesystem: ufs, nfs, etc. */
45 char *mnt_opts; /* Comma-separated options for fs. */
46 int mnt_freq; /* Dump frequency (in days). */
47 int mnt_passno; /* Pass number for `fsck'. */
51 /* Prepare to begin reading and/or writing mount table entries from the
52 beginning of FILE. MODE is as for `fopen'. */
53 extern FILE *setmntent __P ((__const char *__file,
54 __const char *__mode));
56 /* Read one mount table entry from STREAM. Returns a pointer to storage
57 reused on the next call, or null for EOF or error (use feof/ferror to
58 check). */
59 extern struct mntent *getmntent __P ((FILE *__stream));
61 /* Write the mount table entry described by MNT to STREAM.
62 Return zero on success, nonzero on failure. */
63 extern int addmntent __P ((FILE *__stream,
64 __const struct mntent *__mnt));
66 /* Close a stream opened with `setmntent'. */
67 extern int endmntent __P ((FILE *__stream));
69 /* Search MNT->mnt_opts for an option matching OPT.
70 Returns the address of the substring, or null if none found. */
71 extern char *hasmntopt __P ((__const struct mntent *__mnt,
72 __const char *__opt));
75 __END_DECLS
77 #endif /* mntent.h */