OSDN Git Service

(split) LDP: draft snapshot generated from latest pthread/ja.po files.
[linuxjm/LDP_man-pages.git] / release / 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 .SH 名前
30 getfsent, getfsspec, getfsfile, setfsent, endfsent \- fstab エントリの処理
31 .SH 書式
32 .B #include <fstab.h>
33 .sp
34 .B "void endfsent(void);"
35 .sp
36 .B "struct fstab *getfsent(void);"
37 .sp
38 .BI "struct fstab *getfsfile(const char *" mount_point );
39 .sp
40 .BI "struct fstab *getfsspec(const char *" special_file );
41 .sp
42 .B "int setfsent(void);"
43 .SH 説明
44 これらの関数は
45 .I /etc/fstab
46 ファイルから情報を読み込む。\fIfstab\fP 構造体は次のように定義されている。
47 .LP
48 .in +4n
49 .nf
50 struct fstab {
51     char       *fs_spec;       /* block device name */
52     char       *fs_file;       /* mount point */
53     char       *fs_vfstype;    /* file-system type */
54     char       *fs_mntops;     /* mount options */
55     const char *fs_type;       /* rw/rq/ro/sw/xx option */
56     int         fs_freq;       /* dump frequency, in days */
57     int         fs_passno;     /* pass number on parallel dump */
58 };
59 .fi
60 .in
61 .PP
62 *BSD システムの場合、
63 .I fs_type
64 フィールドには、5 つの文字列
65 "rw", "rq", "ro", "sw", "xx"
66 のいずれかが入る
67 (それぞれ read-write, quota 付き read-write, read-only, swap, ignore)。
68
69 関数
70 .BR setfsent ()
71 は呼び出されると fstab ファイルをオープンし、
72 最初の行に移動する。
73 .LP
74 関数
75 .BR getfsent ()
76 は fstab ファイルから次の行をパースする
77 (必要な場合はファイルをオープンする)。
78 .LP
79 関数
80 .BR endfsent ()
81 は呼び出されると fstab ファイルをクローズする。
82 .LP
83 関数
84 .BR getfsspec ()
85 は fstab ファイルを先頭から検索し、
86 .I fs_spec
87 フィールドが
88 .I special_file
89 引数にマッチするエントリが見つかったら、その最初のものを返す。
90 .LP
91 関数
92 .BR getfsfile ()
93 は fstab ファイルを先頭から検索し、
94 .I fs_file
95 フィールドが
96 .I mount_point
97 引数にマッチするエントリが見つかったら、その最初のものを返す。
98 .SH 返り値
99 成功すると、
100 .BR getfsent (),
101 .BR getfsfile (),
102 .BR getfsspec ()
103 の各関数は \fIfstab\fP 構造体へのポインタを返し、
104 .BR setfsent ()
105 関数は 1 を返す。
106 失敗するとこれらの関数は NULL を返し、
107 end-of-file になったら 0 を返す。
108 .\" .SH 履歴
109 .\" .BR getfsent ()
110 .\" 関数は 4.0BSD で登場した。
111 .\" 他の 4 つの関数は 4.3BSD で登場した。
112 .SH 準拠
113 POSIX.1-2001 にはこれらの関数は存在しない。
114 これらの関数をもつ OS はいくつかあり、
115 *BSD, SunOS, Digital UNIX, AIX 等である
116 (AIX には
117 .BR getfstype ()
118 もある)。
119 HP-UX にも同名の関数群があるが、
120 HP-UX のものは \fIfstab\fP 構造体ではなく \fIchecklist\fP 構造体を用いる。
121 またこれらの関数の呼び出しは obsolete で、
122 .BR getmntent (3)
123 に取って代わられている。
124 .SH 注意
125 これらの関数はスレッドセーフではない。
126 .LP
127 Linux ではブロックスペシャルデバイスを複数の場所にマウントでき、
128 また複数のデバイスが同じマウントポイントを共有できる
129 (この場合はそのマウントポイントに最後にマウントされたデバイスが意味を持つ)
130 が、
131 .BR getfsfile ()
132
133 .BR getfsspec ()
134 はマッチした最初のエントリしか返さないので、
135 これらの 2 つの関数は Linux での利用には適していない。
136 .SH 関連項目
137 .BR getmntent (3),
138 .BR fstab (5)