Commit | Line | Data |
---|---|---|
12568253 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
2f4571d9 | 3 | .\" |
12568253 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
62ab31a2 | 16 | .\" @(#)getfsent.3 6.6 (Berkeley) %G% |
2f4571d9 | 17 | .\" |
0609943c | 18 | .TH GETFSENT 3 "" |
2f4571d9 KM |
19 | .UC 4 |
20 | .SH NAME | |
b467b8ca | 21 | getfsent, getfsspec, getfsfile, setfsent, endfsent \- get file system descriptor file entry |
2f4571d9 KM |
22 | .SH SYNOPSIS |
23 | .nf | |
24 | .B #include <fstab.h> | |
25 | .PP | |
26 | .B struct fstab *getfsent() | |
27 | .PP | |
55cdef46 KM |
28 | .B struct fstab *getfsspec(spec) |
29 | .B char *spec; | |
2f4571d9 | 30 | .PP |
55cdef46 KM |
31 | .B struct fstab *getfsfile(file) |
32 | .B char *file; | |
2f4571d9 | 33 | .PP |
55cdef46 | 34 | .B int setfsent() |
2f4571d9 | 35 | .PP |
12568253 | 36 | .B void endfsent() |
2f4571d9 KM |
37 | .fi |
38 | .SH DESCRIPTION | |
55cdef46 KM |
39 | .IR Getfsent , |
40 | .IR getfsspec , | |
2f4571d9 KM |
41 | and |
42 | .I getfsfile | |
55cdef46 | 43 | each return a pointer to an object with the following structure |
b467b8ca KB |
44 | containing the broken-out fields of a line in the file system |
45 | description file, | |
55cdef46 | 46 | .IR < fstab.h >. |
2f4571d9 KM |
47 | .RS |
48 | .PP | |
49 | .nf | |
9dbe8c98 | 50 | struct fstab { |
55cdef46 KM |
51 | char *fs_spec; |
52 | char *fs_file; | |
53 | char *fs_type; | |
2f4571d9 KM |
54 | int fs_freq; |
55 | int fs_passno; | |
56 | }; | |
57 | .ft R | |
58 | .ad | |
59 | .fi | |
60 | .RE | |
61 | .PP | |
62 | The fields have meanings described in | |
63 | .IR fstab (5). | |
64 | .PP | |
2f4571d9 | 65 | .I Setfsent |
62ab31a2 KB |
66 | opens the file (closing any previously opened file) or rewinds it |
67 | if it is already open. | |
2f4571d9 KM |
68 | .PP |
69 | .I Endfsent | |
70 | closes the file. | |
71 | .PP | |
72 | .I Getfsspec | |
73 | and | |
74 | .I getfsfile | |
62ab31a2 KB |
75 | search the entire file (opening it if necessary) for a matching special |
76 | file name or file system file name. | |
77 | .PP | |
78 | For programs wishing to read the entire database, | |
79 | .I getfsent | |
80 | reads the next entry (opening the file if necessary). | |
b467b8ca | 81 | .PP |
62ab31a2 KB |
82 | All entries in the file with a type field equivalent to |
83 | .I FSTAB_XX | |
b467b8ca | 84 | are ignored. |
2f4571d9 KM |
85 | .SH FILES |
86 | /etc/fstab | |
87 | .SH "SEE ALSO" | |
88 | fstab(5) | |
89 | .SH DIAGNOSTICS | |
12568253 KB |
90 | .IR Getfsent , |
91 | .IR getfsspec , | |
92 | and | |
93 | .I getfsfile | |
94 | return a null pointer (0) on EOF or error. | |
95 | .I Setfsent | |
62ab31a2 | 96 | returns 0 on failure, 1 on success. |
12568253 KB |
97 | .I Endfsent |
98 | returns nothing. | |
2f4571d9 | 99 | .SH BUGS |
55cdef46 | 100 | All information is contained in a static area so it must be copied if it is |
2f4571d9 | 101 | to be saved. |