OSDN Git Service

(split) LDP v3.24 -> v3.29 の定型的な変更内容を反映。
[linuxjm/LDP_man-pages.git] / draft / man3 / getfsent.3
1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\"
23 .\" Inspired by a page written by Walter Harms.
24 .\"
25 .\" Japanese Version Copyright (c) 2002 NAKANO Takeo all rights reserved.
26 .\" Translated Wed 7 Aug 2002 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
27 .\"
28 .TH GETFSENT 3 2002-02-28 "Linux" "Linux Programmer's Manual"
29 .\"O .SH NAME
30 .\"O getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries
31 .SH Ì¾Á°
32 getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab ¥¨¥ó¥È¥ê¤Î½èÍý
33 .\"O .SH SYNOPSIS
34 .SH ½ñ¼°
35 .B #include <fstab.h>
36 .sp
37 .B "void endfsent(void);"
38 .sp
39 .B "struct fstab *getfsent(void);"
40 .sp
41 .BI "struct fstab *getfsfile(const char *" mount_point );
42 .sp
43 .BI "struct fstab *getfsspec(const char *" special_file );
44 .sp
45 .B "int setfsent(void);"
46 .\"O .SH DESCRIPTION
47 .SH ÀâÌÀ
48 .\"O These functions read from the file
49 .\"O .IR /etc/fstab .
50 .\"O The \fIstruct fstab\fP is defined by:
51 ¤³¤ì¤é¤Î´Ø¿ô¤Ï
52 .I /etc/fstab
53 ¥Õ¥¡¥¤¥ë¤«¤é¾ðÊó¤òÆɤ߹þ¤à¡£\fIfstab\fP ¹½Â¤ÂΤϼ¡¤Î¤è¤¦¤ËÄêµÁ¤µ¤ì¤Æ¤¤¤ë¡£
54 .LP
55 .in +4n
56 .nf
57 struct fstab {
58     char       *fs_spec;       /* block device name */
59     char       *fs_file;       /* mount point */
60     char       *fs_vfstype;    /* file-system type */
61     char       *fs_mntops;     /* mount options */
62     const char *fs_type;       /* rw/rq/ro/sw/xx option */
63     int         fs_freq;       /* dump frequency, in days */
64     int         fs_passno;     /* pass number on parallel dump */
65 };
66 .fi
67 .in
68 .PP
69 .\"O Here the field
70 .\"O .I fs_type
71 .\"O contains (on a *BSD system)
72 .\"O one of the five strings "rw", "rq", "ro", "sw", "xx"
73 .\"O (read-write, read-write with quota, read-only, swap, ignore).
74 *BSD ¥·¥¹¥Æ¥à¤Î¾ì¹ç¡¢
75 .I fs_type
76 ¥Õ¥£¡¼¥ë¥É¤Ë¤Ï¡¢5 ¤Ä¤Îʸ»úÎó
77 "rw", "rq", "ro", "sw", "xx"
78 ¤Î¤¤¤º¤ì¤«¤¬Æþ¤ë
79 (¤½¤ì¤¾¤ì read-write, quota ÉÕ¤­ read-write, read-only, swap, ignore)¡£
80
81 .\"O The function
82 .\"O .BR setfsent ()
83 .\"O opens the file when required and positions it at the first line.
84 ´Ø¿ô
85 .BR setfsent ()
86 ¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤·¡¢
87 ºÇ½é¤Î¹Ô¤Ë°ÜÆ°¤¹¤ë¡£
88 .LP
89 .\"O The function
90 .\"O .BR getfsent ()
91 .\"O parses the next line from the file.
92 .\"O (After opening it when required.)
93 ´Ø¿ô
94 .BR getfsent ()
95 ¤Ï fstab ¥Õ¥¡¥¤¥ë¤«¤é¼¡¤Î¹Ô¤ò¥Ñ¡¼¥¹¤¹¤ë
96 (ɬÍפʾì¹ç¤Ï¥Õ¥¡¥¤¥ë¤ò¥ª¡¼¥×¥ó¤¹¤ë)¡£
97 .LP
98 .\"O The function
99 .\"O .BR endfsent ()
100 .\"O closes the file when required.
101 ´Ø¿ô
102 .BR endfsent ()
103 ¤Ï¸Æ¤Ó½Ð¤µ¤ì¤ë¤È fstab ¥Õ¥¡¥¤¥ë¤ò¥¯¥í¡¼¥º¤¹¤ë¡£
104 .LP
105 .\"O The function
106 .\"O .BR getfsspec ()
107 .\"O searches the file from the start and returns the first entry found
108 .\"O for which the
109 .\"O .I fs_spec
110 .\"O field matches the
111 .\"O .I special_file
112 .\"O argument.
113 ´Ø¿ô
114 .BR getfsspec ()
115 ¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢
116 .I fs_spec
117 ¥Õ¥£¡¼¥ë¥É¤¬
118 .I special_file
119 °ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£
120 .LP
121 .\"O The function
122 .\"O .BR getfsfile ()
123 .\"O searches the file from the start and returns the first entry found
124 .\"O for which the
125 .\"O .I fs_file
126 .\"O field matches the
127 .\"O .I mount_point
128 .\"O argument.
129 ´Ø¿ô
130 .BR getfsfile ()
131 ¤Ï fstab ¥Õ¥¡¥¤¥ë¤òÀèƬ¤«¤é¸¡º÷¤·¡¢
132 .I fs_file
133 ¥Õ¥£¡¼¥ë¥É¤¬
134 .I mount_point
135 °ú¿ô¤Ë¥Þ¥Ã¥Á¤¹¤ë¥¨¥ó¥È¥ê¤¬¸«¤Ä¤«¤Ã¤¿¤é¡¢¤½¤ÎºÇ½é¤Î¤â¤Î¤òÊÖ¤¹¡£
136 .\"O .SH "RETURN VALUE"
137 .SH ÊÖ¤êÃÍ
138 .\"O Upon success, the functions
139 .\"O .BR getfsent (),
140 .\"O .BR getfsfile (),
141 .\"O and
142 .\"O .BR getfsspec ()
143 .\"O return a pointer to a \fIstruct fstab\fP, while
144 .\"O .BR setfsent ()
145 .\"O returns 1.
146 .\"O Upon failure or end-of-file, these functions return NULL and 0, respectively.
147 À®¸ù¤¹¤ë¤È¡¢
148 .BR getfsent (),
149 .BR getfsfile (),
150 .BR getfsspec ()
151 ¤Î³Æ´Ø¿ô¤Ï \fIfstab\fP ¹½Â¤ÂΤؤΥݥ¤¥ó¥¿¤òÊÖ¤·¡¢
152 .BR setfsent ()
153 ´Ø¿ô¤Ï 1 ¤òÊÖ¤¹¡£
154 ¼ºÇÔ¤¹¤ë¤È¤³¤ì¤é¤Î´Ø¿ô¤Ï NULL ¤òÊÖ¤·¡¢
155 end-of-file ¤Ë¤Ê¤Ã¤¿¤é 0 ¤òÊÖ¤¹¡£
156 .\"O .\" .SH HISTORY
157 .\" .SH ÍúÎò
158 .\"O .\" The
159 .\"O .\" .BR getfsent ()
160 .\"O .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD.
161 .\" .BR getfsent ()
162 .\" ´Ø¿ô¤Ï 4.0BSD ¤ÇÅо줷¤¿¡£
163 .\" Â¾¤Î 4 ¤Ä¤Î´Ø¿ô¤Ï 4.3BSD ¤ÇÅо줷¤¿¡£
164 .\"O .SH "CONFORMING TO"
165 .SH ½àµò
166 .\"O These functions are not in POSIX.1-2001.
167 .\"O Several operating systems have them,
168 .\"O e.g., *BSD, SunOS, Digital UNIX, AIX (which also has a
169 .\"O .BR getfstype ()).
170 .\"O HP-UX has functions of the same names,
171 .\"O that however use a \fIstruct checklist\fP
172 .\"O instead of a \fIstruct fstab\fP,
173 .\"O and calls these functions obsolete, superseded by
174 .\"O .BR getmntent (3).
175 POSIX.1-2001 ¤Ë¤Ï¤³¤ì¤é¤Î´Ø¿ô¤Ï¸ºß¤·¤Ê¤¤¡£
176 ¤³¤ì¤é¤Î´Ø¿ô¤ò¤â¤Ä OS ¤Ï¤¤¤¯¤Ä¤«¤¢¤ê¡¢
177 *BSD, SunOS, Digital UNIX, AIX Åù¤Ç¤¢¤ë
178 (AIX ¤Ë¤Ï
179 .BR getfstype ()
180 ¤â¤¢¤ë)¡£
181 HP-UX ¤Ë¤âƱ̾¤Î´Ø¿ô·²¤¬¤¢¤ë¤¬¡¢
182 HP-UX ¤Î¤â¤Î¤Ï \fIfstab\fP ¹½Â¤ÂΤǤϤʤ¯ \fIchecklist\fP ¹½Â¤ÂΤòÍѤ¤¤ë¡£
183 ¤Þ¤¿¤³¤ì¤é¤Î´Ø¿ô¤Î¸Æ¤Ó½Ð¤·¤Ï obsolete ¤Ç¡¢
184 .BR getmntent (3)
185 ¤Ë¼è¤Ã¤ÆÂå¤ï¤é¤ì¤Æ¤¤¤ë¡£
186 .\"O .SH NOTES
187 .SH Ãí°Õ
188 .\"O These functions are not thread-safe.
189 ¤³¤ì¤é¤Î´Ø¿ô¤Ï¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ç¤Ï¤Ê¤¤¡£
190 .LP
191 .\"O Since Linux allows mounting a block special device in several places,
192 .\"O and since several devices can have the same mount point, where the
193 .\"O last device with a given mount point is the interesting one,
194 .\"O while
195 .\"O .BR getfsfile ()
196 .\"O and
197 .\"O .BR getfsspec ()
198 .\"O only return the first occurrence, these two functions are not suitable
199 .\"O for use under Linux.
200 Linux ¤Ç¤Ï¥Ö¥í¥Ã¥¯¥¹¥Ú¥·¥ã¥ë¥Ç¥Ð¥¤¥¹¤òÊ£¿ô¤Î¾ì½ê¤Ë¥Þ¥¦¥ó¥È¤Ç¤­¡¢
201 ¤Þ¤¿Ê£¿ô¤Î¥Ç¥Ð¥¤¥¹¤¬Æ±¤¸¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ò¶¦Í­¤Ç¤­¤ë
202 (¤³¤Î¾ì¹ç¤Ï¤½¤Î¥Þ¥¦¥ó¥È¥Ý¥¤¥ó¥È¤ËºÇ¸å¤Ë¥Þ¥¦¥ó¥È¤µ¤ì¤¿¥Ç¥Ð¥¤¥¹¤¬°ÕÌ£¤ò»ý¤Ä)
203 ¤¬¡¢
204 .BR getfsfile ()
205 ¤È
206 .BR getfsspec ()
207 ¤Ï¥Þ¥Ã¥Á¤·¤¿ºÇ½é¤Î¥¨¥ó¥È¥ê¤·¤«ÊÖ¤µ¤Ê¤¤¤Î¤Ç¡¢
208 ¤³¤ì¤é¤Î 2 ¤Ä¤Î´Ø¿ô¤Ï Linux ¤Ç¤ÎÍøÍѤˤÏŬ¤·¤Æ¤¤¤Ê¤¤¡£
209 .\"O .SH "SEE ALSO"
210 .SH ´ØÏ¢¹àÌÜ
211 .BR getmntent (3),
212 .BR fstab (5)