]> git.ipfire.org Git - thirdparty/glibc.git/blame - misc/mntent.h
Tue Sep 12 14:30:07 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
[thirdparty/glibc.git] / misc / mntent.h
CommitLineData
7a770247
RM
1/* <mntent.h> -- Utilities for reading/writing fstab, mtab, etc.
2Copyright (C) 1995 Free Software Foundation, Inc.
3This file is part of the GNU C Library.
4
5The GNU C Library is free software; you can redistribute it and/or
6modify it under the terms of the GNU Library General Public License as
7published by the Free Software Foundation; either version 2 of the
8License, or (at your option) any later version.
9
10The GNU C Library is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13Library General Public License for more details.
14
15You should have received a copy of the GNU Library General Public
16License along with the GNU C Library; see the file COPYING.LIB. If
17not, write to the Free Software Foundation, Inc., 675 Mass Ave,
18Cambridge, MA 02139, USA. */
19
20#ifndef _MNTENT_H
21#define _MNTENT_H 1
22
23#include <features.h>
24#define __need_FILE
25#include <stdio.h>
26
27
28/* File listing canonical interesting mount points. */
29#define _PATH_MNTTAB "/etc/fstab"
30#define MNTTAB _PATH_MNTTAB /* Deprecated alias. */
31
32/* File listing currently active mount points. */
33#define _PATH_MOUNTED "/var/run/mtab"
34#define MOUNTED _PATH_MOUNTED /* Deprecated alias. */
35
36
37__BEGIN_DECLS
38
39/* Structure describing a mount table entry. */
40struct mntent
41 {
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'. */
48 };
49
50
51/* Prepare to begin reading and/or writing mount table entries from the
52 beginning of FILE. MODE is as for `fopen'. */
53extern FILE *setmntent __P ((__const char *__file,
54 __const char *__mode));
55
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). */
59extern struct mntent *getmntent __P ((FILE *__stream));
60
61/* Write the mount table entry described by MNT to STREAM.
62 Return zero on success, nonzero on failure. */
63extern int addmntent __P ((FILE *__stream,
64 __const struct mntent *__mnt));
65
66/* Close a stream opened with `setmntent'. */
67extern int endmntent __P ((FILE *__stream));
68
69/* Search MNT->mnt_opts for an option matching OPT.
70 Returns the address of the substring, or null if none found. */
71extern char *hasmntopt __P ((__const struct mntent *__mnt,
72 __const char *__opt));
73
74
75__END_DECLS
76
77#endif /* mntent.h */