import less(1)
[unleashed/tickless.git] / share / man / man3c / getvfsent.3c
blob370b56e51c88746e00c9e062822e3d1fc95a2cbd
1 '\" te
2 .\"  Copyright 1989 AT&T  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH GETVFSENT 3C "Mar 12, 1997"
7 .SH NAME
8 getvfsent, getvfsfile, getvfsspec, getvfsany \- get vfstab file entry
9 .SH SYNOPSIS
10 .LP
11 .nf
12 #include <stdio.h>
13 #include <sys/vfstab.h>
15 \fBint\fR \fBgetvfsent\fR(\fBFILE *\fR\fIfp\fR, \fBstruct vfstab *\fR\fIvp\fR);
16 .fi
18 .LP
19 .nf
20 \fBint\fR \fBgetvfsfile\fR(\fBFILE *\fR\fIfp\fR, \fBstruct vfstab *\fR\fIvp\fR, \fBchar *\fR\fIfile\fR);
21 .fi
23 .LP
24 .nf
25 \fBint\fR \fBgetvfsspec\fR(\fBFILE *\fR, \fBstruct vfstab *\fR\fIvp\fR, \fBchar *\fR\fIspec\fR);
26 .fi
28 .LP
29 .nf
30 \fBint\fR \fBgetvfsany\fR(\fBFILE *\fR, \fBstruct vfstab *\fR\fIvp\fR, \fBstruct vfstab *\fR\fIvref\fR);
31 .fi
33 .SH DESCRIPTION
34 .sp
35 .LP
36 The \fBgetvfsent()\fR, \fBgetvfsfile()\fR, \fBgetvfsspec()\fR, and
37 \fBgetvfsany()\fR functions each fill in the structure pointed to by \fIvp\fR
38 with the broken-out fields of a line in the \fB/etc/vfstab\fR file. Each line
39 in the file contains a \fBvfstab\fR structure, declared in the
40 <\fBsys/vfstab.h\fR> header, whose following members are described on the
41 \fBvfstab\fR(4) manual page:
42 .sp
43 .in +2
44 .nf
45 \fB     char    *vfs_special;
46         char    *vfs_fsckdev;
47         char    *vfs_mountp;
48         char    *vfs_fstype;
49         char    *vfs_fsckpass;
50         char    *vfs_automnt;
51         char    *vfs_mntopts;\fR
52 .fi
53 .in -2
55 .sp
56 .LP
57 The \fBgetvfsent()\fR function returns a pointer to the next \fBvfstab\fR
58 structure in the file; so successive calls can be used to search the entire
59 file.
60 .sp
61 .LP
62 The \fBgetvfsfile()\fR function searches the file referenced by \fIfp\fR until
63 a mount point matching \fBfile\fR is found and fills \fIvp\fR with the fields
64 from the line in the file.
65 .sp
66 .LP
67 The \fBgetvfsspec()\fR function searches the file referenced by \fIfp\fR until
68 a special device matching \fIspec\fR is found and fills \fIvp\fR with the
69 fields from the line in the file.  The \fIspec\fR argument will try to match on
70 device type (block or character special) and major and minor device numbers. If
71 it cannot match in this manner, then it compares the strings.
72 .sp
73 .LP
74 The \fBgetvfsany()\fR function searches the file referenced by \fIfp\fR until a
75 match is found between a line in the file and \fIvref\fR. A match occurrs if
76 all non-null entries in \fIvref\fR match the corresponding fields in the file.
77 .sp
78 .LP
79 Note that these functions do not open, close, or rewind the file.
80 .SH RETURN VALUES
81 .sp
82 .LP
83 If the next entry is successfully read by \fBgetvfsent()\fR or a match is found
84 with \fBgetvfsfile()\fR, \fBgetvfsspec()\fR, or \fBgetvfsany()\fR, \fB0\fR is
85 returned. If an end-of-file is encountered on reading, these functions return
86 \fB\(mi1\fR\&. If an error is encountered, a value greater than 0 is returned.
87 The possible error values are:
88 .sp
89 .ne 2
90 .na
91 \fB\fBVFS_TOOLONG\fR\fR
92 .ad
93 .RS 15n
94 A line in the file exceeded the internal buffer size of \fBVFS_LINE_MAX\fR.
95 .RE
97 .sp
98 .ne 2
99 .na
100 \fB\fBVFS_TOOMANY\fR\fR
102 .RS 15n
103 A line in the file contains too many fields.
107 .ne 2
109 \fB\fBVFS_TOOFEW\fR\fR
111 .RS 15n
112 A line in the file contains too few fields.
115 .SH FILES
118 \fB/etc/vfstab\fR
119 .SH ATTRIBUTES
122 See \fBattributes\fR(5) for descriptions of the following attributes:
127 box;
128 c | c
129 l | l .
130 ATTRIBUTE TYPE  ATTRIBUTE VALUE
132 MT-Level        Safe
135 .SH SEE ALSO
138 \fBvfstab\fR(4), \fBattributes\fR(5)
139 .SH NOTES
142 The members of the \fBvfstab\fR structure point to information contained in a
143 static area, so it must be copied if it is to be saved.