POSIX return is pid_t
[unix-history] / usr / src / lib / libc / gen / getfsent.3
CommitLineData
12568253
KB
1.\" Copyright (c) 1983 The Regents of the University of California.
2.\" All rights reserved.
2f4571d9 3.\"
91cff1e1 4.\" %sccs.include.redist.man%
12568253 5.\"
91cff1e1 6.\" @(#)getfsent.3 6.8 (Berkeley) %G%
2f4571d9 7.\"
0609943c 8.TH GETFSENT 3 ""
2f4571d9
KM
9.UC 4
10.SH NAME
b467b8ca 11getfsent, getfsspec, getfsfile, setfsent, endfsent \- get file system descriptor file entry
2f4571d9
KM
12.SH SYNOPSIS
13.nf
14.B #include <fstab.h>
15.PP
16.B struct fstab *getfsent()
17.PP
55cdef46
KM
18.B struct fstab *getfsspec(spec)
19.B char *spec;
2f4571d9 20.PP
55cdef46
KM
21.B struct fstab *getfsfile(file)
22.B char *file;
2f4571d9 23.PP
55cdef46 24.B int setfsent()
2f4571d9 25.PP
12568253 26.B void endfsent()
2f4571d9
KM
27.fi
28.SH DESCRIPTION
55cdef46
KM
29.IR Getfsent ,
30.IR getfsspec ,
2f4571d9
KM
31and
32.I getfsfile
55cdef46 33each return a pointer to an object with the following structure
b467b8ca
KB
34containing the broken-out fields of a line in the file system
35description file,
55cdef46 36.IR < fstab.h >.
2f4571d9
KM
37.RS
38.PP
39.nf
1e24342d 40.ta \w'#define 'u +\w'char\ \ 'u +\w'*fs_vfstype;\ \ 'u
9dbe8c98 41struct fstab {
1e24342d
KM
42 char *fs_spec; /* block special device name */
43 char *fs_file; /* file system path prefix */
44 char *fs_vfstype; /* type of file system */
45 char *fs_mntops; /* comma separated mount options */
46 char *fs_type; /* rw, ro, sw, or xx */
47 int fs_freq; /* dump frequency, in days */
48 int fs_passno; /* pass number on parallel dump */
2f4571d9
KM
49};
50.ft R
51.ad
52.fi
53.RE
54.PP
55The fields have meanings described in
56.IR fstab (5).
57.PP
2f4571d9 58.I Setfsent
62ab31a2
KB
59opens the file (closing any previously opened file) or rewinds it
60if it is already open.
2f4571d9
KM
61.PP
62.I Endfsent
63closes the file.
64.PP
65.I Getfsspec
66and
67.I getfsfile
62ab31a2
KB
68search the entire file (opening it if necessary) for a matching special
69file name or file system file name.
70.PP
71For programs wishing to read the entire database,
72.I getfsent
73reads the next entry (opening the file if necessary).
b467b8ca 74.PP
62ab31a2
KB
75All entries in the file with a type field equivalent to
76.I FSTAB_XX
b467b8ca 77are ignored.
2f4571d9
KM
78.SH FILES
79/etc/fstab
80.SH "SEE ALSO"
81fstab(5)
82.SH DIAGNOSTICS
12568253
KB
83.IR Getfsent ,
84.IR getfsspec ,
85and
86.I getfsfile
87return a null pointer (0) on EOF or error.
88.I Setfsent
62ab31a2 89returns 0 on failure, 1 on success.
12568253
KB
90.I Endfsent
91returns nothing.
2f4571d9 92.SH BUGS
55cdef46 93All information is contained in a static area so it must be copied if it is
2f4571d9 94to be saved.