1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Inspired by a page written by Walter Harms.
25 .TH GETFSENT 3 2002-02-28 "GNU" "Linux Programmer's Manual"
27 getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries
31 .B "void endfsent(void);"
33 .B "struct fstab *getfsent(void);"
35 .BI "struct fstab *getfsfile(const char *" mount_point );
37 .BI "struct fstab *getfsspec(const char *" special_file );
39 .B "int setfsent(void);"
41 These functions read from the file
43 The \fIstruct fstab\fP is defined by:
48 char *fs_spec; /* block device name */
49 char *fs_file; /* mount point */
50 char *fs_vfstype; /* file-sysem type */
51 char *fs_mntops; /* mount options */
52 const char *fs_type; /* rw/rq/ro/sw/xx option */
53 int fs_freq; /* dump frequency, in days */
54 int fs_passno; /* pass number on parallel dump */
61 contains (on a *BSD system)
62 one of the five strings "rw", "rq", "ro", "sw", "xx"
63 (read-write, read-write with quota, read-only, swap, ignore).
67 opens the file when required and positions it at the first line.
71 parses the next line from the file.
72 (After opening it when required.)
76 closes the file when required.
80 searches the file from the start and returns the first entry found
89 searches the file from the start and returns the first entry found
96 Upon success, the functions
101 return a pointer to a \fIstruct fstab\fP, while
104 Upon failure or end-of-file, these functions return NULL and 0, respectively.
108 .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD.
110 These functions are not in POSIX.1-2001.
111 Several operating systems have them,
112 e.g., *BSD, SunOS, Digital Unix, AIX (which also has a
114 HP-UX has functions of the same names,
115 that however use a \fIstruct checklist\fP
116 instead of a \fIstruct fstab\fP,
117 and calls these functions obsolete, superseded by
120 These functions are not thread-safe.
122 Since Linux allows mounting a block special device in several places,
123 and since several devices can have the same mount point, where the
124 last device with a given mount point is the interesting one,
129 only return the first occurrence, these two functions are not suitable