summaryrefslogtreecommitdiff
path: root/static/v10/man3/getfsent.3
blob: 3f6d67e426fb4a2520bd7c5d39f7d37661a8e01d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
.TH GETFSENT 3
.CT 2 sa
.SH NAME
getfsent, getfsspec, getfsfile, setfsent, endfsent \(mi get file system description file entry
.SH SYNOPSIS
.nf
.B #include <fstab.h>
.PP
.B struct fstab *getfsent()
.PP
.B struct fstab *getfsspec(name)
.B char *name;
.PP
.B struct fstab *getfsfile(name)
.B char *name;
.PP
.B int setfsent()
.PP
.B int endfsent()
.fi
.SH DESCRIPTION
.I Getfsent,
.I getfsspec
and
.I getfsfile
each return a pointer to a structure
containing the broken-out
fields of a line in
.IR fstab (5),
which describes mountable file systems.
.PP
.EX
.ta \w'struct 'u +\w'char fs_spec[FSNMLG]; 'u
struct fstab {
	char fs_spec[FSNMLG];	\fRblock device name\fP
	char fs_file[FSNMLG];	\fRfile system mount point\fP
	int fs_ftype;	\fRfile system type\fP
	int fs_flags;	\fRfile system flags\fP
	int fs_passno;	\fRpass number for parallel \fP\fIfsck\fR(8)\fP
};
.EE
.PP
Type numbers and flags are listed in
.IR fmount (2).
Entries that aren't file systems
(should not be mounted)
have negative values for
.LR fs_ftype :
.TP .7i
.L FSNONE
(\-1) Ignore this entry.
.PD 0
.TP
.L FSSWAP
(\-2)
.L fs_spec
is a device available for swapping.
.PD
.PP
.I Getfsent
reads the next line of the file, opening the file if necessary.
.PP
.I Setfsent
opens and rewinds the file.
.PP
.I Endfsent
closes the file.
.PP
.I Getfsspec
and
.I getfsfile
sequentially search from the beginning
of the file until a matching
special file name or
file system file name is found,
or until EOF
is encountered.
.SH FILES
.TP
.F /etc/fstab
.SH "SEE ALSO"
.IR fmount (2),
.IR fstab (5)
.SH DIAGNOSTICS
Zero is returned on EOF
or error.
.SH BUGS
The return values point to static data
whose content is overwritten by each call.