1 .\" Copyright (C) 2002 Andries Brouwer (aeb@cwi.nl)
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.
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.
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
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Inspired by a page written by Walter Harms.
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>
28 .TH GETFSENT 3 2002-02-28 "Linux" "Linux Programmer's Manual"
30 .\"O getfsent, getfsspec, getfsfile, setfsent, endfsent \- handle fstab entries
32 getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab エントリの処理
37 .B "void endfsent(void);"
39 .B "struct fstab *getfsent(void);"
41 .BI "struct fstab *getfsfile(const char *" mount_point );
43 .BI "struct fstab *getfsspec(const char *" special_file );
45 .B "int setfsent(void);"
48 .\"O These functions read from the file
50 .\"O The \fIstruct fstab\fP is defined by:
53 ファイルから情報を読み込む。\fIfstab\fP 構造体は次のように定義されている。
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 */
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).
77 "rw", "rq", "ro", "sw", "xx"
79 (それぞれ read-write, quota 付き read-write, read-only, swap, ignore)。
83 .\"O opens the file when required and positions it at the first line.
86 は呼び出されると fstab ファイルをオープンし、
91 .\"O parses the next line from the file.
92 .\"O (After opening it when required.)
95 は fstab ファイルから次の行をパースする
100 .\"O closes the file when required.
103 は呼び出されると fstab ファイルをクローズする。
106 .\"O .BR getfsspec ()
107 .\"O searches the file from the start and returns the first entry found
110 .\"O field matches the
115 は fstab ファイルを先頭から検索し、
119 引数にマッチするエントリが見つかったら、その最初のものを返す。
122 .\"O .BR getfsfile ()
123 .\"O searches the file from the start and returns the first entry found
126 .\"O field matches the
131 は fstab ファイルを先頭から検索し、
135 引数にマッチするエントリが見つかったら、その最初のものを返す。
136 .\"O .SH "RETURN VALUE"
138 .\"O Upon success, the functions
139 .\"O .BR getfsent (),
140 .\"O .BR getfsfile (),
142 .\"O .BR getfsspec ()
143 .\"O return a pointer to a \fIstruct fstab\fP, while
146 .\"O Upon failure or end-of-file, these functions return NULL and 0, respectively.
151 の各関数は \fIfstab\fP 構造体へのポインタを返し、
154 失敗するとこれらの関数は NULL を返し、
155 end-of-file になったら 0 を返す。
159 .\"O .\" .BR getfsent ()
160 .\"O .\" function appeared in 4.0BSD; the other four functions appeared in 4.3BSD.
162 .\" 関数は 4.0BSD で登場した。
163 .\" 他の 4 つの関数は 4.3BSD で登場した。
164 .\"O .SH "CONFORMING TO"
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 等である
182 HP-UX のものは \fIfstab\fP 構造体ではなく \fIchecklist\fP 構造体を用いる。
183 またこれらの関数の呼び出しは obsolete で、
188 .\"O These functions are not thread-safe.
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,
195 .\"O .BR getfsfile ()
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 (この場合はそのマウントポイントに最後にマウントされたデバイスが意味を持つ)
207 はマッチした最初のエントリしか返さないので、
208 これらの 2 つの関数は Linux での利用には適していない。