OSDN Git Service

04718c49ca1b1153d463ae5dc881a194cb73c737
[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)