1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\" Inspired by a page written by Walter Harms.
7 .TH GETFSENT 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
9 getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries
12 .RI ( libc ", " \-lc )
17 .B "int setfsent(void);"
18 .B "struct fstab *getfsent(void);"
19 .B "void endfsent(void);"
21 .BI "struct fstab *getfsfile(const char *" mount_point );
22 .BI "struct fstab *getfsspec(const char *" special_file );
25 These functions read from the file
34 char *fs_spec; /* block device name */
35 char *fs_file; /* mount point */
36 char *fs_vfstype; /* filesystem type */
37 char *fs_mntops; /* mount options */
38 const char *fs_type; /* rw/rq/ro/sw/xx option */
39 int fs_freq; /* dump frequency, in days */
40 int fs_passno; /* pass number on parallel dump */
47 contains (on a *BSD system)
48 one of the five strings "rw", "rq", "ro", "sw", "xx"
49 (read-write, read-write with quota, read-only, swap, ignore).
53 opens the file when required and positions it at the first line.
57 parses the next line from the file.
58 (After opening it when required.)
62 closes the file when required.
66 searches the file from the start and returns the first entry found
75 searches the file from the start and returns the first entry found
82 Upon success, the functions
92 Upon failure or end-of-file, these functions return NULL and 0, respectively.
96 .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD.
98 For an explanation of the terms used in this section, see
106 Interface Attribute Value
118 MT-Unsafe race:fsent locale
125 These functions are not in POSIX.1.
126 Several operating systems have them, for example,
127 *BSD, SunOS, Digital UNIX, AIX (which also has a
129 HP-UX has functions of the same names,
134 and calls these functions obsolete, superseded by
137 These functions are not thread-safe.
139 Since Linux allows mounting a block special device in several places,
140 and since several devices can have the same mount point, where the
141 last device with a given mount point is the interesting one,
146 only return the first occurrence, these two functions are not suitable