1getvfsent(3C)            Standard C Library Functions            getvfsent(3C)
2
3
4

NAME

6       getvfsent, getvfsfile, getvfsspec, getvfsany - get vfstab file entry
7

SYNOPSIS

9       #include <stdio.h>
10       #include <sys/vfstab.h>
11
12       int getvfsent(FILE *fp, struct vfstab *vp);
13
14
15       int getvfsfile(FILE *fp, struct vfstab *vp, char *file);
16
17
18       int getvfsspec(FILE *, struct vfstab *vp, char *spec);
19
20
21       int getvfsany(FILE *, struct vfstab *vp, struct vfstab *vref);
22
23

DESCRIPTION

25       The  getvfsent(), getvfsfile(), getvfsspec(), and getvfsany() functions
26       each fill in the structure pointed to by vp with the broken-out  fields
27       of  a  line  in  the /etc/vfstab file. Each line in the file contains a
28       vfstab structure, declared in the <sys/vfstab.h> header, whose  follow‐
29       ing members are described on the vfstab(4) manual page:
30
31              char *vfs_special;
32              char *vfs_fsckdev;
33              char *vfs_mountp;
34              char *vfs_fstype;
35              char *vfs_fsckpass;
36              char *vfs_automnt;
37              char *vfs_mntopts;
38
39
40
41       The getvfsent() function returns a pointer to the next vfstab structure
42       in the file; so successive calls can be used to search the entire file.
43
44
45       The getvfsfile() function searches the file referenced by  fp  until  a
46       mount  point  matching  file is found and fills vp with the fields from
47       the line in the file.
48
49
50       The getvfsspec() function searches the file referenced by  fp  until  a
51       special device matching spec is found and fills vp with the fields from
52       the line in the file.  The spec argument will try to  match  on  device
53       type  (block  or character special) and major and minor device numbers.
54       If it cannot match in this manner, then it compares the strings.
55
56
57       The getvfsany() function searches the file referenced  by  fp  until  a
58       match  is found between a line in the file and vref. A match occurrs if
59       all non-null entries in vref match  the  corresponding  fields  in  the
60       file.
61
62
63       Note that these functions do not open, close, or rewind the file.
64

RETURN VALUES

66       If  the  next  entry  is successfully read by getvfsent() or a match is
67       found with getvfsfile(), getvfsspec(), or getvfsany(), 0  is  returned.
68       If an end-of-file is encountered on reading, these functions return −1.
69       If an error is encountered, a value greater than  0  is  returned.  The
70       possible error values are:
71
72       VFS_TOOLONG    A  line in the file exceeded the internal buffer size of
73                      VFS_LINE_MAX.
74
75
76       VFS_TOOMANY    A line in the file contains too many fields.
77
78
79       VFS_TOOFEW     A line in the file contains too few fields.
80
81

FILES

83       /etc/vfstab
84

ATTRIBUTES

86       See attributes(5) for descriptions of the following attributes:
87
88
89
90
91       ┌─────────────────────────────┬─────────────────────────────┐
92       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
93       ├─────────────────────────────┼─────────────────────────────┤
94       │MT-Level                     │Safe                         │
95       └─────────────────────────────┴─────────────────────────────┘
96

SEE ALSO

98       vfstab(4), attributes(5)
99

NOTES

101       The members of the vfstab structure point to information contained in a
102       static area, so it must be copied if it is to be saved.
103
104
105
106SunOS 5.11                        12 Mar 1997                    getvfsent(3C)
Impressum