install C version of _doprnt
[unix-history] / usr / src / lib / libc / gen / getfsent.3
CommitLineData
2f4571d9
KM
1.\" Copyright (c) 1980 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
9dbe8c98 5.\" @(#)getfsent.3 6.3 (Berkeley) %G%
2f4571d9 6.\"
0609943c 7.TH GETFSENT 3 ""
2f4571d9
KM
8.UC 4
9.SH NAME
55cdef46 10getfsent, getfsspec, getfsfile, getfstype, setfsent, endfsent \- get file system descriptor file entry
2f4571d9
KM
11.SH SYNOPSIS
12.nf
13.B #include <fstab.h>
14.PP
15.B struct fstab *getfsent()
16.PP
55cdef46
KM
17.B struct fstab *getfsspec(spec)
18.B char *spec;
2f4571d9 19.PP
55cdef46
KM
20.B struct fstab *getfsfile(file)
21.B char *file;
2f4571d9 22.PP
55cdef46
KM
23.B struct fstab *getfstype(type)
24.B char *type;
25.PP
26.B int setfsent()
2f4571d9
KM
27.PP
28.B int endfsent()
29.fi
30.SH DESCRIPTION
55cdef46
KM
31.IR Getfsent ,
32.IR getfsspec ,
33.IR getfstype ,
2f4571d9
KM
34and
35.I getfsfile
55cdef46
KM
36each return a pointer to an object with the following structure
37containing the broken-out fields of a line in the file system description file,
38.IR < fstab.h >.
2f4571d9
KM
39.RS
40.PP
41.nf
9dbe8c98 42struct fstab {
55cdef46
KM
43 char *fs_spec;
44 char *fs_file;
45 char *fs_type;
2f4571d9
KM
46 int fs_freq;
47 int fs_passno;
48};
49.ft R
50.ad
51.fi
52.RE
53.PP
54The fields have meanings described in
55.IR fstab (5).
56.PP
57.I Getfsent
58reads the next line of the file, opening the file if necessary.
59.PP
60.I Setfsent
61opens and rewinds the file.
62.PP
63.I Endfsent
64closes the file.
65.PP
66.I Getfsspec
67and
68.I getfsfile
55cdef46
KM
69sequentially search from the beginning of the file until a matching
70special file name or file system file name is found,
2f4571d9 71or until EOF is encountered.
55cdef46
KM
72.I Getfstype
73does likewise, matching on the file system type field.
2f4571d9
KM
74.SH FILES
75/etc/fstab
76.SH "SEE ALSO"
77fstab(5)
78.SH DIAGNOSTICS
79Null pointer
80(0) returned on EOF or error.
81.SH BUGS
55cdef46 82All information is contained in a static area so it must be copied if it is
2f4571d9 83to be saved.