OSDN Git Service

メモリ -> メモリー
[linuxjm/LDP_man-pages.git] / po4a / notify / po / ja.po
1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # This file is distributed under the same license as the PACKAGE package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5 #
6 msgid ""
7 msgstr ""
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "POT-Creation-Date: 2015-01-23 22:25+0900\n"
10 "PO-Revision-Date: 2015-01-25 07:22+0900\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13 "Language: \n"
14 "MIME-Version: 1.0\n"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
17
18 #. type: TH
19 #: build/C/man7/fanotify.7:25
20 #, no-wrap
21 msgid "FANOTIFY"
22 msgstr "FANOTIFY"
23
24 #. type: TH
25 #: build/C/man7/fanotify.7:25 build/C/man7/inotify.7:27
26 #, no-wrap
27 msgid "2014-12-31"
28 msgstr "2014-12-31"
29
30 #. type: TH
31 #: build/C/man7/fanotify.7:25 build/C/man2/fanotify_init.2:24
32 #: build/C/man2/fanotify_mark.2:24 build/C/man7/inotify.7:27
33 #: build/C/man2/inotify_add_watch.2:28 build/C/man2/inotify_init.2:29
34 #: build/C/man2/inotify_rm_watch.2:27
35 #, no-wrap
36 msgid "Linux"
37 msgstr "Linux"
38
39 #. type: TH
40 #: build/C/man7/fanotify.7:25 build/C/man2/fanotify_init.2:24
41 #: build/C/man2/fanotify_mark.2:24 build/C/man7/inotify.7:27
42 #: build/C/man2/inotify_add_watch.2:28 build/C/man2/inotify_init.2:29
43 #: build/C/man2/inotify_rm_watch.2:27
44 #, no-wrap
45 msgid "Linux Programmer's Manual"
46 msgstr "Linux Programmer's Manual"
47
48 #. type: SH
49 #: build/C/man7/fanotify.7:26 build/C/man2/fanotify_init.2:25
50 #: build/C/man2/fanotify_mark.2:25 build/C/man7/inotify.7:28
51 #: build/C/man2/inotify_add_watch.2:29 build/C/man2/inotify_init.2:30
52 #: build/C/man2/inotify_rm_watch.2:28
53 #, no-wrap
54 msgid "NAME"
55 msgstr "名前"
56
57 #. type: Plain text
58 #: build/C/man7/fanotify.7:28
59 msgid "fanotify - monitoring filesystem events"
60 msgstr "fanotify - ファイルシステムイベントを監視する"
61
62 #. type: SH
63 #: build/C/man7/fanotify.7:28 build/C/man2/fanotify_init.2:33
64 #: build/C/man2/fanotify_mark.2:36 build/C/man7/inotify.7:30
65 #: build/C/man2/inotify_add_watch.2:35 build/C/man2/inotify_init.2:39
66 #: build/C/man2/inotify_rm_watch.2:36
67 #, no-wrap
68 msgid "DESCRIPTION"
69 msgstr "説明"
70
71 #. type: Plain text
72 #: build/C/man7/fanotify.7:37
73 msgid "The fanotify API provides notification and interception of filesystem events.  Use cases include virus scanning and hierarchical storage management.  Currently, only a limited set of events is supported.  In particular, there is no support for create, delete, and move events.  (See B<inotify>(7)  for details of an API that does notify those events.)"
74 msgstr "fanotify API はファイルシステムイベントの通知と横取り機能 (interception) を提供する。 ユースケースとしては、ウイルススキャンや階層型ストレージの管理などがある。 現在のところ、限定的なイベントのみがサポートされている。 特に、作成 (create)、削除 (delete)、移動 (move) イベントがサポートされていない (これらのイベントを通知する API の詳細については B<inotify>(7) を参照)。"
75
76 #. type: Plain text
77 #: build/C/man7/fanotify.7:44
78 msgid "Additional capabilities compared to the B<inotify>(7)  API include the ability to monitor all of the objects in a mounted filesystem, the ability to make access permission decisions, and the possibility to read or modify files before access by other applications."
79 msgstr "B<inotify>(7) API と比較して追加されている機能としては、 マウントされたファイルシステムの全オブジェクトを監視する機能、 アクセス許可の判定を行う機能、 他のアプリケーションによるアクセスの前にファイルを読み出したり変更したりする機能がある。"
80
81 #. type: Plain text
82 #: build/C/man7/fanotify.7:52
83 msgid "The following system calls are used with this API: B<fanotify_init>(2), B<fanotify_mark>(2), B<read>(2), B<write>(2), and B<close>(2)."
84 msgstr "この API では以下のシステムコールを使用する: B<fanotify_init>(2), B<fanotify_mark>(2), B<read>(2), B<write>(2), B<close>(2)。"
85
86 #. type: SS
87 #: build/C/man7/fanotify.7:52
88 #, no-wrap
89 msgid "fanotify_init(), fanotify_mark(), and notification groups"
90 msgstr "fanotify_init(), fanotify_mark() と通知グループ"
91
92 #. type: Plain text
93 #: build/C/man7/fanotify.7:57
94 msgid "The B<fanotify_init>(2)  system call creates and initializes an fanotify notification group and returns a file descriptor referring to it."
95 msgstr "B<fanotify_init>(2) システムコールは fanotify 通知グループを作成、初期化し、 この通知グループを参照するファイルディスクリプターを返す。"
96
97 #. type: Plain text
98 #: build/C/man7/fanotify.7:61
99 msgid "An fanotify notification group is a kernel-internal object that holds a list of files, directories, and mount points for which events shall be created."
100 msgstr "fanotify 通知グループはカーネル内部のオブジェクトで、 イベントが作成されるファイル、 ディレクトリ、 マウントポイントのリストを保持する。"
101
102 #. type: Plain text
103 #: build/C/man7/fanotify.7:72
104 msgid "For each entry in an fanotify notification group, two bit masks exist: the I<mark> mask and the I<ignore> mask.  The mark mask defines file activities for which an event shall be created.  The ignore mask defines activities for which no event shall be generated.  Having these two types of masks permits a mount point or directory to be marked for receiving events, while at the same time ignoring events for specific objects under that mount point or directory."
105 msgstr "fanotify 通知グループの各エントリーには 2 つのビットマスクがある。 I<mark> マスクと I<ignore> マスクである。 mark マスクはどのファイル操作についてイベントを作成するかを定義する。 ignore マスクはどの操作についてイベントを作成しないかを定義する。 これらの 2 種類のマスクがあることで、 マウントポイントやディレクトリに対してイベントの受信を mark しておきつつ、 同時にそのマウントポイントやディレクトリ配下の特定のオブジェクトに対するイベントを無視する、 といったことができる。"
106
107 #. type: Plain text
108 #: build/C/man7/fanotify.7:78
109 msgid "The B<fanotify_mark>(2)  system call adds a file, directory, or mount to a notification group and specifies which events shall be reported (or ignored), or removes or modifies such an entry."
110 msgstr "B<fanotify_mark>(2) システムコールは、ファイル、ディレクトリ、マウントを通知グループに追加し、 どのイベントを報告 (もしくは無視) するかを指定する。 また、このようなエントリーの削除、変更も行う。"
111
112 #. type: Plain text
113 #: build/C/man7/fanotify.7:91
114 msgid "A possible usage of the ignore mask is for a file cache.  Events of interest for a file cache are modification of a file and closing of the same.  Hence, the cached directory or mount point is to be marked to receive these events.  After receiving the first event informing that a file has been modified, the corresponding cache entry will be invalidated.  No further modification events for this file are of interest until the file is closed.  Hence, the modify event can be added to the ignore mask.  Upon receiving the close event, the modify event can be removed from the ignore mask and the file cache entry can be updated."
115 msgstr "ignore マスクの考えられる使用方法はファイルキャッシュに対してである。 ファイルキャッシュに関して興味のあるイベントは、ファイルの変更とファイルのクローズである。 それゆえ、 キャッシュされたディレクトリやマウントポイントは、 これらのイベントを受信するようにマークされる。 ファイルが変更されたという最初のイベントを受信した後は、 対応するキャッシュエントリーは無効化される。 そのファイルがクローズされるまでは、 このファイルに対する変更イベントは興味のない情報となる。 したがって、 変更イベントを ignore マスクに追加することができる。 クローズイベントを受信すると、 変更イベントを ignore イベントから削除し、 ファイルキャッシュエントリーを更新することができる。"
116
117 #. type: Plain text
118 #: build/C/man7/fanotify.7:98
119 msgid "The entries in the fanotify notification groups refer to files and directories via their inode number and to mounts via their mount ID.  If files or directories are renamed or moved, the respective entries survive.  If files or directories are deleted or mounts are unmounted, the corresponding entries are deleted."
120 msgstr "fanotify 通知グループのエントリーは、 ファイルやディレクトリでは inode 番号経由で参照され、 マウントではマウント ID 経由で参照される。 ファイルやディレクトリの名前が変更されたり、移動されたりした場合も、 関連するエントリーはそのまま残る。 ファイルやディレクトリが削除されたり、マウントがアンマウントされたりした場合には、 対応するエントリーは削除される。"
121
122 #. type: SS
123 #: build/C/man7/fanotify.7:98
124 #, no-wrap
125 msgid "The event queue"
126 msgstr "イベントキュー"
127
128 #. type: Plain text
129 #: build/C/man7/fanotify.7:107
130 msgid "As events occur on the filesystem objects monitored by a notification group, the fanotify system generates events that are collected in a queue.  These events can then be read (using B<read>(2)  or similar)  from the fanotify file descriptor returned by B<fanotify_init>(2)."
131 msgstr "通知グループにより監視されているファイルシステムオブジェクトでイベントが発生すると、 fanotify システムはイベントを生成し、 そのイベントはキューにまとめられる。 これらのイベントは、 B<fanotify_init>(2) が返した fanotify ファイルディスクリプターから (B<read>(2) などを使って) 読み出すことができる。"
132
133 #. type: Plain text
134 #: build/C/man7/fanotify.7:121
135 msgid "Two types of events are generated: I<notification> events and I<permission> events.  Notification events are merely informative and require no action to be taken by the receiving application except for closing the file descriptor passed in the event (see below).  Permission events are requests to the receiving application to decide whether permission for a file access shall be granted.  For these events, the recipient must write a response which decides whether access is granted or not."
136 msgstr "2 種類のイベントが生成される。 I<notification> (通知) イベントと I<permission> (アクセス許可) イベントである。 通知イベントは単なる情報通知であり、 イベントで渡されたファイルディスクリプターをクローズする場合 (下記参照) を除き、 受信したアプリケーションでアクションを取る必要はない。 アクセス許可イベントは、 受信したアプリケーションがファイルアクセスの許可を承認するかを判定する必要がある。 この場合、 受信者はアクセスが許可されたか否かを決定する応答を書き込まなければならない。"
137
138 #. type: Plain text
139 #: build/C/man7/fanotify.7:128
140 msgid "An event is removed from the event queue of the fanotify group when it has been read.  Permission events that have been read are kept in an internal list of the fanotify group until either a permission decision has been taken by writing to the fanotify file descriptor or the fanotify file descriptor is closed."
141 msgstr "イベントは、 読み出されると、 fanotify グループのイベントキューから削除される。 読み出されたアクセス許可イベントは、 fanotify ファイルディスクリプターにアクセス許可の判定が書き込まれるか、 fanotify ファイルディスクリプターがクローズされるまで、 fanotify グループの内部のリストに保持される。"
142
143 #. type: SS
144 #: build/C/man7/fanotify.7:128
145 #, no-wrap
146 msgid "Reading fanotify events"
147 msgstr "fanotify イベントの読み出し"
148
149 #. type: Plain text
150 #: build/C/man7/fanotify.7:140
151 msgid "Calling B<read>(2)  for the file descriptor returned by B<fanotify_init>(2)  blocks (if the flag B<FAN_NONBLOCK> is not specified in the call to B<fanotify_init>(2))  until either a file event occurs or the call is interrupted by a signal (see B<signal>(7))."
152 msgstr "B<fanotify_init>(2) が返したファイルディスクリプターに対する B<read>(2) を呼び出しは、 (B<fanotify_init>(2) の呼び出しでフラグ B<FAN_NONBLOCK> を指定しなかった場合) ファイルイベントが起こるか、呼び出しがシグナルによって割り込まれる (B<signal>(7) 参照) まで停止する。"
153
154 #. type: Plain text
155 #: build/C/man7/fanotify.7:144
156 msgid "After a successful B<read>(2), the read buffer contains one or more of the following structures:"
157 msgstr "B<read>(2) が成功すると、読み出しバッファーには以下の構造体が 1 つ以上格納される。"
158
159 #. type: Plain text
160 #: build/C/man7/fanotify.7:156
161 #, no-wrap
162 msgid ""
163 "struct fanotify_event_metadata {\n"
164 "    __u32 event_len;\n"
165 "    __u8 vers;\n"
166 "    __u8 reserved;\n"
167 "    __u16 metadata_len;\n"
168 "    __aligned_u64 mask;\n"
169 "    __s32 fd;\n"
170 "    __s32 pid;\n"
171 "};\n"
172 msgstr ""
173 "struct fanotify_event_metadata {\n"
174 "    __u32 event_len;\n"
175 "    __u8 vers;\n"
176 "    __u8 reserved;\n"
177 "    __u16 metadata_len;\n"
178 "    __aligned_u64 mask;\n"
179 "    __s32 fd;\n"
180 "    __s32 pid;\n"
181 "};\n"
182
183 #. type: Plain text
184 #: build/C/man7/fanotify.7:163
185 msgid "For performance reasons, it is recommended to use a large buffer size (for example, 4096 bytes), so that multiple events can be retrieved by a single B<read>(2)."
186 msgstr "性能上の理由から、複数のイベントを一度の B<read>(2) で取得できるように大きめのバッファーサイズ (例えば 4096 バイト) を使用することを推奨する。"
187
188 #. type: Plain text
189 #: build/C/man7/fanotify.7:168
190 msgid "The return value of B<read>(2)  is the number of bytes placed in the buffer, or -1 in case of an error (but see BUGS)."
191 msgstr "B<read>(2) の返り値はバッファーに格納されたバイト数である。 エラーの場合は -1 が返される (ただし、バグも参照)。"
192
193 #. type: Plain text
194 #: build/C/man7/fanotify.7:172
195 msgid "The fields of the I<fanotify_event_metadata> structure are as follows:"
196 msgstr "I<fanotify_event_metadata> 構造体のフィールドは以下のとおりである。"
197
198 #. type: TP
199 #: build/C/man7/fanotify.7:172
200 #, no-wrap
201 msgid "I<event_len>"
202 msgstr "I<event_len>"
203
204 #. type: Plain text
205 #: build/C/man7/fanotify.7:182
206 msgid "This is the length of the data for the current event and the offset to the next event in the buffer.  In the current implementation, the value of I<event_len> is always B<FAN_EVENT_METADATA_LEN>.  However, the API is designed to allow variable-length structures to be returned in the future."
207 msgstr "これは、 このイベントのデータ長であり、バッファー内の次のイベントへのオフセットである。 現在の実装では、 I<event_len> の値は常に B<FAN_EVENT_METADATA_LEN> である。 しかしながら、 API は将来可変長の構造体を返すことができるように設計されている。"
208
209 #. type: TP
210 #: build/C/man7/fanotify.7:182
211 #, no-wrap
212 msgid "I<vers>"
213 msgstr "I<vers>"
214
215 #. type: Plain text
216 #: build/C/man7/fanotify.7:191
217 msgid "This field holds a version number for the structure.  It must be compared to B<FANOTIFY_METADATA_VERSION> to verify that the structures returned at runtime match the structures defined at compile time.  In case of a mismatch, the application should abandon trying to use the fanotify file descriptor."
218 msgstr "このフィールドには構造体のバージョン番号が入る。 実行時に返された構造体がコンパイル時の構造体と一致しているかを検査するには、 この値を B<FANOTIFY_METADATA_VERSION> を比較すること。 一致しない場合、 アプリケーションはその fanotify ファイルディスクリプターを使用するのを諦めるべきである。"
219
220 #. type: TP
221 #: build/C/man7/fanotify.7:191
222 #, no-wrap
223 msgid "I<reserved>"
224 msgstr "I<reserved>"
225
226 #. type: Plain text
227 #: build/C/man7/fanotify.7:194
228 msgid "This field is not used."
229 msgstr "このフィールドは使用されない。"
230
231 #. type: TP
232 #: build/C/man7/fanotify.7:194
233 #, no-wrap
234 msgid "I<metadata_len>"
235 msgstr "I<metadata_len>"
236
237 #. type: Plain text
238 #: build/C/man7/fanotify.7:200
239 msgid "This is the length of the structure.  The field was introduced to facilitate the implementation of optional headers per event type.  No such optional headers exist in the current implementation."
240 msgstr "この構造体の長さである。 このフィールドは、 イベント種別単位のオプションヘッダーの実装を扱うために導入された。 現在の実装ではこのようなオプションヘッダーは存在しない。"
241
242 #. type: TP
243 #: build/C/man7/fanotify.7:200
244 #, no-wrap
245 msgid "I<mask>"
246 msgstr "I<mask>"
247
248 #. type: Plain text
249 #: build/C/man7/fanotify.7:203
250 msgid "This is a bit mask describing the event (see below)."
251 msgstr "イベントを示すビットマスクである (下記参照)"
252
253 #. type: TP
254 #: build/C/man7/fanotify.7:203 build/C/man7/fanotify.7:360
255 #, no-wrap
256 msgid "I<fd>"
257 msgstr "I<fd>"
258
259 #. type: Plain text
260 #: build/C/man7/fanotify.7:211
261 msgid "This is an open file descriptor for the object being accessed, or B<FAN_NOFD> if a queue overflow occurred.  The file descriptor can be used to access the contents of the monitored file or directory.  The reading application is responsible for closing this file descriptor."
262 msgstr "これはアクセスされたオブジェクトに対するオープンされたファイルディスクリプターである。 または、キューのオーバーフローが発生した場合には B<FAN_NOFD> が入る。 ファイルディスクリプターは監視対象のファイルやディレクトリの内容にアクセスするのに使用できる。 読み出したアプリケーションは責任を持ってこのファイルディスクリプターをクローズしなければならない。"
263
264 #. type: Plain text
265 #: build/C/man7/fanotify.7:224
266 msgid "When calling B<fanotify_init>(2), the caller may specify (via the I<event_f_flags> argument) various file status flags that are to be set on the open file description that corresponds to this file descriptor.  In addition, the (kernel-internal)  B<FMODE_NONOTIFY> file status flag is set on the open file description.  This flag suppresses fanotify event generation.  Hence, when the receiver of the fanotify event accesses the notified file or directory using this file descriptor, no additional events will be created."
267 msgstr "B<fanotify_init>(2) を呼び出す際、 呼び出し元はこのファイルディスクリプターに対応するオープンファイル記述にセットされた様々なファイル状態フラグを (I<event_f_flags> 引き数を使って) 指定することができる。 さらに、 (カーネル内部の) B<FMODE_NONOTIFY> ファイル状態フラグがオープンファイル記述にセットされる。 このフラグは fanotify イベントの生成を抑制する。 したがって、 fanotify イベントの受信者がこのファイルディスクリプターを使って通知されたファイルやディレクトリにアクセスした際に、 これ以上イベントが作成されなくなる。"
268
269 #. type: TP
270 #: build/C/man7/fanotify.7:224
271 #, no-wrap
272 msgid "I<pid>"
273 msgstr "I<pid>"
274
275 #. type: Plain text
276 #: build/C/man7/fanotify.7:232
277 msgid "This is the ID of the process that caused the event.  A program listening to fanotify events can compare this PID to the PID returned by B<getpid>(2), to determine whether the event is caused by the listener itself, or is due to a file access by another process."
278 msgstr "これはイベントが発生する原因となったプロセス ID である。 fanotify イベントを監視しているプログラムは、 この PID を B<getpid>(2) が返す PID と比較することで、 イベントが監視しているプログラム自身から発生したかどうか、 別のプロセスによるファイルアクセスにより発生したか、を判定できる。"
279
280 #. type: Plain text
281 #: build/C/man7/fanotify.7:242
282 msgid "The bit mask in I<mask> indicates which events have occurred for a single filesystem object.  Multiple bits may be set in this mask, if more than one event occurred for the monitored filesystem object.  In particular, consecutive events for the same filesystem object and originating from the same process may be merged into a single event, with the exception that two permission events are never merged into one queue entry."
283 msgstr "I<mask> のビットマスクは、1 つのファイルシステムオブジェクトに対してどのイベントが発生したかを示す。 監視対象のファイルシステムオブジェクトに複数のイベントが発生した場合は、 このマスクに複数のビットがセットされることがある。 特に、 同じファイルシステムオブジェクトに対する連続するイベントが同じプロセスから生成された場合には、 一つのイベントにまとめられることがある。 例外として、 2 つのアクセス許可イベントが一つのキューエントリーにまとめられることは決してない。"
284
285 #. type: Plain text
286 #: build/C/man7/fanotify.7:246
287 msgid "The bits that may appear in I<mask> are as follows:"
288 msgstr "I<mask> でセットされている可能性のあるビットは以下のとおりである。"
289
290 #. type: TP
291 #: build/C/man7/fanotify.7:246 build/C/man2/fanotify_mark.2:136
292 #, no-wrap
293 msgid "B<FAN_ACCESS>"
294 msgstr "B<FAN_ACCESS>"
295
296 #. type: Plain text
297 #: build/C/man7/fanotify.7:249
298 msgid "A file or a directory (but see BUGS) was accessed (read)."
299 msgstr "ファイルやディレクトリがアクセスされた (読み出しが行われた) (ただし、「バグ」の節も参照)。"
300
301 #. type: TP
302 #: build/C/man7/fanotify.7:249 build/C/man2/fanotify_mark.2:148
303 #, no-wrap
304 msgid "B<FAN_OPEN>"
305 msgstr "B<FAN_OPEN>"
306
307 #. type: Plain text
308 #: build/C/man7/fanotify.7:252
309 msgid "A file or a directory was opened."
310 msgstr "ファイルやディレクトリがオープンされた。"
311
312 #. type: TP
313 #: build/C/man7/fanotify.7:252 build/C/man2/fanotify_mark.2:139
314 #, no-wrap
315 msgid "B<FAN_MODIFY>"
316 msgstr "B<FAN_MODIFY>"
317
318 #. type: Plain text
319 #: build/C/man7/fanotify.7:255
320 msgid "A file was modified."
321 msgstr "ファイルやディレクトリが変更された。"
322
323 #. type: TP
324 #: build/C/man7/fanotify.7:255 build/C/man2/fanotify_mark.2:142
325 #, no-wrap
326 msgid "B<FAN_CLOSE_WRITE>"
327 msgstr "B<FAN_CLOSE_WRITE>"
328
329 #. type: Plain text
330 #: build/C/man7/fanotify.7:262
331 msgid "A file that was opened for writing (B<O_WRONLY> or B<O_RDWR>)  was closed."
332 msgstr "書き込み用 (B<O_WRONLY> か B<O_RDWR>) にオープンされたファイルがクローズされた。"
333
334 #. type: TP
335 #: build/C/man7/fanotify.7:262 build/C/man2/fanotify_mark.2:145
336 #, no-wrap
337 msgid "B<FAN_CLOSE_NOWRITE>"
338 msgstr "B<FAN_CLOSE_NOWRITE>"
339
340 #. type: Plain text
341 #: build/C/man7/fanotify.7:267
342 msgid "A file or directory that was opened read-only (B<O_RDONLY>)  was closed."
343 msgstr "読み出し用 (B<O_RDONLY>) にオープンされたファイルがクローズされた。"
344
345 #. type: TP
346 #: build/C/man7/fanotify.7:267
347 #, no-wrap
348 msgid "B<FAN_Q_OVERFLOW>"
349 msgstr "B<FAN_Q_OVERFLOW>"
350
351 #. type: Plain text
352 #: build/C/man7/fanotify.7:274
353 msgid "The event queue exceeded the limit of 16384 entries.  This limit can be overridden by specifying the B<FAN_UNLIMITED_QUEUE> flag when calling B<fanotify_init>(2)."
354 msgstr "イベントキューが 16384 エントリーの上限を超過した。 この上限は B<fanotify_init>(2) 呼び出し時に B<FAN_UNLIMITED_QUEUE> フラグを指定することで上書きできる。"
355
356 #. type: TP
357 #: build/C/man7/fanotify.7:274 build/C/man2/fanotify_mark.2:159
358 #, no-wrap
359 msgid "B<FAN_ACCESS_PERM>"
360 msgstr "B<FAN_ACCESS_PERM>"
361
362 #. type: Plain text
363 #: build/C/man7/fanotify.7:283
364 msgid "An application wants to read a file or directory, for example using B<read>(2)  or B<readdir>(2).  The reader must write a response (as described below)  that determines whether the permission to access the filesystem object shall be granted."
365 msgstr "アプリケーションが例えば B<read>(2) や B<readdir>(2) などを使ってファイルやディレクトリを読み出そうとした。 このイベントを読み出したプログラムは、 そのファイルシステムオブジェクトへのアクセス許可を承認するかを判定し (下記で説明するとおり) 応答を書き込まなければならない。"
366
367 #. type: TP
368 #: build/C/man7/fanotify.7:283 build/C/man2/fanotify_mark.2:151
369 #, no-wrap
370 msgid "B<FAN_OPEN_PERM>"
371 msgstr "B<FAN_OPEN_PERM>"
372
373 #. type: Plain text
374 #: build/C/man7/fanotify.7:288
375 msgid "An application wants to open a file or directory.  The reader must write a response that determines whether the permission to open the filesystem object shall be granted."
376 msgstr "アプリケーションがファイルやディレクトリをオープンしようとした。 このイベントを読み出したプログラムは、 そのファイルシステムオブジェクトのオープンを承認するかを判定し (下記で説明するとおり) 応答を書き込まなければならない。"
377
378 #. type: Plain text
379 #: build/C/man7/fanotify.7:290
380 msgid "To check for any close event, the following bit mask may be used:"
381 msgstr "クローズイベントを確認するために以下のビットマスクを使うことができる。"
382
383 #. type: TP
384 #: build/C/man7/fanotify.7:290 build/C/man2/fanotify_mark.2:186
385 #, no-wrap
386 msgid "B<FAN_CLOSE>"
387 msgstr "B<FAN_CLOSE>"
388
389 #. type: Plain text
390 #: build/C/man7/fanotify.7:294
391 msgid "A file was closed.  This is a synonym for:"
392 msgstr "ファイルがクローズされた。 以下の同義語である。"
393
394 #. type: Plain text
395 #: build/C/man7/fanotify.7:296
396 #, no-wrap
397 msgid "    FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n"
398 msgstr "    FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n"
399
400 #. type: Plain text
401 #: build/C/man7/fanotify.7:301
402 msgid "The following macros are provided to iterate over a buffer containing fanotify event metadata returned by a B<read>(2)  from an fanotify file descriptor:"
403 msgstr "fanotify ファイルディスクリプターからの B<read>(2) が返した fanotify イベントメタデータを含むバッファーに対して繰り返しを行うため、 以下のマクロが提供されている。"
404
405 #. type: TP
406 #: build/C/man7/fanotify.7:301
407 #, no-wrap
408 msgid "B<FAN_EVENT_OK(meta, len)>"
409 msgstr "B<FAN_EVENT_OK(meta, len)>"
410
411 #. type: Plain text
412 #: build/C/man7/fanotify.7:310
413 msgid "This macro checks the remaining length I<len> of the buffer I<meta> against the length of the metadata structure and the I<event_len> field of the first metadata structure in the buffer."
414 msgstr "このマクロは、 バッファー I<meta> の残りの長さ I<len> を、 メタデータ構造体の長さとバッファーの最初のメタデータ構造体の I<event_len> フィールドと比較して検査する。"
415
416 #. type: TP
417 #: build/C/man7/fanotify.7:310
418 #, no-wrap
419 msgid "B<FAN_EVENT_NEXT(meta, len)>"
420 msgstr "B<FAN_EVENT_NEXT(meta, len)>"
421
422 #. type: Plain text
423 #: build/C/man7/fanotify.7:329
424 msgid "This macro uses the length indicated in the I<event_len> field of the metadata structure pointed to by I<meta> to calculate the address of the next metadata structure that follows I<meta>.  I<len> is the number of bytes of metadata that currently remain in the buffer.  The macro returns a pointer to the next metadata structure that follows I<meta>, and reduces I<len> by the number of bytes in the the metadata structure that has been skipped over (i.e., it subtracts I<meta-E<gt>event_len> from I<len>)."
425 msgstr "このマクロは、 I<meta> が指すメタデータ構造体の I<event_len> フィールドで示された長さを使って、 I<meta> の次のメタデータ構造体のアドレスを計算する。 I<len> はバッファーに現在残っているメタデータのバイト数である。 このマクロは I<meta> の次のメタデータ構造体へのポインターを返し、 スキップされたメタデータ構造体のバイト数だけ I<len> を減算する (つまり、 I<len> から I<meta-E<gt>event_len> を引き算する)。"
426
427 #. type: Plain text
428 #: build/C/man7/fanotify.7:331
429 msgid "In addition, there is:"
430 msgstr "また、 以下のマクロも用意されている。"
431
432 #. type: TP
433 #: build/C/man7/fanotify.7:331
434 #, no-wrap
435 msgid "B<FAN_EVENT_METADATA_LEN>"
436 msgstr "B<FAN_EVENT_METADATA_LEN>"
437
438 #. type: Plain text
439 #: build/C/man7/fanotify.7:337
440 msgid "This macro returns the size (in bytes) of the structure I<fanotify_event_metadata>.  This is the minimum size (and currently the only size) of any event metadata."
441 msgstr "このマクロは I<fanotify_event_metadata> 構造体の (バイト単位の) サイズを返す。 返される値はイベントメタデータの最小値である (現在のところ、これが唯一のサイズである)。"
442
443 #. type: SS
444 #: build/C/man7/fanotify.7:337
445 #, no-wrap
446 msgid "Monitoring an fanotify file descriptor for events"
447 msgstr "fanotify ファイルディスクリプターのイベントを監視する"
448
449 #. type: Plain text
450 #: build/C/man7/fanotify.7:344
451 msgid "When an fanotify event occurs, the fanotify file descriptor indicates as readable when passed to B<epoll>(7), B<poll>(2), or B<select>(2)."
452 msgstr "fanotify イベントが発生すると、 B<epoll>(7), B<poll>(2), B<select>(2) に fanotify ファイルディスクリプターが渡された場合には、そのファイルディスクリプターが読み出し可能であると通知される。"
453
454 #. type: SS
455 #: build/C/man7/fanotify.7:344
456 #, no-wrap
457 msgid "Dealing with permission events"
458 msgstr "アクセス許可イベントの取り扱い"
459
460 #. type: Plain text
461 #: build/C/man7/fanotify.7:349
462 msgid "For permission events, the application must B<write>(2)  a structure of the following form to the fanotify file descriptor:"
463 msgstr "アクセス許可イベントでは、 アプリケーションは以下の形式の構造体を fanotify ファイルディスクリプターに B<write>(2) しなければならない。"
464
465 #. type: Plain text
466 #: build/C/man7/fanotify.7:356
467 #, no-wrap
468 msgid ""
469 "struct fanotify_response {\n"
470 "    __s32 fd;\n"
471 "    __u32 response;\n"
472 "};\n"
473 msgstr ""
474 "struct fanotify_response {\n"
475 "    __s32 fd;\n"
476 "    __u32 response;\n"
477 "};\n"
478
479 #. type: Plain text
480 #: build/C/man7/fanotify.7:360
481 msgid "The fields of this structure are as follows:"
482 msgstr "この構造体のフィールドは以下のとおりである。"
483
484 #. type: Plain text
485 #: build/C/man7/fanotify.7:364
486 msgid "This is the file descriptor from the structure I<fanotify_event_metadata>."
487 msgstr "このフィールドは I<fanotify_event_metadata> 構造体で返されたファイルディスクリプターである。"
488
489 #. type: TP
490 #: build/C/man7/fanotify.7:364
491 #, no-wrap
492 msgid "I<response>"
493 msgstr "I<response>"
494
495 #. type: Plain text
496 #: build/C/man7/fanotify.7:372
497 msgid "This field indicates whether or not the permission is to be granted.  Its value must be either B<FAN_ALLOW> to allow the file operation or B<FAN_DENY> to deny the file operation."
498 msgstr "このフィールドはアクセス許可を承認するかどうかを示す。 値は、このファイル操作を許可する B<FAN_ALLOW> か、 このファイル操作を拒否する B<FAN_DENY> のいずれかでなければならない。"
499
500 #. type: Plain text
501 #: build/C/man7/fanotify.7:376
502 msgid "If access is denied, the requesting application call will receive an B<EPERM> error."
503 msgstr "アクセスを拒否した場合、 アクセスを要求したアプリケーションは B<EPERM> エラーを受け取ることになる。"
504
505 #. type: SS
506 #: build/C/man7/fanotify.7:376
507 #, no-wrap
508 msgid "Closing the fanotify file descriptor"
509 msgstr "fanotify ファイルディスクリプターのクローズ"
510
511 #. type: Plain text
512 #: build/C/man7/fanotify.7:384
513 msgid "When all file descriptors referring to the fanotify notification group are closed, the fanotify group is released and its resources are freed for reuse by the kernel.  Upon B<close>(2), outstanding permission events will be set to allowed."
514 msgstr "fanotify 通知グループを参照するすべてのファイルディスクリプターがクローズされると、 fanotify グループは解放され、 カーネルが再利用できるようにそのリソースは解放される。 B<close>(2) の際に、 処理中であったアクセス許可イベントには許可が設定される。"
515
516 #. type: SS
517 #: build/C/man7/fanotify.7:384
518 #, no-wrap
519 msgid "/proc/[pid]/fdinfo"
520 msgstr "/proc/[pid]/fdinfo"
521
522 #. type: Plain text
523 #: build/C/man7/fanotify.7:394
524 msgid "The file I</proc/[pid]/fdinfo/[fd]> contains information about fanotify marks for file descriptor I<fd> of process I<pid>.  See the kernel source file I<Documentation/filesystems/proc.txt> for details."
525 msgstr "ファイル I</proc/[pid]/fdinfo/[fd]> には、 プロセス I<pid> のファイルディスクリプター I<fd> の fanotify マークに関する情報が格納される。 詳細はカーネルのソースファイル I<Documentation/filesystems/proc.txt> を参照。"
526
527 #. type: SH
528 #: build/C/man7/fanotify.7:394 build/C/man2/fanotify_init.2:206
529 #: build/C/man2/fanotify_mark.2:243 build/C/man2/inotify_add_watch.2:84
530 #: build/C/man2/inotify_init.2:79 build/C/man2/inotify_rm_watch.2:55
531 #, no-wrap
532 msgid "ERRORS"
533 msgstr "エラー"
534
535 #. type: Plain text
536 #: build/C/man7/fanotify.7:399
537 msgid "In addition to the usual errors for B<read>(2), the following errors can occur when reading from the fanotify file descriptor:"
538 msgstr "通常の B<read>(2) のエラーに加え、 fanotify ファイルディスクリプターから読み出しを行った際に以下のエラーが発生することがある。"
539
540 #. type: TP
541 #: build/C/man7/fanotify.7:399 build/C/man7/fanotify.7:433
542 #: build/C/man2/fanotify_init.2:207 build/C/man2/fanotify_mark.2:248
543 #: build/C/man2/fanotify_mark.2:257 build/C/man2/inotify_add_watch.2:95
544 #: build/C/man2/inotify_init.2:80 build/C/man2/inotify_rm_watch.2:60
545 #, no-wrap
546 msgid "B<EINVAL>"
547 msgstr "B<EINVAL>"
548
549 #. type: Plain text
550 #: build/C/man7/fanotify.7:402
551 msgid "The buffer is too small to hold the event."
552 msgstr "バッファーがイベントを保持するには小さすぎる。"
553
554 #. type: TP
555 #: build/C/man7/fanotify.7:402 build/C/man2/fanotify_init.2:216
556 #: build/C/man2/inotify_init.2:85
557 #, no-wrap
558 msgid "B<EMFILE>"
559 msgstr "B<EMFILE>"
560
561 #. type: Plain text
562 #: build/C/man7/fanotify.7:409
563 msgid "The per-process limit on the number of open files has been reached.  See the description of B<RLIMIT_NOFILE> in B<getrlimit>(2)."
564 msgstr "オープンしたファイル数のプロセス毎の上限に達した。 B<getrlimit>(2) の B<RLIMIT_NOFILE> の説明を参照。"
565
566 #. type: TP
567 #: build/C/man7/fanotify.7:409 build/C/man2/inotify_init.2:88
568 #, no-wrap
569 msgid "B<ENFILE>"
570 msgstr "B<ENFILE>"
571
572 #. type: Plain text
573 #: build/C/man7/fanotify.7:416
574 msgid "The system-wide limit on the number of open files has been reached.  See I</proc/sys/fs/file-max> in B<proc>(5)."
575 msgstr "オープンされたファイル数のシステム全体の上限に達した。 B<proc>(5) の I</proc/sys/fs/file-max> を参照。"
576
577 #. type: TP
578 #: build/C/man7/fanotify.7:416
579 #, no-wrap
580 msgid "B<ETXTBSY>"
581 msgstr "B<ETXTBSY>"
582
583 #. type: Plain text
584 #: build/C/man7/fanotify.7:429
585 msgid "This error is returned by B<read>(2)  if B<O_RDWR> or B<O_WRONLY> was specified in the I<event_f_flags> argument when calling B<fanotify_init>(2)  and an event occurred for a monitored file that is currently being executed."
586 msgstr "B<fanotify_init>(2) の呼び出し時に B<O_RDWR> か B<O_WRONLY> が I<event_f_flags> 引き数に指定されており、 現在実行中の監視対象のファイルに対してイベントが発生した際に、 このエラーが B<read>(2) から返される。"
587
588 #. type: Plain text
589 #: build/C/man7/fanotify.7:433
590 msgid "In addition to the usual errors for B<write>(2), the following errors can occur when writing to the fanotify file descriptor:"
591 msgstr "通常の B<write>(2) のエラーに加え、 fanotify ファイルディスクリプターに書き込みを行った際に以下のエラーが発生することがある。"
592
593 #. type: Plain text
594 #: build/C/man7/fanotify.7:439
595 msgid "Fanotify access permissions are not enabled in the kernel configuration or the value of I<response> in the response structure is not valid."
596 msgstr "fanotify アクセス許可がカーネルの設定で有効になっていない。 応答構造体の I<response> 値が無効である。"
597
598 #. type: TP
599 #: build/C/man7/fanotify.7:439 build/C/man2/fanotify_mark.2:265
600 #: build/C/man2/inotify_add_watch.2:104
601 #, no-wrap
602 msgid "B<ENOENT>"
603 msgstr "B<ENOENT>"
604
605 #. type: Plain text
606 #: build/C/man7/fanotify.7:446
607 msgid "The file descriptor I<fd> in the response structure is not valid.  This may occur when a response for the permission event has already been written."
608 msgstr "応答構造体のファイルディスクリプター I<fd> が無効である。 このエラーはアクセス許可イベントに対する応答がすでに書き込まれている際に発生する。"
609
610 #. type: SH
611 #: build/C/man7/fanotify.7:446 build/C/man2/fanotify_init.2:233
612 #: build/C/man2/fanotify_mark.2:299 build/C/man7/inotify.7:553
613 #: build/C/man2/inotify_add_watch.2:116 build/C/man2/inotify_init.2:94
614 #: build/C/man2/inotify_rm_watch.2:67
615 #, no-wrap
616 msgid "VERSIONS"
617 msgstr "バージョン"
618
619 #. type: Plain text
620 #: build/C/man7/fanotify.7:450
621 msgid "The fanotify API was introduced in version 2.6.36 of the Linux kernel and enabled in version 2.6.37.  Fdinfo support was added in version 3.8."
622 msgstr "fanotify API は Linux カーネルのバージョン 2.6.36 で導入され、 バージョン 2.6.37 で有効にされた。 fdinfo のサポートはバージョン 3.8 で追加された。"
623
624 #. type: SH
625 #: build/C/man7/fanotify.7:450 build/C/man2/fanotify_init.2:237
626 #: build/C/man2/fanotify_mark.2:303 build/C/man7/inotify.7:561
627 #: build/C/man2/inotify_add_watch.2:118 build/C/man2/inotify_init.2:101
628 #: build/C/man2/inotify_rm_watch.2:69
629 #, no-wrap
630 msgid "CONFORMING TO"
631 msgstr "準拠"
632
633 #. type: Plain text
634 #: build/C/man7/fanotify.7:452
635 msgid "The fanotify API is Linux-specific."
636 msgstr "fanotify API は Linux 独自のものである。"
637
638 #. type: SH
639 #: build/C/man7/fanotify.7:452 build/C/man7/inotify.7:563
640 #, no-wrap
641 msgid "NOTES"
642 msgstr "注意"
643
644 #. type: Plain text
645 #: build/C/man7/fanotify.7:459
646 msgid "The fanotify API is available only if the kernel was built with the B<CONFIG_FANOTIFY> configuration option enabled.  In addition, fanotify permission handling is available only if the B<CONFIG_FANOTIFY_ACCESS_PERMISSIONS> configuration option is enabled."
647 msgstr "fanotify API が利用できるのは、 カーネルが B<CONFIG_FANOTIFY> 設定オプションを有効にして作成されている場合だけである。 また、 fanotify アクセス許可の処理が利用できるのは B<CONFIG_FANOTIFY_ACCESS_PERMISSIONS> 設定オプションが有効になっている場合だけである。"
648
649 #. type: SS
650 #: build/C/man7/fanotify.7:459 build/C/man7/inotify.7:624
651 #, no-wrap
652 msgid "Limitations and caveats"
653 msgstr "制限と警告"
654
655 #. type: Plain text
656 #: build/C/man7/fanotify.7:464
657 msgid "Fanotify reports only events that a user-space program triggers through the filesystem API.  As a result, it does not catch remote events that occur on network filesystems."
658 msgstr "fanotify が報告するのはユーザー空間プログラムがファイルシステム API 経由で行ったイベントだけである。 その結果、 fanotify ではネットワークファイルシステム上で発生したリモートイベントは捕捉できない。"
659
660 #. type: Plain text
661 #: build/C/man7/fanotify.7:471
662 msgid "The fanotify API does not report file accesses and modifications that may occur because of B<mmap>(2), B<msync>(2), and B<munmap>(2)."
663 msgstr "inotify API は B<mmap>(2), B<msync>(2), B<munmap>(2) により起こったファイルのアクセスと変更を報告しない。"
664
665 #. type: Plain text
666 #: build/C/man7/fanotify.7:476
667 msgid "Events for directories are created only if the directory itself is opened, read, and closed.  Adding, removing, or changing children of a marked directory does not create events for the monitored directory itself."
668 msgstr "ディレクトリのイベントは、ディレクトリ自身がオープン、読み出し、クローズされた場合にしか作成されない。 マークされたディレクトリでの子要素の追加、削除、変更では、監視対象のディレクトリ自身へのイベントは作成されない。"
669
670 #. type: Plain text
671 #: build/C/man7/fanotify.7:484
672 msgid "Fanotify monitoring of directories is not recursive: to monitor subdirectories under a directory, additional marks must be created.  (But note that the fanotify API provides no way of detecting when a subdirectory has been created under a marked directory, which makes recursive monitoring difficult.)  Monitoring mounts offers the capability to monitor a whole directory tree."
673 msgstr "fanotify のディレクトリの監視は再帰的ではない。 ディレクトリ内のサブディレクトリを監視するには、 追加で監視用のマークを作成しなければならない。 (ただし、 fanotify API では、サブディレクトリが監視対象としてマークされているディレクトリに作成された際に検出する手段は提供されていない点に注意すること。) マウントの監視を使うことで、 ディレクトリツリー全体を監視することができる。"
674
675 #. type: Plain text
676 #: build/C/man7/fanotify.7:487
677 msgid "The event queue can overflow.  In this case, events are lost."
678 msgstr "ベントキューはオーバーフローすることがある。 この場合、 イベントは失われる。"
679
680 #. type: SH
681 #: build/C/man7/fanotify.7:487 build/C/man2/fanotify_init.2:239
682 #: build/C/man2/fanotify_mark.2:305 build/C/man7/inotify.7:754
683 #, no-wrap
684 msgid "BUGS"
685 msgstr "バグ"
686
687 #. type: Plain text
688 #: build/C/man7/fanotify.7:490
689 msgid "As of Linux 3.17, the following bugs exist:"
690 msgstr "Linux 3.17 時点では、 以下のバグが存在する。"
691
692 #. type: IP
693 #: build/C/man7/fanotify.7:490 build/C/man7/fanotify.7:499
694 #: build/C/man7/fanotify.7:503 build/C/man7/fanotify.7:512
695 #: build/C/man2/fanotify_init.2:242 build/C/man2/fanotify_init.2:250
696 #: build/C/man2/fanotify_mark.2:195 build/C/man2/fanotify_mark.2:201
697 #: build/C/man2/fanotify_mark.2:209 build/C/man2/fanotify_mark.2:215
698 #: build/C/man2/fanotify_mark.2:226 build/C/man2/fanotify_mark.2:307
699 #: build/C/man2/fanotify_mark.2:317 build/C/man2/fanotify_mark.2:323
700 #: build/C/man7/inotify.7:40 build/C/man7/inotify.7:51
701 #: build/C/man7/inotify.7:64 build/C/man7/inotify.7:70
702 #: build/C/man7/inotify.7:73 build/C/man7/inotify.7:270
703 #: build/C/man7/inotify.7:273
704 #, no-wrap
705 msgid "*"
706 msgstr "*"
707
708 #. type: Plain text
709 #: build/C/man7/fanotify.7:499
710 msgid "On Linux, a filesystem object may be accessible through multiple paths, for example, a part of a filesystem may be remounted using the I<--bind> option of B<mount>(8).  A listener that marked a mount will be notified only of events that were triggered for a filesystem object using the same mount.  Any other event will pass unnoticed."
711 msgstr "Linux では、ファイルシステムオブジェクトは複数のパスでアクセス可能である。 例えば、 ファイルシステムの一部は B<mount>(8) の I<--bind> オプションを使って再マウントされることがある。 マークされたマウントの監視者は、 同じマウントを使ったファイルオブジェクトについてのみイベント通知を受ける。 それ以外のイベントは通知されない。"
712
713 #. type: Plain text
714 #: build/C/man7/fanotify.7:503
715 msgid "Calling B<fallocate>(2)  does not create any fanotify events."
716 msgstr "B<fallocate>(2) の呼び出しでは fanotify イベントが作成されない。"
717
718 #.  FIXME . A patch was proposed.
719 #. type: Plain text
720 #: build/C/man7/fanotify.7:512
721 msgid "When an event is generated, no check is made to see whether the user ID of the receiving process has authorization to read or write the file before passing a file descriptor for that file.  This poses a security risk, when the B<CAP_SYS_ADMIN> capability is set for programs executed by unprivileged users."
722 msgstr "イベントが生成された際に、 そのファイルのファイルディスクリプターを渡す前に、 イベントを受信するプロセスのユーザー ID がそのファイルに対する読み出し/書き込み許可があるかの確認は行われない。 非特権ユーザーによって実行されたプログラムに B<CAP_SYS_ADMIN> ケーパビリティーがセットされている場合には、 このことはセキュリティーリスクとなる。"
723
724 #. type: Plain text
725 #: build/C/man7/fanotify.7:522
726 msgid "If a call to B<read>(2)  processes multiple events from the fanotify queue and an error occurs, the return value will be the total length of the events successfully copied to the user-space buffer before the error occurred.  The return value will not be -1, and I<errno> will not be set.  Thus, the reading application has no way to detect the error."
727 msgstr "B<read>(2) の呼び出しが fanotify キューから複数のイベントを処理している際に、 エラーが発生した場合、 返り値はエラーが発生する前までにユーザー空間バッファーに正常にコピーされたイベントの合計長となる。 返り値は -1 にならず、 I<errno> もセットされない。 したがって、 読み出しを行うアプリケーションではエラーを検出する方法はない。"
728
729 #. type: SH
730 #: build/C/man7/fanotify.7:522 build/C/man7/inotify.7:815
731 #, no-wrap
732 msgid "EXAMPLE"
733 msgstr "例"
734
735 #. type: Plain text
736 #: build/C/man7/fanotify.7:532
737 msgid "The following program demonstrates the usage of the fanotify API.  It marks the mount point passed as a command-line argument and waits for events of type B<FAN_PERM_OPEN> and B<FAN_CLOSE_WRITE>.  When a permission event occurs, a B<FAN_ALLOW> response is given."
738 msgstr "以下のプログラムは fanotify API の使用法を示すものである。 コマンドライン引き数で渡されたマウントポイントを監視し、 種別が B<FAN_PERM_OPEN> と B<FAN_CLOSE_WRITE> のイベントを待つ。 アクセス許可イベントが発生には、 B<FAN_ALLOW> 応答を返す。"
739
740 #. type: Plain text
741 #: build/C/man7/fanotify.7:542
742 msgid "The following output was recorded while editing the file I</home/user/temp/notes>.  Before the file was opened, a B<FAN_OPEN_PERM> event occurred.  After the file was closed, a B<FAN_CLOSE_WRITE> event occurred.  Execution of the program ends when the user presses the ENTER key."
743 msgstr "以下の出力例はファイル I</home/user/temp/notes> を編集した際に記録されたものである。 ファイルをオープンする前に B<FAN_OPEN_PERM> イベントが発生している。 ファイルをクローズした後に B<FAN_CLOSE_WRITE> イベントが発生している。 エンターキーをユーザーが押すと、 このプログラムの実行は終了する。"
744
745 #. type: SS
746 #: build/C/man7/fanotify.7:542 build/C/man7/inotify.7:838
747 #, no-wrap
748 msgid "Example output"
749 msgstr "出力例"
750
751 #. type: Plain text
752 #: build/C/man7/fanotify.7:550
753 #, no-wrap
754 msgid ""
755 "# ./fanotify_example /home\n"
756 "Press enter key to terminate.\n"
757 "Listening for events.\n"
758 "FAN_OPEN_PERM: File /home/user/temp/notes\n"
759 "FAN_CLOSE_WRITE: File /home/user/temp/notes\n"
760 msgstr ""
761 "# ./fanotify_example /home\n"
762 "Press enter key to terminate.\n"
763 "Listening for events.\n"
764 "FAN_OPEN_PERM: File /home/user/temp/notes\n"
765 "FAN_CLOSE_WRITE: File /home/user/temp/notes\n"
766
767 #. type: Plain text
768 #: build/C/man7/fanotify.7:552 build/C/man7/inotify.7:850
769 #, no-wrap
770 msgid "Listening for events stopped.\n"
771 msgstr "Listening for events stopped.\n"
772
773 #. type: SS
774 #: build/C/man7/fanotify.7:554 build/C/man7/inotify.7:852
775 #, no-wrap
776 msgid "Program source"
777 msgstr "プログラムソース"
778
779 #. type: Plain text
780 #: build/C/man7/fanotify.7:565
781 #, no-wrap
782 msgid ""
783 "#define _GNU_SOURCE     /* Needed to get O_LARGEFILE definition */\n"
784 "#include E<lt>errno.hE<gt>\n"
785 "#include E<lt>fcntl.hE<gt>\n"
786 "#include E<lt>limits.hE<gt>\n"
787 "#include E<lt>poll.hE<gt>\n"
788 "#include E<lt>stdio.hE<gt>\n"
789 "#include E<lt>stdlib.hE<gt>\n"
790 "#include E<lt>sys/fanotify.hE<gt>\n"
791 "#include E<lt>unistd.hE<gt>\n"
792 msgstr ""
793 "#define _GNU_SOURCE     /* O_LARGEFILE の定義を得るために必要 */\n"
794 "#include E<lt>errno.hE<gt>\n"
795 "#include E<lt>fcntl.hE<gt>\n"
796 "#include E<lt>limits.hE<gt>\n"
797 "#include E<lt>poll.hE<gt>\n"
798 "#include E<lt>stdio.hE<gt>\n"
799 "#include E<lt>stdlib.hE<gt>\n"
800 "#include E<lt>sys/fanotify.hE<gt>\n"
801 "#include E<lt>unistd.hE<gt>\n"
802
803 #. type: Plain text
804 #: build/C/man7/fanotify.7:567
805 #, no-wrap
806 msgid "/* Read all available fanotify events from the file descriptor 'fd' */\n"
807 msgstr "/* ファイルディスクリプター 'fd' から読み出しできる全 fanotify イベントを読み出す */\n"
808
809 #. type: Plain text
810 #: build/C/man7/fanotify.7:578
811 #, no-wrap
812 msgid ""
813 "static void\n"
814 "handle_events(int fd)\n"
815 "{\n"
816 "    const struct fanotify_event_metadata *metadata;\n"
817 "    struct fanotify_event_metadata buf[200];\n"
818 "    ssize_t len;\n"
819 "    char path[PATH_MAX];\n"
820 "    ssize_t path_len;\n"
821 "    char procfd_path[PATH_MAX];\n"
822 "    struct fanotify_response response;\n"
823 msgstr ""
824 "static void\n"
825 "handle_events(int fd)\n"
826 "{\n"
827 "    const struct fanotify_event_metadata *metadata;\n"
828 "    struct fanotify_event_metadata buf[200];\n"
829 "    ssize_t len;\n"
830 "    char path[PATH_MAX];\n"
831 "    ssize_t path_len;\n"
832 "    char procfd_path[PATH_MAX];\n"
833 "    struct fanotify_response response;\n"
834
835 #. type: Plain text
836 #: build/C/man7/fanotify.7:580
837 #, no-wrap
838 msgid "    /* Loop while events can be read from fanotify file descriptor */\n"
839 msgstr "    /* fanotify ファイルディスクリプターからイベントが読み出せる間はループする */\n"
840
841 #. type: Plain text
842 #: build/C/man7/fanotify.7:582
843 #, no-wrap
844 msgid "    for(;;) {\n"
845 msgstr "    for(;;) {\n"
846
847 #. type: Plain text
848 #: build/C/man7/fanotify.7:584
849 #, no-wrap
850 msgid "        /* Read some events */\n"
851 msgstr "        /* イベントを読み出す */\n"
852
853 #. type: Plain text
854 #: build/C/man7/fanotify.7:590
855 #, no-wrap
856 msgid ""
857 "        len = read(fd, (void *) &buf, sizeof(buf));\n"
858 "        if (len == -1 && errno != EAGAIN) {\n"
859 "            perror(\"read\");\n"
860 "            exit(EXIT_FAILURE);\n"
861 "        }\n"
862 msgstr ""
863 "        len = read(fd, (void *) &buf, sizeof(buf));\n"
864 "        if (len == -1 && errno != EAGAIN) {\n"
865 "            perror(\"read\");\n"
866 "            exit(EXIT_FAILURE);\n"
867 "        }\n"
868
869 #. type: Plain text
870 #: build/C/man7/fanotify.7:592
871 #, no-wrap
872 msgid "        /* Check if end of available data reached */\n"
873 msgstr "        /* 読み出せるデータの最後に達しているかチェックする */\n"
874
875 #. type: Plain text
876 #: build/C/man7/fanotify.7:595 build/C/man7/inotify.7:901
877 #, no-wrap
878 msgid ""
879 "        if (len E<lt>= 0)\n"
880 "            break;\n"
881 msgstr ""
882 "        if (len E<lt>= 0)\n"
883 "            break;\n"
884
885 #. type: Plain text
886 #: build/C/man7/fanotify.7:597
887 #, no-wrap
888 msgid "        /* Point to the first event in the buffer */\n"
889 msgstr "        /* バッファーの最初のイベントを参照する */\n"
890
891 #. type: Plain text
892 #: build/C/man7/fanotify.7:599
893 #, no-wrap
894 msgid "        metadata = buf;\n"
895 msgstr "        metadata = buf;\n"
896
897 #. type: Plain text
898 #: build/C/man7/fanotify.7:601 build/C/man7/inotify.7:903
899 #, no-wrap
900 msgid "        /* Loop over all events in the buffer */\n"
901 msgstr "        /* バッファー内の全イベントを処理する */\n"
902
903 #. type: Plain text
904 #: build/C/man7/fanotify.7:603
905 #, no-wrap
906 msgid "        while (FAN_EVENT_OK(metadata, len)) {\n"
907 msgstr "        while (FAN_EVENT_OK(metadata, len)) {\n"
908
909 #. type: Plain text
910 #: build/C/man7/fanotify.7:605
911 #, no-wrap
912 msgid "            /* Check that run-time and compile-time structures match */\n"
913 msgstr "            /* 実行時とコンパイル時の構造体が一致するか確認する */\n"
914
915 #. type: Plain text
916 #: build/C/man7/fanotify.7:611
917 #, no-wrap
918 msgid ""
919 "            if (metadata-E<gt>vers != FANOTIFY_METADATA_VERSION) {\n"
920 "                fprintf(stderr,\n"
921 "                        \"Mismatch of fanotify metadata version.\\en\");\n"
922 "                exit(EXIT_FAILURE);\n"
923 "            }\n"
924 msgstr ""
925 "            if (metadata-E<gt>vers != FANOTIFY_METADATA_VERSION) {\n"
926 "                fprintf(stderr,\n"
927 "                        \"Mismatch of fanotify metadata version.\\en\");\n"
928 "                exit(EXIT_FAILURE);\n"
929 "            }\n"
930
931 #. type: Plain text
932 #: build/C/man7/fanotify.7:615
933 #, no-wrap
934 msgid ""
935 "            /* metadata-E<gt>fd contains either FAN_NOFD, indicating a\n"
936 "               queue overflow, or a file descriptor (a nonnegative\n"
937 "               integer). Here, we simply ignore queue overflow. */\n"
938 msgstr ""
939 "            /* metadata-E<gt>fd には、キューのオーバーフローを示す FAN_NOFD か、\n"
940 "               ファイルディスクリプター (負でない整数) のいずれかが入っている。\n"
941 "               ここではキューのオーバーフローは無視している。 */\n"
942
943 #. type: Plain text
944 #: build/C/man7/fanotify.7:617
945 #, no-wrap
946 msgid "            if (metadata-E<gt>fd E<gt>= 0) {\n"
947 msgstr "            if (metadata-E<gt>fd E<gt>= 0) {\n"
948
949 #. type: Plain text
950 #: build/C/man7/fanotify.7:619
951 #, no-wrap
952 msgid "                /* Handle open permission event */\n"
953 msgstr "                /* オープン許可イベントを処理する */\n"
954
955 #. type: Plain text
956 #: build/C/man7/fanotify.7:622
957 #, no-wrap
958 msgid ""
959 "                if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n"
960 "                    printf(\"FAN_OPEN_PERM: \");\n"
961 msgstr ""
962 "                if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n"
963 "                    printf(\"FAN_OPEN_PERM: \");\n"
964
965 #. type: Plain text
966 #: build/C/man7/fanotify.7:624
967 #, no-wrap
968 msgid "                    /* Allow file to be opened */\n"
969 msgstr "                    /* ファイルのオープンを許可する */\n"
970
971 #. type: Plain text
972 #: build/C/man7/fanotify.7:630
973 #, no-wrap
974 msgid ""
975 "                    response.fd = metadata-E<gt>fd;\n"
976 "                    response.response = FAN_ALLOW;\n"
977 "                    write(fd, &response,\n"
978 "                          sizeof(struct fanotify_response));\n"
979 "                }\n"
980 msgstr ""
981 "                    response.fd = metadata-E<gt>fd;\n"
982 "                    response.response = FAN_ALLOW;\n"
983 "                    write(fd, &response,\n"
984 "                          sizeof(struct fanotify_response));\n"
985 "                }\n"
986
987 #. type: Plain text
988 #: build/C/man7/fanotify.7:632
989 #, no-wrap
990 msgid "                /* Handle closing of writable file event */\n"
991 msgstr "                /* 書き込み可能ファイルのクローズイベントを処理する */\n"
992
993 #. type: Plain text
994 #: build/C/man7/fanotify.7:635
995 #, no-wrap
996 msgid ""
997 "                if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n"
998 "                    printf(\"FAN_CLOSE_WRITE: \");\n"
999 msgstr ""
1000 "                if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n"
1001 "                    printf(\"FAN_CLOSE_WRITE: \");\n"
1002
1003 #. type: Plain text
1004 #: build/C/man7/fanotify.7:637
1005 #, no-wrap
1006 msgid "                /* Retrieve and print pathname of the accessed file */\n"
1007 msgstr "                /* アクセスされたファイルのパス名を取得し表示する */\n"
1008
1009 #. type: Plain text
1010 #: build/C/man7/fanotify.7:646
1011 #, no-wrap
1012 msgid ""
1013 "                snprintf(procfd_path, sizeof(procfd_path),\n"
1014 "                         \"/proc/self/fd/%d\", metadata-E<gt>fd);\n"
1015 "                path_len = readlink(procfd_path, path,\n"
1016 "                                    sizeof(path) - 1);\n"
1017 "                if (path_len == -1) {\n"
1018 "                    perror(\"readlink\");\n"
1019 "                    exit(EXIT_FAILURE);\n"
1020 "                }\n"
1021 msgstr ""
1022 "                snprintf(procfd_path, sizeof(procfd_path),\n"
1023 "                         \"/proc/self/fd/%d\", metadata-E<gt>fd);\n"
1024 "                path_len = readlink(procfd_path, path,\n"
1025 "                                    sizeof(path) - 1);\n"
1026 "                if (path_len == -1) {\n"
1027 "                    perror(\"readlink\");\n"
1028 "                    exit(EXIT_FAILURE);\n"
1029 "                }\n"
1030
1031 #. type: Plain text
1032 #: build/C/man7/fanotify.7:649
1033 #, no-wrap
1034 msgid ""
1035 "                path[path_len] = '\\e0';\n"
1036 "                printf(\"File %s\\en\", path);\n"
1037 msgstr ""
1038 "                path[path_len] = '\\e0';\n"
1039 "                printf(\"File %s\\en\", path);\n"
1040
1041 #. type: Plain text
1042 #: build/C/man7/fanotify.7:651
1043 #, no-wrap
1044 msgid "                /* Close the file descriptor of the event */\n"
1045 msgstr "                /* イベントのファイルディスクリプターをクローズする */\n"
1046
1047 #. type: Plain text
1048 #: build/C/man7/fanotify.7:654
1049 #, no-wrap
1050 msgid ""
1051 "                close(metadata-E<gt>fd);\n"
1052 "            }\n"
1053 msgstr ""
1054 "                close(metadata-E<gt>fd);\n"
1055 "            }\n"
1056
1057 #. type: Plain text
1058 #: build/C/man7/fanotify.7:656
1059 #, no-wrap
1060 msgid "            /* Advance to next event */\n"
1061 msgstr "            /* 次のイベントに進む */\n"
1062
1063 #. type: Plain text
1064 #: build/C/man7/fanotify.7:661
1065 #, no-wrap
1066 msgid ""
1067 "            metadata = FAN_EVENT_NEXT(metadata, len);\n"
1068 "        }\n"
1069 "    }\n"
1070 "}\n"
1071 msgstr ""
1072 "            metadata = FAN_EVENT_NEXT(metadata, len);\n"
1073 "        }\n"
1074 "    }\n"
1075 "}\n"
1076
1077 #. type: Plain text
1078 #: build/C/man7/fanotify.7:669
1079 #, no-wrap
1080 msgid ""
1081 "int\n"
1082 "main(int argc, char *argv[])\n"
1083 "{\n"
1084 "    char buf;\n"
1085 "    int fd, poll_num;\n"
1086 "    nfds_t nfds;\n"
1087 "    struct pollfd fds[2];\n"
1088 msgstr ""
1089 "int\n"
1090 "main(int argc, char *argv[])\n"
1091 "{\n"
1092 "    char buf;\n"
1093 "    int fd, poll_num;\n"
1094 "    nfds_t nfds;\n"
1095 "    struct pollfd fds[2];\n"
1096
1097 #. type: Plain text
1098 #: build/C/man7/fanotify.7:671
1099 #, no-wrap
1100 msgid "    /* Check mount point is supplied */\n"
1101 msgstr "    /* マウントポイントが指定されたか確認する */\n"
1102
1103 #. type: Plain text
1104 #: build/C/man7/fanotify.7:676
1105 #, no-wrap
1106 msgid ""
1107 "    if (argc != 2) {\n"
1108 "        fprintf(stderr, \"Usage: %s MOUNT\\en\", argv[0]);\n"
1109 "        exit(EXIT_FAILURE);\n"
1110 "    }\n"
1111 msgstr ""
1112 "    if (argc != 2) {\n"
1113 "        fprintf(stderr, \"Usage: %s MOUNT\\en\", argv[0]);\n"
1114 "        exit(EXIT_FAILURE);\n"
1115 "    }\n"
1116
1117 #. type: Plain text
1118 #: build/C/man7/fanotify.7:678
1119 #, no-wrap
1120 msgid "    printf(\"Press enter key to terminate.\\en\");\n"
1121 msgstr "    printf(\"Press enter key to terminate.\\en\");\n"
1122
1123 #. type: Plain text
1124 #: build/C/man7/fanotify.7:680
1125 #, no-wrap
1126 msgid "    /* Create the file descriptor for accessing the fanotify API */\n"
1127 msgstr "    /* fanotify API にアクセスするためのファイルディスクリプターを作成する */\n"
1128
1129 #. type: Plain text
1130 #: build/C/man7/fanotify.7:687
1131 #, no-wrap
1132 msgid ""
1133 "    fd = fanotify_init(FAN_CLOEXEC | FAN_CLASS_CONTENT | FAN_NONBLOCK,\n"
1134 "                       O_RDONLY | O_LARGEFILE);\n"
1135 "    if (fd == -1) {\n"
1136 "        perror(\"fanotify_init\");\n"
1137 "        exit(EXIT_FAILURE);\n"
1138 "    }\n"
1139 msgstr ""
1140 "    fd = fanotify_init(FAN_CLOEXEC | FAN_CLASS_CONTENT | FAN_NONBLOCK,\n"
1141 "                       O_RDONLY | O_LARGEFILE);\n"
1142 "    if (fd == -1) {\n"
1143 "        perror(\"fanotify_init\");\n"
1144 "        exit(EXIT_FAILURE);\n"
1145 "    }\n"
1146
1147 #. type: Plain text
1148 #: build/C/man7/fanotify.7:692
1149 #, no-wrap
1150 msgid ""
1151 "    /* Mark the mount for:\n"
1152 "       - permission events before opening files\n"
1153 "       - notification events after closing a write-enabled\n"
1154 "         file descriptor */\n"
1155 msgstr ""
1156 "    /* 指定されたマウントに対して以下を監視するようにマークを付ける:\n"
1157 "       - ファイルのオープン前のアクセス許可イベント\n"
1158 "       - 書き込み可能なファイルディスクリプターのクローズ後の\n"
1159 "         通知イベント */\n"
1160
1161 #. type: Plain text
1162 #: build/C/man7/fanotify.7:699
1163 #, no-wrap
1164 msgid ""
1165 "    if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,\n"
1166 "                      FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,\n"
1167 "                      argv[1]) == -1) {\n"
1168 "        perror(\"fanotify_mark\");\n"
1169 "        exit(EXIT_FAILURE);\n"
1170 "    }\n"
1171 msgstr ""
1172 "    if (fanotify_mark(fd, FAN_MARK_ADD | FAN_MARK_MOUNT,\n"
1173 "                      FAN_OPEN_PERM | FAN_CLOSE_WRITE, AT_FDCWD,\n"
1174 "                      argv[1]) == -1) {\n"
1175 "        perror(\"fanotify_mark\");\n"
1176 "        exit(EXIT_FAILURE);\n"
1177 "    }\n"
1178
1179 #. type: Plain text
1180 #: build/C/man7/fanotify.7:701 build/C/man7/inotify.7:989
1181 #, no-wrap
1182 msgid "    /* Prepare for polling */\n"
1183 msgstr "    /* ポーリングの準備 */\n"
1184
1185 #. type: Plain text
1186 #: build/C/man7/fanotify.7:703 build/C/man7/inotify.7:991
1187 #, no-wrap
1188 msgid "    nfds = 2;\n"
1189 msgstr "    nfds = 2;\n"
1190
1191 #. type: Plain text
1192 #: build/C/man7/fanotify.7:705 build/C/man7/inotify.7:993
1193 #, no-wrap
1194 msgid "    /* Console input */\n"
1195 msgstr "    /* コンソールの入力 */\n"
1196
1197 #. type: Plain text
1198 #: build/C/man7/fanotify.7:708 build/C/man7/inotify.7:996
1199 #, no-wrap
1200 msgid ""
1201 "    fds[0].fd = STDIN_FILENO;\n"
1202 "    fds[0].events = POLLIN;\n"
1203 msgstr ""
1204 "    fds[0].fd = STDIN_FILENO;\n"
1205 "    fds[0].events = POLLIN;\n"
1206
1207 #. type: Plain text
1208 #: build/C/man7/fanotify.7:710
1209 #, no-wrap
1210 msgid "    /* Fanotify input */\n"
1211 msgstr "    /* fanotify の入力 */\n"
1212
1213 #. type: Plain text
1214 #: build/C/man7/fanotify.7:713 build/C/man7/inotify.7:1001
1215 #, no-wrap
1216 msgid ""
1217 "    fds[1].fd = fd;\n"
1218 "    fds[1].events = POLLIN;\n"
1219 msgstr ""
1220 "    fds[1].fd = fd;\n"
1221 "    fds[1].events = POLLIN;\n"
1222
1223 #. type: Plain text
1224 #: build/C/man7/fanotify.7:715
1225 #, no-wrap
1226 msgid "    /* This is the loop to wait for incoming events */\n"
1227 msgstr "    /* イベントの発生を待つループ */\n"
1228
1229 #. type: Plain text
1230 #: build/C/man7/fanotify.7:717
1231 #, no-wrap
1232 msgid "    printf(\"Listening for events.\\en\");\n"
1233 msgstr "    printf(\"Listening for events.\\en\");\n"
1234
1235 #. type: Plain text
1236 #: build/C/man7/fanotify.7:723
1237 #, no-wrap
1238 msgid ""
1239 "    while (1) {\n"
1240 "        poll_num = poll(fds, nfds, -1);\n"
1241 "        if (poll_num == -1) {\n"
1242 "            if (errno == EINTR)     /* Interrupted by a signal */\n"
1243 "                continue;           /* Restart poll() */\n"
1244 msgstr ""
1245 "    while (1) {\n"
1246 "        poll_num = poll(fds, nfds, -1);\n"
1247 "        if (poll_num == -1) {\n"
1248 "            if (errno == EINTR)     /* シグナルに割り込まれた場合 */\n"
1249 "                continue;           /* poll() を再開する */\n"
1250
1251 #. type: Plain text
1252 #: build/C/man7/fanotify.7:727
1253 #, no-wrap
1254 msgid ""
1255 "            perror(\"poll\");         /* Unexpected error */\n"
1256 "            exit(EXIT_FAILURE);\n"
1257 "        }\n"
1258 msgstr ""
1259 "            perror(\"poll\");         /* 予期しないエラー */\n"
1260 "            exit(EXIT_FAILURE);\n"
1261 "        }\n"
1262
1263 #. type: Plain text
1264 #: build/C/man7/fanotify.7:730
1265 #, no-wrap
1266 msgid ""
1267 "        if (poll_num E<gt> 0) {\n"
1268 "            if (fds[0].revents & POLLIN) {\n"
1269 msgstr ""
1270 "        if (poll_num E<gt> 0) {\n"
1271 "            if (fds[0].revents & POLLIN) {\n"
1272
1273 #. type: Plain text
1274 #: build/C/man7/fanotify.7:732
1275 #, no-wrap
1276 msgid "                /* Console input is available: empty stdin and quit */\n"
1277 msgstr "                /* コンソールからの入力がある場合: 空の標準入力であれば終了 */\n"
1278
1279 #. type: Plain text
1280 #: build/C/man7/fanotify.7:737 build/C/man7/inotify.7:1024
1281 #, no-wrap
1282 msgid ""
1283 "                while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != '\\en')\n"
1284 "                    continue;\n"
1285 "                break;\n"
1286 "            }\n"
1287 msgstr ""
1288 "                while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != '\\en')\n"
1289 "                    continue;\n"
1290 "                break;\n"
1291 "            }\n"
1292
1293 #. type: Plain text
1294 #: build/C/man7/fanotify.7:739 build/C/man7/inotify.7:1026
1295 #, no-wrap
1296 msgid "            if (fds[1].revents & POLLIN) {\n"
1297 msgstr "            if (fds[1].revents & POLLIN) {\n"
1298
1299 #. type: Plain text
1300 #: build/C/man7/fanotify.7:741
1301 #, no-wrap
1302 msgid "                /* Fanotify events are available */\n"
1303 msgstr "                /* fanotify イベントがある場合 */\n"
1304
1305 #. type: Plain text
1306 #: build/C/man7/fanotify.7:746
1307 #, no-wrap
1308 msgid ""
1309 "                handle_events(fd);\n"
1310 "            }\n"
1311 "        }\n"
1312 "    }\n"
1313 msgstr ""
1314 "                handle_events(fd);\n"
1315 "            }\n"
1316 "        }\n"
1317 "    }\n"
1318
1319 #. type: Plain text
1320 #: build/C/man7/fanotify.7:750
1321 #, no-wrap
1322 msgid ""
1323 "    printf(\"Listening for events stopped.\\en\");\n"
1324 "    exit(EXIT_SUCCESS);\n"
1325 "}\n"
1326 msgstr ""
1327 "    printf(\"Listening for events stopped.\\en\");\n"
1328 "    exit(EXIT_SUCCESS);\n"
1329 "}\n"
1330
1331 #. type: SH
1332 #: build/C/man7/fanotify.7:751 build/C/man2/fanotify_init.2:260
1333 #: build/C/man2/fanotify_mark.2:331 build/C/man7/inotify.7:1044
1334 #: build/C/man2/inotify_add_watch.2:120 build/C/man2/inotify_init.2:103
1335 #: build/C/man2/inotify_rm_watch.2:71
1336 #, no-wrap
1337 msgid "SEE ALSO"
1338 msgstr "関連項目"
1339
1340 #. type: Plain text
1341 #: build/C/man7/fanotify.7:756
1342 msgid "B<fanotify_init>(2), B<fanotify_mark>(2), B<inotify>(7)"
1343 msgstr "B<fanotify_init>(2), B<fanotify_mark>(2), B<inotify>(7)"
1344
1345 #. type: SH
1346 #: build/C/man7/fanotify.7:756 build/C/man2/fanotify_init.2:263
1347 #: build/C/man2/fanotify_mark.2:334 build/C/man7/inotify.7:1057
1348 #: build/C/man2/inotify_add_watch.2:124 build/C/man2/inotify_init.2:107
1349 #: build/C/man2/inotify_rm_watch.2:75
1350 #, no-wrap
1351 msgid "COLOPHON"
1352 msgstr "この文書について"
1353
1354 #. type: Plain text
1355 #: build/C/man7/fanotify.7:764 build/C/man2/fanotify_init.2:271
1356 #: build/C/man2/fanotify_mark.2:342 build/C/man7/inotify.7:1065
1357 #: build/C/man2/inotify_add_watch.2:132 build/C/man2/inotify_init.2:115
1358 #: build/C/man2/inotify_rm_watch.2:83
1359 msgid "This page is part of release 3.78 of the Linux I<man-pages> project.  A description of the project, information about reporting bugs, and the latest version of this page, can be found at \\%http://www.kernel.org/doc/man-pages/."
1360 msgstr ""
1361 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.78 の一部\n"
1362 "である。プロジェクトの説明とバグ報告に関する情報は\n"
1363 "http://www.kernel.org/doc/man-pages/ に書かれている。"
1364
1365 #. type: TH
1366 #: build/C/man2/fanotify_init.2:24
1367 #, no-wrap
1368 msgid "FANOTIFY_INIT"
1369 msgstr "FANOTIFY_INIT"
1370
1371 #. type: TH
1372 #: build/C/man2/fanotify_init.2:24 build/C/man2/fanotify_mark.2:24
1373 #, no-wrap
1374 msgid "2014-10-02"
1375 msgstr "2014-10-02"
1376
1377 #. type: Plain text
1378 #: build/C/man2/fanotify_init.2:27
1379 msgid "fanotify_init - create and initialize fanotify group"
1380 msgstr "fanotify_init - fanotify グループを作成し、初期化する"
1381
1382 #. type: SH
1383 #: build/C/man2/fanotify_init.2:27 build/C/man2/fanotify_mark.2:28
1384 #: build/C/man2/inotify_add_watch.2:31 build/C/man2/inotify_init.2:32
1385 #: build/C/man2/inotify_rm_watch.2:30
1386 #, no-wrap
1387 msgid "SYNOPSIS"
1388 msgstr "書式"
1389
1390 #. type: Plain text
1391 #: build/C/man2/fanotify_init.2:29
1392 msgid "B<#include E<lt>fcntl.hE<gt>>"
1393 msgstr "B<#include E<lt>fcntl.hE<gt>>"
1394
1395 #. type: Plain text
1396 #: build/C/man2/fanotify_init.2:31
1397 msgid "B<#include E<lt>sys/fanotify.hE<gt>>"
1398 msgstr "B<#include E<lt>sys/fanotify.hE<gt>>"
1399
1400 #. type: Plain text
1401 #: build/C/man2/fanotify_init.2:33
1402 msgid "B<int fanotify_init(unsigned int >I<flags>B<, unsigned int >I<event_f_flags>B<);>"
1403 msgstr "B<int fanotify_init(unsigned int >I<flags>B<, unsigned int >I<event_f_flags>B<);>"
1404
1405 #. type: Plain text
1406 #: build/C/man2/fanotify_init.2:36 build/C/man2/fanotify_mark.2:39
1407 msgid "For an overview of the fanotify API, see B<fanotify>(7)."
1408 msgstr "fanotify API の概要については B<fanotify>(7) を参照。"
1409
1410 #. type: Plain text
1411 #: build/C/man2/fanotify_init.2:40
1412 msgid "B<fanotify_init>()  initializes a new fanotify group and returns a file descriptor for the event queue associated with the group."
1413 msgstr "B<fanotify_init>() は新しい fanotify グループを初期化し、 このグループに関連付けられたイベントキューに対するファイルディスクリプターを返す。"
1414
1415 #. type: Plain text
1416 #: build/C/man2/fanotify_init.2:51
1417 msgid "The file descriptor is used in calls to B<fanotify_mark>(2)  to specify the files, directories, and mounts for which fanotify events shall be created.  These events are received by reading from the file descriptor.  Some events are only informative, indicating that a file has been accessed.  Other events can be used to determine whether another application is permitted to access a file or directory.  Permission to access filesystem objects is granted by writing to the file descriptor."
1418 msgstr "このファイルディスクリプターは、 B<fanotify_mark>(2) の呼び出しで fanotify イベントが作成されるファイル、 ディレクトリ、 マウントを指定するのに使用できる。 B<fanotify_mark>(2) で指定したファイル、 これらのイベントは、 このファイルディスクリプターからの読み出しで受信する。 いくつかのイベントは、 ファイルがアクセスされたことを示す単なる情報である。 他のいくつかのイベントは、 別のアプリケーションがファイルやディレクトリにアクセスする許可を与えるかを判定するのに使用される。 ファイルシステムオブジェクトへのアクセス許可イベントについては、 承認結果をこのファイルディスクリプターに書き込む。"
1419
1420 #. type: Plain text
1421 #: build/C/man2/fanotify_init.2:54
1422 msgid "Multiple programs may be using the fanotify interface at the same time to monitor the same files."
1423 msgstr "複数のプログラムが同時に fanotify インターフェースを使って同じファイルを同時に監視することができる。"
1424
1425 #. type: Plain text
1426 #: build/C/man2/fanotify_init.2:58
1427 msgid "In the current implementation, the number of fanotify groups per user is limited to 128.  This limit cannot be overridden."
1428 msgstr "現在の実装では、 ユーザーあたりの fanotify グループ数は 128 に制限されている。 この制限は上書きすることができない。"
1429
1430 #. type: Plain text
1431 #: build/C/man2/fanotify_init.2:67
1432 msgid "Calling B<fanotify_init>()  requires the B<CAP_SYS_ADMIN> capability.  This constraint might be relaxed in future versions of the API.  Therefore, certain additional capability checks have been implemented as indicated below."
1433 msgstr "B<fanotify_init>() を呼び出すには B<CAP_SYS_ADMIN> ケーパビリティーが必要である。 この制約は将来のバージョンの API で緩和される可能性がある。 そのため、 以下に示すケーパビリティーチェックのいくつかが実装されている。"
1434
1435 #. type: Plain text
1436 #: build/C/man2/fanotify_init.2:73
1437 msgid "The I<flags> argument contains a multi-bit field defining the notification class of the listening application and further single bit fields specifying the behavior of the file descriptor."
1438 msgstr "I<flags> 引き数は、 イベントを待つアプリケーションの通知クラスを定義する複数ビットのフィールドである。 これに加えて、 このファイルディスクリプターの動作を示す 1 ビットのフィールドがある。"
1439
1440 #. type: Plain text
1441 #: build/C/man2/fanotify_init.2:77
1442 msgid "If multiple listeners for permission events exist, the notification class is used to establish the sequence in which the listeners receive the events."
1443 msgstr "アクセス許可イベントを監視しているプログラムが複数いる場合、 通知クラスを使って監視するプログラムのイベント受信順序が管理される。"
1444
1445 #. type: Plain text
1446 #: build/C/man2/fanotify_init.2:80
1447 msgid "Only one of the following notification classes may be specified in I<flags>:"
1448 msgstr "以下の通知クラスのいずれか一つだけを I<flags> に指定できる。"
1449
1450 #. type: TP
1451 #: build/C/man2/fanotify_init.2:80
1452 #, no-wrap
1453 msgid "B<FAN_CLASS_PRE_CONTENT>"
1454 msgstr "B<FAN_CLASS_PRE_CONTENT>"
1455
1456 #. type: Plain text
1457 #: build/C/man2/fanotify_init.2:88
1458 msgid "This value allows the receipt of events notifying that a file has been accessed and events for permission decisions if a file may be accessed.  It is intended for event listeners that need to access files before they contain their final data.  This notification class might be used by hierarchical storage managers, for example."
1459 msgstr "この値は、 ファイルがアクセスされたことを通知するイベントと、 ファイルへのアクセスするかの許可の判断を求めるイベントを受信することを示す。 これはイベント受信者がファイルが最終的なデータを格納する前にそのファイルにアクセスする必要がある場合に使用される。 この通知クラスは例えば階層型ストレージ管理などで使用される。"
1460
1461 #. type: TP
1462 #: build/C/man2/fanotify_init.2:88
1463 #, no-wrap
1464 msgid "B<FAN_CLASS_CONTENT>"
1465 msgstr "B<FAN_CLASS_CONTENT>"
1466
1467 #. type: Plain text
1468 #: build/C/man2/fanotify_init.2:96
1469 msgid "This value allows the receipt of events notifying that a file has been accessed and events for permission decisions if a file may be accessed.  It is intended for event listeners that need to access files when they already contain their final content.  This notification class might be used by malware detection programs, for example."
1470 msgstr "この値は、 ファイルがアクセスされたことを通知するイベントと、 ファイルへのアクセスするかの許可の判断を求めるイベントを受信することを示す。 これはイベント受信者がファイルに最終的なデータが格納された際にそのファイルにアクセスする必要がある場合に使用される。 この通知クラスは例えばウイルス検知プログラムなどで使用される。"
1471
1472 #. type: TP
1473 #: build/C/man2/fanotify_init.2:96
1474 #, no-wrap
1475 msgid "B<FAN_CLASS_NOTIF>"
1476 msgstr "B<FAN_CLASS_NOTIF>"
1477
1478 #. type: Plain text
1479 #: build/C/man2/fanotify_init.2:103
1480 msgid "This is the default value.  It does not need to be specified.  This value only allows the receipt of events notifying that a file has been accessed.  Permission decisions before the file is accessed are not possible."
1481 msgstr "これはデフォルト値である。 この値を指定する必要はない。 この値は、 ファイルがアクセスされたことを通知するイベントの受信だけを行うことを意味する。 ファイルがアクセスする前にアクセス許可の判定を行うことはできない。"
1482
1483 #. type: Plain text
1484 #: build/C/man2/fanotify_init.2:111
1485 msgid "Listeners with different notification classes will receive events in the order B<FAN_CLASS_PRE_CONTENT>, B<FAN_CLASS_CONTENT>, B<FAN_CLASS_NOTIF>.  The order of notification for listeners in the same notification class is undefined."
1486 msgstr "異なる通知クラスの受信者は B<FAN_CLASS_PRE_CONTENT>, B<FAN_CLASS_CONTENT>, B<FAN_CLASS_NOTIF> の順序でイベントを受信する。 同じ通知クラスの受信者での通知順序は不定である。"
1487
1488 #. type: Plain text
1489 #: build/C/man2/fanotify_init.2:114
1490 msgid "The following bits can additionally be set in I<flags>:"
1491 msgstr "I<flags> には以下のビットを追加でセットすることができる。"
1492
1493 #. type: TP
1494 #: build/C/man2/fanotify_init.2:114
1495 #, no-wrap
1496 msgid "B<FAN_CLOEXEC>"
1497 msgstr "B<FAN_CLOEXEC>"
1498
1499 #. type: Plain text
1500 #: build/C/man2/fanotify_init.2:123
1501 msgid "Set the close-on-exec flag (B<FD_CLOEXEC>)  on the new file descriptor.  See the description of the B<O_CLOEXEC> flag in B<open>(2)."
1502 msgstr "close-on-exec フラグ (B<FD_CLOEXEC>) を新しいファイルディスクリプターにセットする。 B<open>(2) の B<O_CLOEXEC> フラグの説明を参照。"
1503
1504 #. type: TP
1505 #: build/C/man2/fanotify_init.2:123
1506 #, no-wrap
1507 msgid "B<FAN_NONBLOCK>"
1508 msgstr "B<FAN_NONBLOCK>"
1509
1510 #. type: Plain text
1511 #: build/C/man2/fanotify_init.2:133
1512 msgid "Enable the nonblocking flag (B<O_NONBLOCK>)  for the file descriptor.  Reading from the file descriptor will not block.  Instead, if no data is available, B<read>(2)  will fail with the error B<EAGAIN>."
1513 msgstr "ノンブロッキングフラグ (B<O_NONBLOCK>) をそのファイルディスクリプターで有効にする。 このファイルディスクリプターからの読み出しは停止しない。 その代わり、 読みだし可能なデータが何もない場合、 B<read>(2) はエラー B<EAGAIN> で失敗する。"
1514
1515 #. type: TP
1516 #: build/C/man2/fanotify_init.2:133
1517 #, no-wrap
1518 msgid "B<FAN_UNLIMITED_QUEUE>"
1519 msgstr "B<FAN_UNLIMITED_QUEUE>"
1520
1521 #. type: Plain text
1522 #: build/C/man2/fanotify_init.2:139
1523 msgid "Remove the limit of 16384 events for the event queue.  Use of this flag requires the B<CAP_SYS_ADMIN> capability."
1524 msgstr "そのイベントキューの 16384 イベントの上限を削除する。 このフラグを使用するには B<CAP_SYS_ADMIN> ケーパビリティーが必要である。"
1525
1526 #. type: TP
1527 #: build/C/man2/fanotify_init.2:139
1528 #, no-wrap
1529 msgid "B<FAN_UNLIMITED_MARKS>"
1530 msgstr "B<FAN_UNLIMITED_MARKS>"
1531
1532 #. type: Plain text
1533 #: build/C/man2/fanotify_init.2:145
1534 msgid "Remove the limit of 8192 marks.  Use of this flag requires the B<CAP_SYS_ADMIN> capability."
1535 msgstr "8192 マークの上限を削除する。 このフラグを使用するには B<CAP_SYS_ADMIN> ケーパビリティーが必要である。"
1536
1537 #. type: Plain text
1538 #: build/C/man2/fanotify_init.2:158
1539 msgid "The I<event_f_flags> argument defines the file status flags that will be set on the open file descriptions that are created for fanotify events.  For details of these flags, see the description of the I<flags> values in B<open>(2).  I<event_f_flags> includes a multi-bit field for the access mode.  This field can take the following values:"
1540 msgstr "I<event_f_flags> 引き数は fanotify イベントが作成されるオープンファイル記述にセットされるファイル状態フラグを定義する。 これらのフラグの詳細については B<open>(2) の I<flags> 値の説明を参照のこと。 I<event_f_flags> にはアクセスモードのビットを複数入れることができる。 このフィールドには以下の値も指定することができる。"
1541
1542 #. type: TP
1543 #: build/C/man2/fanotify_init.2:158
1544 #, no-wrap
1545 msgid "B<O_RDONLY>"
1546 msgstr "B<O_RDONLY>"
1547
1548 #. type: Plain text
1549 #: build/C/man2/fanotify_init.2:161
1550 msgid "This value allows only read access."
1551 msgstr "読み出しアクセスのみを許可する。"
1552
1553 #. type: TP
1554 #: build/C/man2/fanotify_init.2:161
1555 #, no-wrap
1556 msgid "B<O_WRONLY>"
1557 msgstr "B<O_WRONLY>"
1558
1559 #. type: Plain text
1560 #: build/C/man2/fanotify_init.2:164
1561 msgid "This value allows only write access."
1562 msgstr "書き込みアクセスのみを許可する。"
1563
1564 #. type: TP
1565 #: build/C/man2/fanotify_init.2:164
1566 #, no-wrap
1567 msgid "B<O_RDWR>"
1568 msgstr "B<O_RDWR>"
1569
1570 #. type: Plain text
1571 #: build/C/man2/fanotify_init.2:167
1572 msgid "This value allows read and write access."
1573 msgstr "読み出しと書き込みの両方を許可する。"
1574
1575 #. type: Plain text
1576 #: build/C/man2/fanotify_init.2:171
1577 msgid "Additional bits can be set in I<event_f_flags>.  The most useful values are:"
1578 msgstr "他のビットも I<event_f_flags> もセットすることができる。 役立つであろう値は以下である。"
1579
1580 #. type: TP
1581 #: build/C/man2/fanotify_init.2:171
1582 #, no-wrap
1583 msgid "B<O_LARGEFILE>"
1584 msgstr "B<O_LARGEFILE>"
1585
1586 #. type: Plain text
1587 #: build/C/man2/fanotify_init.2:178
1588 msgid "Enable support for files exceeding 2 GB.  Failing to set this flag will result in an B<EOVERFLOW> error when trying to open a large file which is monitored by an fanotify group on a 32-bit system."
1589 msgstr "2 GB を超えるファイルのサポートを有効にする。 このフラグのセットに失敗すると、 32 ビットシステムで fanotify グループが監視するラージファイルをオープンしようとした際に B<EOVERFLOW> エラーとなる。"
1590
1591 #. type: TP
1592 #: build/C/man2/fanotify_init.2:178
1593 #, no-wrap
1594 msgid "B<O_CLOEXEC>"
1595 msgstr "B<O_CLOEXEC>"
1596
1597 #. type: Plain text
1598 #: build/C/man2/fanotify_init.2:186
1599 msgid "Enable the close-on-exec flag for the file descriptor.  See the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this may be useful."
1600 msgstr "このファイルディスクリプターで close-on-exec フラグを有効にする。 このフラグが役立つ理由については B<open>(2) の B<O_CLOEXEC> フラグの説明を参照。"
1601
1602 #. type: Plain text
1603 #: build/C/man2/fanotify_init.2:199
1604 msgid "The following are also allowable: B<O_APPEND>, B<O_DSYNC>, B<O_NOATIME>, B<O_NONBLOCK>, and B<O_SYNC>.  Specifying any other flag in I<event_f_flags> yields the error B<EINVAL> (but see BUGS)."
1605 msgstr "B<O_APPEND>, B<O_DSYNC>, B<O_NOATIME>, B<O_NONBLOCK>, B<O_SYNC> も指定することができる。 I<event_f_flags> にこれ以外のフラグを指定すると、 エラー B<EINVAL> が起こる (ただし、バグを参照)。"
1606
1607 #. type: SH
1608 #: build/C/man2/fanotify_init.2:199 build/C/man2/fanotify_mark.2:236
1609 #: build/C/man2/inotify_add_watch.2:77 build/C/man2/inotify_init.2:74
1610 #: build/C/man2/inotify_rm_watch.2:48
1611 #, no-wrap
1612 msgid "RETURN VALUE"
1613 msgstr "返り値"
1614
1615 #. type: Plain text
1616 #: build/C/man2/fanotify_init.2:206
1617 msgid "On success, B<fanotify_init>()  returns a new file descriptor.  On error, -1 is returned, and I<errno> is set to indicate the error."
1618 msgstr "成功すると B<fanotify_init>() は新しいファイルディスクリプターを返す。 エラーの場合、 -1 を返し、 I<errno> にエラーを示す値を設定する。"
1619
1620 #. type: Plain text
1621 #: build/C/man2/fanotify_init.2:216
1622 msgid "An invalid value was passed in I<flags> or I<event_f_flags>.  B<FAN_ALL_INIT_FLAGS> defines all allowable bits for I<flags>."
1623 msgstr "I<flags> か I<event_f_flags> に無効な値が渡された。 B<FAN_ALL_INIT_FLAGS> で I<flags> に指定できる全ビットが定義されている。"
1624
1625 #. type: Plain text
1626 #: build/C/man2/fanotify_init.2:219
1627 msgid "The number of fanotify groups for this user exceeds 128."
1628 msgstr "このユーザーの fanotify グループ数が 128 を超過した。"
1629
1630 #. type: TP
1631 #: build/C/man2/fanotify_init.2:219 build/C/man2/fanotify_mark.2:274
1632 #: build/C/man2/inotify_add_watch.2:109 build/C/man2/inotify_init.2:91
1633 #, no-wrap
1634 msgid "B<ENOMEM>"
1635 msgstr "B<ENOMEM>"
1636
1637 #. type: Plain text
1638 #: build/C/man2/fanotify_init.2:222
1639 msgid "The allocation of memory for the notification group failed."
1640 msgstr "通知グループへのメモリー割り当てが失敗した。"
1641
1642 #. type: TP
1643 #: build/C/man2/fanotify_init.2:222 build/C/man2/fanotify_mark.2:283
1644 #, no-wrap
1645 msgid "B<ENOSYS>"
1646 msgstr "B<ENOSYS>"
1647
1648 #. type: Plain text
1649 #: build/C/man2/fanotify_init.2:228
1650 msgid "This kernel does not implement B<fanotify_init>().  The fanotify API is available only if the kernel was configured with B<CONFIG_FANOTIFY>."
1651 msgstr "このカーネルは B<fanotify_init>() を実装していない。 fanotify API が利用できるのは、 カーネルが B<CONFIG_FANOTIFY> を有効にして作成されている場合だけである。"
1652
1653 #. type: TP
1654 #: build/C/man2/fanotify_init.2:228
1655 #, no-wrap
1656 msgid "B<EPERM>"
1657 msgstr "B<EPERM>"
1658
1659 #. type: Plain text
1660 #: build/C/man2/fanotify_init.2:233
1661 msgid "The operation is not permitted because the caller lacks the B<CAP_SYS_ADMIN> capability."
1662 msgstr "呼び出し元が B<CAP_SYS_ADMIN> ケーパビリティーを持っていないので、操作が許可されない。"
1663
1664 #. type: Plain text
1665 #: build/C/man2/fanotify_init.2:237
1666 msgid "B<fanotify_init>()  was introduced in version 2.6.36 of the Linux kernel and enabled in version 2.6.37."
1667 msgstr "B<fanotify_init>() は Linux カーネルのバージョン 2.6.36 で導入され、 バージョン 2.6.37 で有効になった。"
1668
1669 #. type: Plain text
1670 #: build/C/man2/fanotify_init.2:239 build/C/man2/fanotify_mark.2:305
1671 #: build/C/man2/inotify_add_watch.2:120 build/C/man2/inotify_rm_watch.2:71
1672 msgid "This system call is Linux-specific."
1673 msgstr "このシステムコールは Linux 独自である。"
1674
1675 #. type: Plain text
1676 #: build/C/man2/fanotify_init.2:242
1677 msgid "As of Linux 3.17, the following bug exists:"
1678 msgstr "Linux 3.17 時点では、 以下のバグが存在する。"
1679
1680 #.  FIXME . Patch proposed: https://lkml.org/lkml/2014/9/24/967
1681 #. type: Plain text
1682 #: build/C/man2/fanotify_init.2:248
1683 msgid "The B<O_CLOEXEC> is ignored when passed in I<event_f_flags>."
1684 msgstr "B<O_CLOEXEC> が I<event_f_flags> に指定された場合、 無視される。"
1685
1686 #. type: Plain text
1687 #: build/C/man2/fanotify_init.2:250
1688 msgid "The following bug was present in Linux kernels before version 3.14:"
1689 msgstr "バージョン 3.14 より前の Linux カーネルには以下のバグが存在する。"
1690
1691 #.  Fixed by commit 48149e9d3a7e924010a0daab30a6197b7d7b6580
1692 #. type: Plain text
1693 #: build/C/man2/fanotify_init.2:260
1694 msgid "The I<event_f_flags> argument is not checked for invalid flags.  Flags that are intended only for internal use, such as B<FMODE_EXEC>, can be set, and will consequently be set for the file descriptors returned when reading from the fanotify file descriptor."
1695 msgstr "I<event_f_flags> 引き数に無効なフラグがないかのチェックが行われない。 B<FMODE_EXEC> などの内部での使用のみが意図されたフラグを指定することができ、 その場合 fanotify ファイルディスクリプターからの読み出し時に返されるファイルディスクリプターにそのフラグがセットされる。"
1696
1697 #. type: Plain text
1698 #: build/C/man2/fanotify_init.2:263
1699 msgid "B<fanotify_mark>(2), B<fanotify>(7)"
1700 msgstr "B<fanotify_mark>(2), B<fanotify>(7)"
1701
1702 #. type: TH
1703 #: build/C/man2/fanotify_mark.2:24
1704 #, no-wrap
1705 msgid "FANOTIFY_MARK"
1706 msgstr "FANOTIFY_MARK"
1707
1708 #. type: Plain text
1709 #: build/C/man2/fanotify_mark.2:28
1710 msgid "fanotify_mark - add, remove, or modify an fanotify mark on a filesystem object"
1711 msgstr "fanotify_mark - ファイルシステムオブジェクトへの fanotify マークの追加、削除、変更"
1712
1713 #. type: Plain text
1714 #: build/C/man2/fanotify_mark.2:31
1715 #, no-wrap
1716 msgid "B<#include E<lt>sys/fanotify.hE<gt>>\n"
1717 msgstr "B<#include E<lt>sys/fanotify.hE<gt>>\n"
1718
1719 #. type: Plain text
1720 #: build/C/man2/fanotify_mark.2:35
1721 #, no-wrap
1722 msgid ""
1723 "B<int fanotify_mark(int >I<fanotify_fd>B<, unsigned int >I<flags>B<,>\n"
1724 "B<                  uint64_t >I<mask>B<, int >I<dirfd>B<, const char *>I<pathname>B<);>\n"
1725 msgstr ""
1726 "B<int fanotify_mark(int >I<fanotify_fd>B<, unsigned int >I<flags>B<,>\n"
1727 "B<                  uint64_t >I<mask>B<, int >I<dirfd>B<, const char *>I<pathname>B<);>\n"
1728
1729 #. type: Plain text
1730 #: build/C/man2/fanotify_mark.2:44
1731 msgid "B<fanotify_mark>(2)  adds, removes, or modifies an fanotify mark on a filesystem object.  The caller must have read permission on the filesystem object that is to be marked."
1732 msgstr "B<fanotify_mark>(2) はファイルシステムオブジェクトに対する fanotify マークの追加、削除、変更を行う。 呼び出し元はマークを付けるファイルシステムオブジェクトに対する読み出し許可を持っていなければならない。"
1733
1734 #. type: Plain text
1735 #: build/C/man2/fanotify_mark.2:49
1736 msgid "The I<fanotify_fd> argument is a file descriptor returned by B<fanotify_init>(2)."
1737 msgstr "I<fanotify_fd> 引き数は B<fanotify_init>(2) で返されたファイルディスクリプターである。"
1738
1739 #. type: Plain text
1740 #: build/C/man2/fanotify_mark.2:53
1741 msgid "I<flags> is a bit mask describing the modification to perform.  It must include exactly one of the following values:"
1742 msgstr "I<flags> は実行する操作内容を示すビットマスクである。 以下の値のいずれか一つだけを指定しなければならない。"
1743
1744 #. type: TP
1745 #: build/C/man2/fanotify_mark.2:53
1746 #, no-wrap
1747 msgid "B<FAN_MARK_ADD>"
1748 msgstr "B<FAN_MARK_ADD>"
1749
1750 #. type: Plain text
1751 #: build/C/man2/fanotify_mark.2:62
1752 msgid "The events in I<mask> will be added to the mark mask (or to the ignore mask).  I<mask> must be nonempty or the error B<EINVAL> will occur."
1753 msgstr "I<mask> のイベントを mark マスク (もしくは ignore マスク) に追加する。 I<mask> は空であってはいけない。 空の場合はエラー B<EINVAL> が発生する。"
1754
1755 #. type: TP
1756 #: build/C/man2/fanotify_mark.2:62
1757 #, no-wrap
1758 msgid "B<FAN_MARK_REMOVE>"
1759 msgstr "B<FAN_MARK_REMOVE>"
1760
1761 #. type: Plain text
1762 #: build/C/man2/fanotify_mark.2:71
1763 msgid "The events in argument I<mask> will be removed from the mark mask (or from the ignore mask).  I<mask> must be nonempty or the error B<EINVAL> will occur."
1764 msgstr "引き数 I<mask> のイベントを mark マスク (もしくは ignore マスク) から削除する。 I<mask> は空であってはいけない。 空の場合はエラー B<EINVAL>が発生する。"
1765
1766 #. type: TP
1767 #: build/C/man2/fanotify_mark.2:71
1768 #, no-wrap
1769 msgid "B<FAN_MARK_FLUSH>"
1770 msgstr "B<FAN_MARK_FLUSH>"
1771
1772 #. type: Plain text
1773 #: build/C/man2/fanotify_mark.2:86
1774 msgid "Remove either all mount or all non-mount marks from the fanotify group.  If I<flags> contains B<FAN_MARK_MOUNT>, all marks for mounts are removed from the group.  Otherwise, all marks for directories and files are removed.  No flag other than B<FAN_MARK_MOUNT> can be used in conjunction with B<FAN_MARK_FLUSH>.  I<mask> is ignored."
1775 msgstr "fanotify グループから全てのマウント mark か全てのマウント以外の mark を削除する。 I<flag> に B<FAN_MARK_MOUNT> が含まれる場合、 マウントに対する全ての mark がそのグループから削除される。 含まれない場合は、 ディレクトリとファイルに対する全ての mark が削除される。 B<FAN_MARK_MOUNT> 以外のフラグを B<FAN_MARK_FLUSH> と組み合わせて使うことはできない。 I<mask> は無視される。"
1776
1777 #. type: Plain text
1778 #: build/C/man2/fanotify_mark.2:90
1779 msgid "If none of the values above is specified, or more than one is specified, the call fails with the error B<EINVAL>."
1780 msgstr "上記のどの値も指定されなかった場合、 または 2 つ以上の値が指定された場合、 呼び出しはエラー B<EINVAL> で失敗する。"
1781
1782 #. type: Plain text
1783 #: build/C/man2/fanotify_mark.2:94
1784 msgid "In addition, zero or more of the following values may be ORed into I<flags>:"
1785 msgstr "これに加えて、 I<flags> に以下の値を 0 個以上ビット単位の論理和 (OR) で指定できる。"
1786
1787 #. type: TP
1788 #: build/C/man2/fanotify_mark.2:94
1789 #, no-wrap
1790 msgid "B<FAN_MARK_DONT_FOLLOW>"
1791 msgstr "B<FAN_MARK_DONT_FOLLOW>"
1792
1793 #. type: Plain text
1794 #: build/C/man2/fanotify_mark.2:105
1795 msgid "If I<pathname> is a symbolic link, mark the link itself, rather than the file to which it refers.  (By default, B<fanotify_mark>()  dereferences I<pathname> if it is a symbolic link.)"
1796 msgstr "I<pathname> がシンボリックリンクの場合、 リンクが参照するファイルではなく、 リンク自身にマークを付ける (デフォルトでは B<fanotify_mark>() は I<pathname> がシンボリックリンクの場合シンボリックリンクの展開を行う)。"
1797
1798 #. type: TP
1799 #: build/C/man2/fanotify_mark.2:105
1800 #, no-wrap
1801 msgid "B<FAN_MARK_ONLYDIR>"
1802 msgstr "B<FAN_MARK_ONLYDIR>"
1803
1804 #. type: Plain text
1805 #: build/C/man2/fanotify_mark.2:110
1806 msgid "If the filesystem object to be marked is not a directory, the error B<ENOTDIR> shall be raised."
1807 msgstr "マークが付けられたファイルシステムオブジェクトがディレクトリでない場合、 エラー B<ENOTDIR> が発生する。"
1808
1809 #. type: TP
1810 #: build/C/man2/fanotify_mark.2:110
1811 #, no-wrap
1812 msgid "B<FAN_MARK_MOUNT>"
1813 msgstr "B<FAN_MARK_MOUNT>"
1814
1815 #. type: Plain text
1816 #: build/C/man2/fanotify_mark.2:121
1817 msgid "Mark the mount point specified by I<pathname>.  If I<pathname> is not itself a mount point, the mount point containing I<pathname> will be marked.  All directories, subdirectories, and the contained files of the mount point will be monitored."
1818 msgstr "I<pathname> で指定されたマウントポイントにマークを付ける。 I<pathname> がマウントポイント自身ではない場合、 I<pathname> を含むマウントポイントがマークされる。 マウントポイントに含まれる全てのディレクトリ、 サブディレクトリ、 その中のファイルが監視される。"
1819
1820 #. type: TP
1821 #: build/C/man2/fanotify_mark.2:121
1822 #, no-wrap
1823 msgid "B<FAN_MARK_IGNORED_MASK>"
1824 msgstr "B<FAN_MARK_IGNORED_MASK>"
1825
1826 #. type: Plain text
1827 #: build/C/man2/fanotify_mark.2:126
1828 msgid "The events in I<mask> shall be added to or removed from the ignore mask."
1829 msgstr "I<mask> のイベントの ignore マスクへの追加、もしくは削除を行う。"
1830
1831 #. type: TP
1832 #: build/C/man2/fanotify_mark.2:126
1833 #, no-wrap
1834 msgid "B<FAN_MARK_IGNORED_SURV_MODIFY>"
1835 msgstr "B<FAN_MARK_IGNORED_SURV_MODIFY>"
1836
1837 #. type: Plain text
1838 #: build/C/man2/fanotify_mark.2:132
1839 msgid "The ignore mask shall survive modify events.  If this flag is not set, the ignore mask is cleared when a modify event occurs for the ignored file or directory."
1840 msgstr "ignore マスクは変更イベントが発生しても残り続ける。 このフラグがセットされていない場合、 無視するファイルやディレクトリに対して変更イベントが発生した際に ignore マスクはクリアされる。"
1841
1842 #. type: Plain text
1843 #: build/C/man2/fanotify_mark.2:136
1844 msgid "I<mask> defines which events shall be listened for (or which shall be ignored).  It is a bit mask composed of the following values:"
1845 msgstr "I<mask> はどのイベントに対して通知を受けるか (もしくはどのイベントを無視するか) を定義する。  以下の値から構成されるビットマスクである。"
1846
1847 #. type: Plain text
1848 #: build/C/man2/fanotify_mark.2:139
1849 msgid "Create an event when a file or directory (but see BUGS) is accessed (read)."
1850 msgstr "ファイルやディレクトリへのアクセス (読み出し) があった際にイベントを作成する (「バグ」も参照)。"
1851
1852 #. type: Plain text
1853 #: build/C/man2/fanotify_mark.2:142
1854 msgid "Create an event when a file is modified (write)."
1855 msgstr "ファイルが変更された (書き込み) 際にイベントを作成する。"
1856
1857 #. type: Plain text
1858 #: build/C/man2/fanotify_mark.2:145
1859 msgid "Create an event when a writable file is closed."
1860 msgstr "書き込み可能ファイルがクローズされた際にイベントを作成する。"
1861
1862 #. type: Plain text
1863 #: build/C/man2/fanotify_mark.2:148
1864 msgid "Create an event when a read-only file or directory is closed."
1865 msgstr "読み出し専用のファイルやディレクトリがクローズされた際にイベントを作成する。"
1866
1867 #. type: Plain text
1868 #: build/C/man2/fanotify_mark.2:151
1869 msgid "Create an event when a file or directory is opened."
1870 msgstr "ファイルやディレクトリがオープンされた際にイベントを作成する。"
1871
1872 #. type: Plain text
1873 #: build/C/man2/fanotify_mark.2:159
1874 msgid "Create an event when a permission to open a file or directory is requested.  An fanotify file descriptor created with B<FAN_CLASS_PRE_CONTENT> or B<FAN_CLASS_CONTENT> is required."
1875 msgstr "ファイルやディレクトリをオープンするアクセス許可が要求された際にイベントを作成する。 fanotify ファイルディスクリプターが B<FAN_CLASS_PRE_CONTENT> か B<FAN_CLASS_CONTENT> を指定されて作成されている必要がある。"
1876
1877 #. type: Plain text
1878 #: build/C/man2/fanotify_mark.2:167
1879 msgid "Create an event when a permission to read a file or directory is requested.  An fanotify file descriptor created with B<FAN_CLASS_PRE_CONTENT> or B<FAN_CLASS_CONTENT> is required."
1880 msgstr "ファイルやディレクトリを読み出すアクセス許可が要求された際にイベントを作成する。 fanotify ファイルディスクリプターが B<FAN_CLASS_PRE_CONTENT> か B<FAN_CLASS_CONTENT> を指定されて作成されている必要がある。"
1881
1882 #. type: TP
1883 #: build/C/man2/fanotify_mark.2:167
1884 #, no-wrap
1885 msgid "B<FAN_ONDIR>"
1886 msgstr "B<FAN_ONDIR>"
1887
1888 #. type: Plain text
1889 #: build/C/man2/fanotify_mark.2:176
1890 msgid "Create events for directories\\(emfor example, when B<opendir>(3), B<readdir>(3)  (but see BUGS), and B<closedir>(3)  are called.  Without this flag, only events for files are created."
1891 msgstr "ディレクトリに対するイベントを作成する。 例えば B<opendir>(3)、 B<readdir>(3) (ただし「バグ」も参照)、 B<closedir>(3) が呼び出された場合。 このフラグが指定されなかった場合、 ファイルに対するイベントだけが作成される。"
1892
1893 #. type: TP
1894 #: build/C/man2/fanotify_mark.2:176
1895 #, no-wrap
1896 msgid "B<FAN_EVENT_ON_CHILD>"
1897 msgstr "B<FAN_EVENT_ON_CHILD>"
1898
1899 #. type: Plain text
1900 #: build/C/man2/fanotify_mark.2:184
1901 msgid "Events for the immediate children of marked directories shall be created.  The flag has no effect when marking mounts.  Note that events are not generated for children of the subdirectories of marked directories.  To monitor complete directory trees it is necessary to mark the relevant mount."
1902 msgstr "マークされたディレクトリの直下のエントリーに対してイベントを作成する。 このフラグはマウントにマークを付ける際には効果はない。 マークされたディレクトリのサブディレクトリのエントリーに対してはイベントが作成されない点に注意すること。 ディレクトリツリー全体を監視するには、 関連するマウントにマークを付ける必要がある。"
1903
1904 #. type: Plain text
1905 #: build/C/man2/fanotify_mark.2:186
1906 msgid "The following composed value is defined:"
1907 msgstr "以下の組み合わせ値が定義されている。"
1908
1909 #. type: Plain text
1910 #: build/C/man2/fanotify_mark.2:190
1911 msgid "A file is closed (B<FAN_CLOSE_WRITE>|B<FAN_CLOSE_NOWRITE>)."
1912 msgstr "ファイルがクローズされた (B<FAN_CLOSE_WRITE>|B<FAN_CLOSE_NOWRITE>)。"
1913
1914 #. type: Plain text
1915 #: build/C/man2/fanotify_mark.2:195
1916 msgid "The filesystem object to be marked is determined by the file descriptor I<dirfd> and the pathname specified in I<pathname>:"
1917 msgstr "マークを付けるファイルシステムオブジェクトは、 ファイルディスクリプター I<dirfd> と I<pathname> で指定されたパス名から決定される。"
1918
1919 #. type: Plain text
1920 #: build/C/man2/fanotify_mark.2:201
1921 msgid "If I<pathname> is NULL, I<dirfd> defines the filesystem object to be marked."
1922 msgstr "I<pathname> が NULL の場合、 I<dirfd> でマークを付けるファイルシステムオブジェクトが定義される。"
1923
1924 #. type: Plain text
1925 #: build/C/man2/fanotify_mark.2:209
1926 msgid "If I<pathname> is NULL, and I<dirfd> takes the special value B<AT_FDCWD>, the current working directory is to be marked."
1927 msgstr "I<pathname> が NULL で、 I<dirfd> が特別な値 B<AT_FDCWD> の場合、 カレントワーキングディレクトリがマークされる。"
1928
1929 #. type: Plain text
1930 #: build/C/man2/fanotify_mark.2:215
1931 msgid "If I<pathname> is absolute, it defines the filesystem object to be marked, and I<dirfd> is ignored."
1932 msgstr "I<pathname> が絶対パスの場合、 そのパス名によりマークを付けるファイルシステムオブジェクトが定義され、 I<dirfd> は無視される。"
1933
1934 #. type: Plain text
1935 #: build/C/man2/fanotify_mark.2:226
1936 msgid "If I<pathname> is relative, and I<dirfd> does not have the value B<AT_FDCWD>, then the filesystem object to be marked is determined by interpreting I<pathname> relative the directory referred to by I<dirfd>."
1937 msgstr "I<pathname> が相対パスで、 I<dirfd> が B<AT_FDCWD> でない場合、 マークを付けるファイルシステムオブジェクトは I<dirfd> が参照するディレクトリに対する相対パス I<pathname> を解釈して決定される。"
1938
1939 #. type: Plain text
1940 #: build/C/man2/fanotify_mark.2:236
1941 msgid "If I<pathname> is relative, and I<dirfd> has the value B<AT_FDCWD>, then the filesystem object to be marked is determined by interpreting I<pathname> relative the current working directory."
1942 msgstr "I<pathname> が相対パスで、 I<dirfd> が B<AT_FDCWD> の場合、 マークを付けるファイルシステムオブジェクトはカレントワーキングディレクトリに対する相対パス I<pathname> を解釈して決定される。"
1943
1944 #. type: Plain text
1945 #: build/C/man2/fanotify_mark.2:243
1946 msgid "On success, B<fanotify_mark>()  returns 0.  On error, -1 is returned, and I<errno> is set to indicate the error."
1947 msgstr "成功すると B<fanotify_mark>() は 0 を返す。 エラーの場合、 -1 を返し、 I<errno> にエラーの原因を示す値を設定する。"
1948
1949 #. type: TP
1950 #: build/C/man2/fanotify_mark.2:244 build/C/man2/inotify_add_watch.2:88
1951 #: build/C/man2/inotify_rm_watch.2:56
1952 #, no-wrap
1953 msgid "B<EBADF>"
1954 msgstr "B<EBADF>"
1955
1956 #. type: Plain text
1957 #: build/C/man2/fanotify_mark.2:248
1958 msgid "An invalid file descriptor was passed in I<fanotify_fd>."
1959 msgstr "無効なファイルディスクリプターが I<fanotify_fd> で渡された。"
1960
1961 #. type: Plain text
1962 #: build/C/man2/fanotify_mark.2:257
1963 msgid "An invalid value was passed in I<flags> or I<mask>, or I<fanotify_fd> was not an fanotify file descriptor."
1964 msgstr "無効な値が I<flags> か I<mask> に指定されたか、 I<fanotify_fd> が fanotify ファイルディスクリプターでなかった。"
1965
1966 #. type: Plain text
1967 #: build/C/man2/fanotify_mark.2:265
1968 msgid "The fanotify file descriptor was opened with B<FAN_CLASS_NOTIF> and mask contains a flag for permission events (B<FAN_OPEN_PERM> or B<FAN_ACCESS_PERM>)."
1969 msgstr "fanotify ファイルディスクリプターが B<FAN_CLASS_NOTIF> でオープンされたが、 アクセス許可イベント (B<FAN_OPEN_PERM> か B<FAN_ACCESS_PERM>) のフラグがマスクに含まれている。"
1970
1971 #. type: Plain text
1972 #: build/C/man2/fanotify_mark.2:274
1973 msgid "The filesystem object indicated by I<dirfd> and I<pathname> does not exist.  This error also occurs when trying to remove a mark from an object which is not marked."
1974 msgstr "I<dirfd> と I<pathname> で指定されたファイルシステムオブジェクトが存在しない。 このエラーはマークされていないオブジェクトからマークを削除しようとした場合にも発生する。"
1975
1976 #. type: Plain text
1977 #: build/C/man2/fanotify_mark.2:277
1978 msgid "The necessary memory could not be allocated."
1979 msgstr "必要なメモリーを割り当てできなかった。"
1980
1981 #. type: TP
1982 #: build/C/man2/fanotify_mark.2:277 build/C/man2/inotify_add_watch.2:112
1983 #, no-wrap
1984 msgid "B<ENOSPC>"
1985 msgstr "B<ENOSPC>"
1986
1987 #. type: Plain text
1988 #: build/C/man2/fanotify_mark.2:283
1989 msgid "The number of marks exceeds the limit of 8192 and the B<FAN_UNLIMITED_MARKS> flag was not specified when the fanotify file descriptor was created with B<fanotify_init>(2)."
1990 msgstr "マークの数が 8192 の上限を超過し、 B<fanotify_init>(2) で fanotify ファイルディスクリプターが作成された際に B<FAN_UNLIMITED_MARKS> フラグが指定されていなかった。"
1991
1992 #. type: Plain text
1993 #: build/C/man2/fanotify_mark.2:289
1994 msgid "This kernel does not implement B<fanotify_mark>().  The fanotify API is available only if the kernel was configured with B<CONFIG_FANOTIFY>."
1995 msgstr "このカーネルでは B<fanotify_mark>() が実装されていない。 fanotify API が利用できるのは、 カーネルで B<CONFIG_FANOTIFY> が有効になっている場合だけである。"
1996
1997 #. type: TP
1998 #: build/C/man2/fanotify_mark.2:289
1999 #, no-wrap
2000 msgid "B<ENOTDIR>"
2001 msgstr "B<ENOTDIR>"
2002
2003 #. type: Plain text
2004 #: build/C/man2/fanotify_mark.2:299
2005 msgid "I<flags> contains B<FAN_MARK_ONLYDIR>, and I<dirfd> and I<pathname> do not specify a directory."
2006 msgstr "I<flags> に B<FAN_MARK_ONLYDIR> が含まれているが、 I<dirfd> と I<pathname> がディレクトリを指定していない。"
2007
2008 #. type: Plain text
2009 #: build/C/man2/fanotify_mark.2:303
2010 msgid "B<fanotify_mark>()  was introduced in version 2.6.36 of the Linux kernel and enabled in version 2.6.37."
2011 msgstr "B<fanotify_mark>() は Linux カーネルのバージョン 2.6.36 で導入され、 バージョン 2.6.37 で有効になった。"
2012
2013 #. type: Plain text
2014 #: build/C/man2/fanotify_mark.2:307
2015 msgid "The following bugs were present in Linux kernels before version 3.16:"
2016 msgstr "バージョン 3.16 より前の Linux カーネルでは以下のバグが存在した。"
2017
2018 #.  Fixed by commit 0a8dd2db579f7a0ac7033d6b857c3d5dbaa77563
2019 #. type: Plain text
2020 #: build/C/man2/fanotify_mark.2:317
2021 msgid "If I<flags> contains B<FAN_MARK_FLUSH>, I<dirfd> and I<pathname> must specify a valid filesystem object, even though this object is not used."
2022 msgstr "I<flags> に B<FAN_MARK_FLUSH> が指定されている場合、 たとえそのオブジェクトが使用されない場合であっても、  I<dirfd> と I<pathname> には有効なファイルシステムオブジェクトを指定しなければならない。"
2023
2024 #.  Fixed by commit d4c7cf6cffb1bc711a833b5e304ba5bcfe76398b
2025 #. type: Plain text
2026 #: build/C/man2/fanotify_mark.2:323
2027 msgid "B<readdir>(2)  does not generate a B<FAN_ACCESS> event."
2028 msgstr "B<readdir>(2) は B<FAN_ACCESS> イベントを生成しない。"
2029
2030 #.  Fixed by commit cc299a98eb13a9853675a9cbb90b30b4011e1406
2031 #. type: Plain text
2032 #: build/C/man2/fanotify_mark.2:331
2033 msgid "If B<fanotify_mark>(2)  is called with B<FAN_MARK_FLUSH>, I<flags> is not checked for invalid values."
2034 msgstr "B<fanotify_mark>(2) が B<FAN_MARK_FLUSH> 付きで呼び出された場合、 I<flags> の値が無効かはチェックされない。"
2035
2036 #. type: Plain text
2037 #: build/C/man2/fanotify_mark.2:334
2038 msgid "B<fanotify_init>(2), B<fanotify>(7)"
2039 msgstr "B<fanotify_init>(2), B<fanotify>(7)"
2040
2041 #. type: TH
2042 #: build/C/man7/inotify.7:27
2043 #, no-wrap
2044 msgid "INOTIFY"
2045 msgstr "INOTIFY"
2046
2047 #. type: Plain text
2048 #: build/C/man7/inotify.7:30
2049 msgid "inotify - monitoring filesystem events"
2050 msgstr "inotify - ファイルシステムイベントを監視する"
2051
2052 #. type: Plain text
2053 #: build/C/man7/inotify.7:38
2054 msgid "The I<inotify> API provides a mechanism for monitoring filesystem events.  Inotify can be used to monitor individual files, or to monitor directories.  When a directory is monitored, inotify will return events for the directory itself, and for files inside the directory."
2055 msgstr "I<inotify> API はファイルシステムイベントを監視するための機構を提供する。 inotify は個々のファイルやディレクトリを監視するのに使える。 ディレクトリを監視する場合、inotify はディレクトリ自身と ディレクトリ内のファイルのイベントを返す。"
2056
2057 #. type: Plain text
2058 #: build/C/man7/inotify.7:40
2059 msgid "The following system calls are used with this API:"
2060 msgstr "この API では以下のシステムコールが使用される。"
2061
2062 #. type: Plain text
2063 #: build/C/man7/inotify.7:51
2064 msgid "B<inotify_init>(2)  creates an inotify instance and returns a file descriptor referring to the inotify instance.  The more recent B<inotify_init1>(2)  is like B<inotify_init>(2), but has a I<flags> argument that provides access to some extra functionality."
2065 msgstr "B<inotify_init>(2)  は inotify インスタンスを作成し、inotify インスタンスを参照する ファイルディスクリプターを返す。 より新しい B<inotify_init1>(2)  も B<inotify_init>(2)  と同様だが、 こちらにはいくつかの追加の機能を利用するための I<flags> 引き数がある。"
2066
2067 #. type: Plain text
2068 #: build/C/man7/inotify.7:64
2069 msgid "B<inotify_add_watch>(2)  manipulates the \"watch list\" associated with an inotify instance.  Each item (\"watch\") in the watch list specifies the pathname of a file or directory, along with some set of events that the kernel should monitor for the file referred to by that pathname.  B<inotify_add_watch>(2)  either creates a new watch item, or modifies an existing watch.  Each watch has a unique \"watch descriptor\", an integer returned by B<inotify_add_watch>(2)  when the watch is created."
2070 msgstr "B<inotify_add_watch>(2)  は inotify インスタンスに関連づけられた「監視対象 (watch) リスト」を操作する。 監視対象リストの各アイテム (\"watch\") は、 ファイルまたはディレクトリのパス名と、 そのパス名で参照されるファイルに対して カーネルが監視する複数のイベントの集合を指定する。 B<inotify_add_watch>(2)  は新しい監視アイテムの作成や既存の監視対象の変更ができる。 各監視対象は一意の「監視対象ディスクリプター」を持つ。 これは監視対象を作成したときに B<inotify_add_watch>(2)  から返される整数である。"
2071
2072 #. type: Plain text
2073 #: build/C/man7/inotify.7:70
2074 msgid "When events occur for monitored files and directories, those events are made available to the application as structured data that can be read from the inotify file descriptor using B<read>(2)  (see below)."
2075 msgstr "監視しているファイルやディレクトリでイベントが起こると、 それらのイベントはアプリケーションから inotify ファイルディスクリプターから B<read>(2) を使って構造化データとして読み出すことができる (下記参照)。"
2076
2077 #. type: Plain text
2078 #: build/C/man7/inotify.7:73
2079 msgid "B<inotify_rm_watch>(2)  removes an item from an inotify watch list."
2080 msgstr "B<inotify_rm_watch>(2)  は inotify の監視対象リストからアイテムを削除する。"
2081
2082 #. type: Plain text
2083 #: build/C/man7/inotify.7:80
2084 msgid "When all file descriptors referring to an inotify instance have been closed (using B<close>(2)), the underlying object and its resources are freed for reuse by the kernel; all associated watches are automatically freed."
2085 msgstr "inotify インスタンスを指している 全てのファイルディスクリプターが (B<close>(2) を使って) クローズされた場合、 その下層にあるオブジェクトとそのリソースは、 カーネルで再利用するために解放される。 関連が切られた監視対象は自動的に解放される。"
2086
2087 #. type: Plain text
2088 #: build/C/man7/inotify.7:89
2089 msgid "With careful programming, an application can use inotify to efficiently monitor and cache the state of a set of filesystem objects.  However, robust applications should allow for the fact that bugs in the monitoring logic or races of the kind described below may leave the cache inconsistent with the filesystem state.  It is probably wise to to do some consistency checking, and rebuild the cache when inconsistencies are detected."
2090 msgstr "注意深くプログラミングすることで、 アプリケーションは inotify を使ってファイルシステムオブジェクトの集合の状態を効率的に監視しキャッシュしておくことができる。 しかしながら、ロバストなアプリケーションでは、監視ロジックのバグや以下に説明があるような種類の競合条件によりファイルシステムの状態とキャッシュが一致しない状態になることがあるという事実も考慮に入れておくべきである。 おそらく何らかの一貫性のチェックを行い、不一致が検出された場合にはキャッシュを再構築するのが懸命だろう。"
2091
2092 #. type: SS
2093 #: build/C/man7/inotify.7:89
2094 #, no-wrap
2095 msgid "Reading events from an inotify file descriptor"
2096 msgstr "inotify ファイルディスクリプターからのイベントの読み出し"
2097
2098 #. type: Plain text
2099 #: build/C/man7/inotify.7:102
2100 msgid "To determine what events have occurred, an application B<read>(2)s from the inotify file descriptor.  If no events have so far occurred, then, assuming a blocking file descriptor, B<read>(2)  will block until at least one event occurs (unless interrupted by a signal, in which case the call fails with the error B<EINTR>; see B<signal>(7))."
2101 msgstr "どのようなイベントが起こっていたかを知るには、 アプリケーションで inotify ファイルディスクリプターを B<read>(2)  すればよい。 これまでに何もイベントが起こっていない場合、 停止 (blocking) モードのファイルディスクリプターであれば、 少なくとも 1 つのイベントが起こるまで B<read>(2)  は停止する (シグナルにより割り込まれなかった場合。 シグナルによる割り込みがあった場合、呼び出しはエラー B<EINTR> で失敗する。 B<signal>(7)  参照)。"
2102
2103 #. type: Plain text
2104 #: build/C/man7/inotify.7:106
2105 msgid "Each successful B<read>(2)  returns a buffer containing one or more of the following structures:"
2106 msgstr "B<read>(2)  が成功すると、以下の構造体を 1 つ以上含むバッファーが返される:"
2107
2108 #.  FIXME . The type of the 'wd' field should probably be "int32_t".
2109 #.  I submitted a patch to fix this.  See the LKML thread
2110 #.  "[patch] Fix type errors in inotify interfaces", 18 Nov 2008
2111 #.  Glibc bug filed: http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040
2112 #. type: Plain text
2113 #: build/C/man7/inotify.7:121
2114 #, no-wrap
2115 msgid ""
2116 "struct inotify_event {\n"
2117 "    int      wd;       /* Watch descriptor */\n"
2118 "    uint32_t mask;     /* Mask describing event */\n"
2119 "    uint32_t cookie;   /* Unique cookie associating related\n"
2120 "                          events (for rename(2)) */\n"
2121 "    uint32_t len;      /* Size of I<name> field */\n"
2122 "    char     name[];   /* Optional null-terminated name */\n"
2123 "};\n"
2124 msgstr ""
2125 "struct inotify_event {\n"
2126 "    int      wd;       /* 監視対象ディスクリプター */\n"
2127 "    uint32_t mask;     /* イベントを示すマスク */\n"
2128 "    uint32_t cookie;   /* 関連するイベント群を関連づける\n"
2129 "                          一意なクッキー (rename(2) 用) */\n"
2130 "    uint32_t len;      /* \\(aqname\\(aq フィールドのサイズ */\n"
2131 "    char     name[];   /* ヌルで終端された任意の名前 */\n"
2132 "};\n"
2133
2134 #. type: Plain text
2135 #: build/C/man7/inotify.7:128
2136 msgid "I<wd> identifies the watch for which this event occurs.  It is one of the watch descriptors returned by a previous call to B<inotify_add_watch>(2)."
2137 msgstr "I<wd> はイベント発生の監視対象を指定する。 これは、前もって行われた B<inotify_add_watch>(2)  呼び出しで返された監視対象ディスクリプターのうちの 1 つである。"
2138
2139 #. type: Plain text
2140 #: build/C/man7/inotify.7:131
2141 msgid "I<mask> contains bits that describe the event that occurred (see below)."
2142 msgstr "I<mask> には発生したイベント (下記参照) を記述するためのビットが含まれる。"
2143
2144 #. type: Plain text
2145 #: build/C/man7/inotify.7:143
2146 msgid "I<cookie> is a unique integer that connects related events.  Currently this is used only for rename events, and allows the resulting pair of B<IN_MOVED_FROM> and B<IN_MOVED_TO> events to be connected by the application.  For all other event types, I<cookie> is set to 0."
2147 msgstr ""
2148 "I<cookie> は関連するイベントを関連づけるための一意な整数である。\n"
2149 "現在のところ、この値は rename イベントに対してのみ使われており、\n"
2150 "結果のペアである B<IN_MOVED_FROM> と B<IN_MOVED_TO> イベントを\n"
2151 "アプリケーションで関連づけることができる。\n"
2152 "他のイベント種別の場合には、 I<cookie> は 0 に設定する。"
2153
2154 #. type: Plain text
2155 #: build/C/man7/inotify.7:152
2156 msgid "The I<name> field is present only when an event is returned for a file inside a watched directory; it identifies the file pathname relative to the watched directory.  This pathname is null-terminated, and may include further null bytes (\\(aq\\e0\\(aq) to align subsequent reads to a suitable address boundary."
2157 msgstr "I<name> フィールドは監視しているディレクトリ内のファイルに対して イベントが返される場合のためにだけ存在する。 監視するディレクトリからのファイルの相対パス名を表す。 このパス名はヌルで終端され、 その後の読み込みで適切なアドレス境界に調整するために、 さらにヌルバイト (\\(aq\\e0\\(aq) が含まれる場合もある。"
2158
2159 #. type: Plain text
2160 #: build/C/man7/inotify.7:162
2161 msgid "The I<len> field counts all of the bytes in I<name>, including the null bytes; the length of each I<inotify_event> structure is thus I<sizeof(struct inotify_event)+len>."
2162 msgstr ""
2163 "I<len> フィールドはヌルバイトを含む I<name> の全てのバイト数を表す。\n"
2164 "よって、 I<inotify_event> 構造体のサイズは \n"
2165 "I<sizeof(struct inotify_event)+len> である。"
2166
2167 #. type: Plain text
2168 #: build/C/man7/inotify.7:173
2169 msgid "The behavior when the buffer given to B<read>(2)  is too small to return information about the next event depends on the kernel version: in kernels before 2.6.21, B<read>(2)  returns 0; since kernel 2.6.21, B<read>(2)  fails with the error B<EINVAL>.  Specifying a buffer of size"
2170 msgstr ""
2171 "B<read>(2) に渡されたバッファーが小さすぎて次のイベントに関する情報を返せ\n"
2172 "ない場合の動作はカーネルのバージョンにより異なる。 2.6.21 より前のカー\n"
2173 "ネルでは、 B<read>(2) は 0 を返す。 2.6.21 以降のカーネルでは、\n"
2174 "B<read>(2) はエラー B<EINVAL> で失敗する。\n"
2175 "バッファーサイズとして"
2176
2177 #. type: Plain text
2178 #: build/C/man7/inotify.7:175
2179 #, no-wrap
2180 msgid "    sizeof(struct inotify_event) + NAME_MAX + 1\n"
2181 msgstr "    sizeof(struct inotify_event) + NAME_MAX + 1\n"
2182
2183 #. type: Plain text
2184 #: build/C/man7/inotify.7:177
2185 msgid "will be sufficient to read at least one event."
2186 msgstr "を指定すれば、少なくとも 1 イベントで読み出しを行うには十分である。"
2187
2188 #. type: SS
2189 #: build/C/man7/inotify.7:177
2190 #, no-wrap
2191 msgid "inotify events"
2192 msgstr "inotify イベント"
2193
2194 #. type: Plain text
2195 #: build/C/man7/inotify.7:197
2196 msgid "The B<inotify_add_watch>(2)  I<mask> argument and the I<mask> field of the I<inotify_event> structure returned when B<read>(2)ing an inotify file descriptor are both bit masks identifying inotify events.  The following bits can be specified in I<mask> when calling B<inotify_add_watch>(2)  and may be returned in the I<mask> field returned by B<read>(2):"
2197 msgstr "B<inotify_add_watch>(2)  の I<mask> 引き数と、inotify ファイル構造体を B<read>(2)  したときに返される I<inotify_event> 構造体の I<mask> フィールドは、ともに inotify イベントを識別するための ビットマスクである。 以下のビットが B<inotify_add_watch>(2)  を呼ぶときの I<mask> に指定可能であり、 B<read>(2)  で返される I<mask> フィールドで返される:"
2198
2199 #. type: TP
2200 #: build/C/man7/inotify.7:198
2201 #, no-wrap
2202 msgid "B<IN_ACCESS> (+)"
2203 msgstr "B<IN_ACCESS> (+)"
2204
2205 #. type: Plain text
2206 #: build/C/man7/inotify.7:203
2207 msgid "File was accessed (e.g., B<read>(2), B<execve>(2))."
2208 msgstr "(B<read>(2), B<execve>(2) などで) ファイルがアクセスされた。"
2209
2210 #. type: TP
2211 #: build/C/man7/inotify.7:203
2212 #, no-wrap
2213 msgid "B<IN_ATTRIB> (*)"
2214 msgstr "B<IN_ATTRIB> (*)"
2215
2216 #. type: Plain text
2217 #: build/C/man7/inotify.7:218
2218 msgid "Metadata changed\\(emfor example, permissions (e.g., B<chmod>(2)), timestamps (e.g., B<utimensat>(2)), extended attributes (B<setxattr>(2)), link count (since Linux 2.6.25; e.g., for the target of B<link>(2)  and for B<unlink>(2)), and user/group ID (e.g., B<chown>(2))."
2219 msgstr "メタデータが変更された。 メタデータとは、例えば、アクセス許可 (B<chmod>(2))、タイムスタンプ (B<utimensat>(2) など)、拡張属性 (B<setxattr>(2))、 リンクカウント (Linux 2.6.25 以降; B<link>(2) のリンク先や B<unlink>(2) など)、ユーザー/グループ ID (B<chown>(2) など) などである。"
2220
2221 #. type: TP
2222 #: build/C/man7/inotify.7:218
2223 #, no-wrap
2224 msgid "B<IN_CLOSE_WRITE> (+)"
2225 msgstr "B<IN_CLOSE_WRITE> (+)"
2226
2227 #. type: Plain text
2228 #: build/C/man7/inotify.7:221
2229 msgid "File opened for writing was closed."
2230 msgstr "書き込みのためにオープンされたファイルがクローズされた。"
2231
2232 #. type: TP
2233 #: build/C/man7/inotify.7:221
2234 #, no-wrap
2235 msgid "B<IN_CLOSE_NOWRITE> (*)"
2236 msgstr "B<IN_CLOSE_NOWRITE> (*)"
2237
2238 #. type: Plain text
2239 #: build/C/man7/inotify.7:224
2240 msgid "File or directory not opened for writing was closed."
2241 msgstr "書き込み用としてはオープンされていないファイルやディレクトリがクローズされた。"
2242
2243 #. type: TP
2244 #: build/C/man7/inotify.7:224
2245 #, no-wrap
2246 msgid "B<IN_CREATE> (+)"
2247 msgstr "B<IN_CREATE> (+)"
2248
2249 #. type: Plain text
2250 #: build/C/man7/inotify.7:234
2251 msgid "File/directory created in watched directory (e.g., B<open>(2)  B<O_CREAT>, B<mkdir>(2), B<link>(2), B<symlink>(2), B<bind>(2)  on a UNIX domain socket)."
2252 msgstr "監視対象ディレクトリ内でファイルやディレクトリが作成された (B<open>(2)  B<O_CREAT>, B<mkdir>(2), B<link>(2), B<symlink>(2), UNIX ドメインソケットに対する B<bind>(2) など)。"
2253
2254 #. type: TP
2255 #: build/C/man7/inotify.7:234
2256 #, no-wrap
2257 msgid "B<IN_DELETE> (+)"
2258 msgstr "B<IN_DELETE> (+)"
2259
2260 #. type: Plain text
2261 #: build/C/man7/inotify.7:237
2262 msgid "File/directory deleted from watched directory."
2263 msgstr "監視対象ディレクトリ内でファイルやディレクトリが削除された。"
2264
2265 #. type: TP
2266 #: build/C/man7/inotify.7:237
2267 #, no-wrap
2268 msgid "B<IN_DELETE_SELF>"
2269 msgstr "B<IN_DELETE_SELF>"
2270
2271 #. type: Plain text
2272 #: build/C/man7/inotify.7:248
2273 msgid "Watched file/directory was itself deleted.  (This event also occurs if an object is moved to another filesystem, since B<mv>(1)  in effect copies the file to the other filesystem and then deletes it from the original filesystem.)  In addition, an B<IN_IGNORED> event will subsequently be generated for the watch descriptor."
2274 msgstr "監視対象のファイルやディレクトリ自身が削除あれた。 (このイベントはオブジェクトが別のファイルシステムに移動された場合にも発生する。 B<mv>(1) は実際には別のファイルシステムにファイルをコピーした後、元のファイルシステムからそのファイルを削除するからである。) また、 結果的に監視ディスクリプターに対して B<IN_IGNORED> イベントも生成される。"
2275
2276 #. type: TP
2277 #: build/C/man7/inotify.7:248
2278 #, no-wrap
2279 msgid "B<IN_MODIFY> (+)"
2280 msgstr "B<IN_MODIFY> (+)"
2281
2282 #. type: Plain text
2283 #: build/C/man7/inotify.7:253
2284 msgid "File was modified (e.g., B<write>(2), B<truncate>(2))."
2285 msgstr "ファイルが変更された (B<write>(2), B<truncate>(2) など)。"
2286
2287 #. type: TP
2288 #: build/C/man7/inotify.7:253
2289 #, no-wrap
2290 msgid "B<IN_MOVE_SELF>"
2291 msgstr "B<IN_MOVE_SELF>"
2292
2293 #. type: Plain text
2294 #: build/C/man7/inotify.7:256
2295 msgid "Watched file/directory was itself moved."
2296 msgstr "監視対象のディレクトリまたはファイル自身が移動された。"
2297
2298 #. type: TP
2299 #: build/C/man7/inotify.7:256
2300 #, no-wrap
2301 msgid "B<IN_MOVED_FROM> (+)"
2302 msgstr "B<IN_MOVED_FROM> (+)"
2303
2304 #. type: Plain text
2305 #: build/C/man7/inotify.7:260
2306 msgid "Generated for the directory containing the old filename when a file is renamed."
2307 msgstr "ファイル名の変更を行った際に変更前のファイル名が含まれるディレクトリに対して生成される。"
2308
2309 #. type: TP
2310 #: build/C/man7/inotify.7:260
2311 #, no-wrap
2312 msgid "B<IN_MOVED_TO> (+)"
2313 msgstr "B<IN_MOVED_TO> (+)"
2314
2315 #. type: Plain text
2316 #: build/C/man7/inotify.7:264
2317 msgid "Generated for the directory containing the new filename when a file is renamed."
2318 msgstr "ファイル名の変更を行った際に新しいファイル名が含まれるディレクトリに対して生成される。"
2319
2320 #. type: TP
2321 #: build/C/man7/inotify.7:264
2322 #, no-wrap
2323 msgid "B<IN_OPEN> (*)"
2324 msgstr "B<IN_OPEN> (*)"
2325
2326 #. type: Plain text
2327 #: build/C/man7/inotify.7:267
2328 msgid "File or directory was opened."
2329 msgstr "ファイルやディレクトリがオープンされた。"
2330
2331 #. type: Plain text
2332 #: build/C/man7/inotify.7:270
2333 msgid "When monitoring a directory:"
2334 msgstr "ディレクトリを監視する場合:"
2335
2336 #. type: Plain text
2337 #: build/C/man7/inotify.7:273
2338 msgid "the events marked above with an asterisk (*) can occur both for the directory itself and for objects inside the directory; and"
2339 msgstr "上記でアスタリスク (*) が付いたイベントは、 ディレクトリ自身とディレクトリ内のオブジェクトのどちらに対しても発生する。"
2340
2341 #. type: Plain text
2342 #: build/C/man7/inotify.7:276
2343 msgid "the events marked with a plus sign (+) occur only for objects inside the directory (not for the directory itself)."
2344 msgstr "上記でプラス記号 (+) が付いたイベントは、 ディレクトリ内のオブジェクトに対してのみ発生する (ディレクトリ自身に対しては発生しない)。"
2345
2346 #. type: Plain text
2347 #: build/C/man7/inotify.7:282
2348 msgid "When events are generated for objects inside a watched directory, the I<name> field in the returned I<inotify_event> structure identifies the name of the file within the directory."
2349 msgstr "監視対象のディレクトリ内のオブジェクトに対してイベントが発生した場合、 I<inotify_event> 構造体で返される I<name> フィールドは、ディレクトリ内のファイル名を表す。"
2350
2351 #. type: Plain text
2352 #: build/C/man7/inotify.7:290
2353 msgid "The B<IN_ALL_EVENTS> macro is defined as a bit mask of all of the above events.  This macro can be used as the I<mask> argument when calling B<inotify_add_watch>(2)."
2354 msgstr "B<IN_ALL_EVENTS> マクロは上記のイベント全てのマスクとして定義される。 このマクロは B<inotify_add_watch>(2)  を呼び出すときの I<mask> 引き数として使える。"
2355
2356 #. type: Plain text
2357 #: build/C/man7/inotify.7:292
2358 msgid "Two additional convenience macros are defined:"
2359 msgstr "以下の 2 つの便利なマクロが定義されている。"
2360
2361 #. type: TP
2362 #: build/C/man7/inotify.7:293
2363 #, no-wrap
2364 msgid "B<IN_MOVE>"
2365 msgstr "B<IN_MOVE>"
2366
2367 #. type: Plain text
2368 #: build/C/man7/inotify.7:297
2369 msgid "Equates to B<IN_MOVED_FROM | IN_MOVED_TO>."
2370 msgstr "B<IN_MOVED_FROM | IN_MOVED_TO> と等価。"
2371
2372 #. type: TP
2373 #: build/C/man7/inotify.7:297
2374 #, no-wrap
2375 msgid "B<IN_CLOSE>"
2376 msgstr "B<IN_CLOSE>"
2377
2378 #. type: Plain text
2379 #: build/C/man7/inotify.7:301
2380 msgid "Equates to B<IN_CLOSE_WRITE | IN_CLOSE_NOWRITE>."
2381 msgstr "B<IN_CLOSE_WRITE | IN_CLOSE_NOWRITE> と等価。"
2382
2383 #. type: Plain text
2384 #: build/C/man7/inotify.7:307
2385 msgid "The following further bits can be specified in I<mask> when calling B<inotify_add_watch>(2):"
2386 msgstr "その他にも以下のビットを B<inotify_add_watch>(2)  を呼ぶときの I<mask> に指定できる:"
2387
2388 #. type: TP
2389 #: build/C/man7/inotify.7:308
2390 #, no-wrap
2391 msgid "B<IN_DONT_FOLLOW> (since Linux 2.6.15)"
2392 msgstr "B<IN_DONT_FOLLOW> (Linux 2.6.15 以降)"
2393
2394 #. type: Plain text
2395 #: build/C/man7/inotify.7:313
2396 msgid "Don't dereference I<pathname> if it is a symbolic link."
2397 msgstr "I<pathname> がシンボリックリンクである場合に辿らない。 (Linux 2.6.15 以降)"
2398
2399 #. type: TP
2400 #: build/C/man7/inotify.7:313
2401 #, no-wrap
2402 msgid "B<IN_EXCL_UNLINK> (since Linux 2.6.36)"
2403 msgstr "B<IN_EXCL_UNLINK> (Linux 2.6.36 以降)"
2404
2405 #.  commit 8c1934c8d70b22ca8333b216aec6c7d09fdbd6a6
2406 #. type: Plain text
2407 #: build/C/man7/inotify.7:329
2408 msgid "By default, when watching events on the children of a directory, events are generated for children even after they have been unlinked from the directory.  This can result in large numbers of uninteresting events for some applications (e.g., if watching I</tmp>, in which many applications create temporary files whose names are immediately unlinked).  Specifying B<IN_EXCL_UNLINK> changes the default behavior, so that events are not generated for children after they have been unlinked from the watched directory."
2409 msgstr "デフォルトでは、あるディレクトリの子ファイルに関するイベントを監視 (watch) した際、ディレクトリからその子ファイルが削除 (unlink) された場合であってもその子ファイルに対してイベントが生成される。このことは、アプリケーションによってはあまり興味のないイベントが大量に発生することにつながる (例えば、I</tmp> を監視している場合、たくさんのアプリケーションが、すぐにその名前が削除される一時ファイルをそのディレクトリに作成する)。 B<IN_EXCL_UNLINK> を指定するとこのデフォルトの動作を変更でき、監視対象のディレクトリから子ファイルが削除された後に子ファイルに関するイベントが生成されなくなる。"
2410
2411 #. type: TP
2412 #: build/C/man7/inotify.7:329
2413 #, no-wrap
2414 msgid "B<IN_MASK_ADD>"
2415 msgstr "B<IN_MASK_ADD>"
2416
2417 #. type: Plain text
2418 #: build/C/man7/inotify.7:336
2419 msgid "If a watch instance already exists for the filesystem object corresponding to I<pathname>, add (OR) the events in I<mask> to the watch mask (instead of replacing the mask)."
2420 msgstr "監視インスタンスが I<pathname> に対応するファイルシステムオブジェクトに対してすでに存在する場合に、 (マスクを置き換えるのではなく) 監視マスクに I<mask> で指定されたイベントを追加 (OR) する。"
2421
2422 #. type: TP
2423 #: build/C/man7/inotify.7:336
2424 #, no-wrap
2425 msgid "B<IN_ONESHOT>"
2426 msgstr "B<IN_ONESHOT>"
2427
2428 #. type: Plain text
2429 #: build/C/man7/inotify.7:342
2430 msgid "Monitor the filesystem object corresponding to I<pathname> for one event, then remove from watch list."
2431 msgstr "I<pathname> に対応するファイルシステムオブジェクトを 1 イベントについてだけ監視し、 イベントが発生したら監視対象リストから削除する。"
2432
2433 #. type: TP
2434 #: build/C/man7/inotify.7:342
2435 #, no-wrap
2436 msgid "B<IN_ONLYDIR> (since Linux 2.6.15)"
2437 msgstr "B<IN_ONLYDIR> (Linux 2.6.15 以降)"
2438
2439 #. type: Plain text
2440 #: build/C/man7/inotify.7:349
2441 msgid "Only watch I<pathname> if it is a directory.  Using this flag provides an application with a race-free way of ensuring that the monitored object is a directory."
2442 msgstr "I<pathname> がディレクトリの場合のみ監視する。 このフラグを使うことで、アプリケーションは、競合状態を考慮せずに、監視するオブジェクトがディレクトリであることを保証することができるようになる。"
2443
2444 #. type: Plain text
2445 #: build/C/man7/inotify.7:355
2446 msgid "The following bits may be set in the I<mask> field returned by B<read>(2):"
2447 msgstr "以下のビットが B<read>(2)  で返される I<mask> フィールドに設定される:"
2448
2449 #. type: TP
2450 #: build/C/man7/inotify.7:356
2451 #, no-wrap
2452 msgid "B<IN_IGNORED>"
2453 msgstr "B<IN_IGNORED>"
2454
2455 #. type: Plain text
2456 #: build/C/man7/inotify.7:362
2457 msgid "Watch was removed explicitly (B<inotify_rm_watch>(2))  or automatically (file was deleted, or filesystem was unmounted).  See also BUGS."
2458 msgstr "監視対象が (B<inotify_rm_watch>(2) により) 明示的に 削除された。もしくは (ファイルの削除、またはファイル システムのアンマウントにより) 自動的に削除された。「バグ」も参照のこと。"
2459
2460 #. type: TP
2461 #: build/C/man7/inotify.7:362
2462 #, no-wrap
2463 msgid "B<IN_ISDIR>"
2464 msgstr "B<IN_ISDIR>"
2465
2466 #. type: Plain text
2467 #: build/C/man7/inotify.7:365
2468 msgid "Subject of this event is a directory."
2469 msgstr "このイベントの対象がディレクトリである。"
2470
2471 #. type: TP
2472 #: build/C/man7/inotify.7:365
2473 #, no-wrap
2474 msgid "B<IN_Q_OVERFLOW>"
2475 msgstr "B<IN_Q_OVERFLOW>"
2476
2477 #. type: Plain text
2478 #: build/C/man7/inotify.7:370
2479 msgid "Event queue overflowed (I<wd> is -1 for this event)."
2480 msgstr "イベントキューが溢れた (このイベントの場合、I<wd> は -1 である)。"
2481
2482 #. type: TP
2483 #: build/C/man7/inotify.7:370
2484 #, no-wrap
2485 msgid "B<IN_UNMOUNT>"
2486 msgstr "B<IN_UNMOUNT>"
2487
2488 #. type: Plain text
2489 #: build/C/man7/inotify.7:376
2490 msgid "Filesystem containing watched object was unmounted.  In addition, an B<IN_IGNORED> event will subsequently be generated for the watch descriptor."
2491 msgstr "監視対象オブジェクトを含むファイルシステムがアンマウントされた。さらに、この監視対象ディスクリプターに対して B<IN_IGNORED> イベントが生成される。"
2492
2493 #. type: SS
2494 #: build/C/man7/inotify.7:377
2495 #, no-wrap
2496 msgid "Examples"
2497 msgstr "例"
2498
2499 #. type: Plain text
2500 #: build/C/man7/inotify.7:385
2501 msgid "Suppose an application is watching the directory I<dir> and the file I<dir/myfile> for all events.  The examples below show some events that will be generated for these two objects."
2502 msgstr "アプリケーションがディレクトリ I<dir> とファイル I<dir/myfile> のすべてのイベントを監視しているとする。 以下に、これらの 2 つのオブジェクトに対して生成されるイベントの例を示す。"
2503
2504 #. type: TP
2505 #: build/C/man7/inotify.7:386
2506 #, no-wrap
2507 msgid "fd = open(\"dir/myfile\", O_RDWR);"
2508 msgstr "fd = open(\"dir/myfile\", O_RDWR);"
2509
2510 #. type: Plain text
2511 #: build/C/man7/inotify.7:394
2512 msgid "Generates B<IN_OPEN> events for both I<dir> and I<dir/myfile>."
2513 msgstr "I<dir> と I<dir/myfile> の両方に対して B<IN_OPEN> イベントが生成される。"
2514
2515 #. type: TP
2516 #: build/C/man7/inotify.7:394
2517 #, no-wrap
2518 msgid "read(fd, buf, count);"
2519 msgstr "read(fd, buf, count);"
2520
2521 #. type: Plain text
2522 #: build/C/man7/inotify.7:402
2523 msgid "Generates B<IN_ACCESS> events for both I<dir> and I<dir/myfile>."
2524 msgstr "I<dir> と I<dir/myfile> の両方に対して B<IN_ACCESS> イベントが生成される"
2525
2526 #. type: TP
2527 #: build/C/man7/inotify.7:402
2528 #, no-wrap
2529 msgid "write(fd, buf, count);"
2530 msgstr "write(fd, buf, count);"
2531
2532 #. type: Plain text
2533 #: build/C/man7/inotify.7:410
2534 msgid "Generates B<IN_MODIFY> events for both I<dir> and I<dir/myfile>."
2535 msgstr "I<dir> と I<dir/myfile> の両方に対して B<IN_MODIFY> イベントが生成される"
2536
2537 #. type: TP
2538 #: build/C/man7/inotify.7:410
2539 #, no-wrap
2540 msgid "fchmod(fd, mode);"
2541 msgstr "fchmod(fd, mode);"
2542
2543 #. type: Plain text
2544 #: build/C/man7/inotify.7:418
2545 msgid "Generates B<IN_ATTRIB> events for both I<dir> and I<dir/myfile>."
2546 msgstr "I<dir> と I<dir/myfile> の両方に対して B<IN_ATTRIB> イベントが生成される"
2547
2548 #. type: TP
2549 #: build/C/man7/inotify.7:418
2550 #, no-wrap
2551 msgid "close(fd);"
2552 msgstr "close(fd);"
2553
2554 #. type: Plain text
2555 #: build/C/man7/inotify.7:426
2556 msgid "Generates B<IN_CLOSE_WRITE> events for both I<dir> and I<dir/myfile>."
2557 msgstr "I<dir> と I<dir/myfile> の両方に対して B<IN_CLOSE_WRITE> イベントが生成される"
2558
2559 #. type: Plain text
2560 #: build/C/man7/inotify.7:435
2561 msgid "Suppose an application is watching the directories I<dir1> and I<dir2>, and the file I<dir1/myfile>.  The following examples show some events that may be generated."
2562 msgstr "アプリケーションがディレクトリ I<dir1> と I<dir2>、およびファイル I<dir1/myfile> を監視しているとする。 以下に生成されるイベントの例を示す。"
2563
2564 #. type: TP
2565 #: build/C/man7/inotify.7:436
2566 #, no-wrap
2567 msgid "link(\"dir1/myfile\", \"dir2/new\");"
2568 msgstr "link(\"dir1/myfile\", \"dir2/new\");"
2569
2570 #. type: Plain text
2571 #: build/C/man7/inotify.7:446
2572 msgid "Generates an B<IN_ATTRIB> event for I<myfile> and an B<IN_CREATE> event for I<dir2>."
2573 msgstr "I<myfile> に対して B<IN_ATTRIB> イベントが生成され、 I<dir2> に対して B<IN_CREATE> イベントが生成される。"
2574
2575 #. type: TP
2576 #: build/C/man7/inotify.7:446
2577 #, no-wrap
2578 msgid "rename(\"dir1/myfile\", \"dir2/myfile\");"
2579 msgstr "rename(\"dir1/myfile\", \"dir2/myfile\");"
2580
2581 #. type: Plain text
2582 #: build/C/man7/inotify.7:467
2583 msgid "Generates an B<IN_MOVED_FROM> event for I<dir1>, an B<IN_MOVED_TO> event for I<dir2>, and an B<IN_MOVE_SELF> event for I<myfile>.  The B<IN_MOVED_FROM> and B<IN_MOVED_TO> events will have the same I<cookie> value."
2584 msgstr "I<dir1> に対してイベント B<IN_MOVED_FROM> が、 I<dir2> に対してイベント B<IN_MOVED_TO> が、 I<myfile> に対してイベント B<IN_MOVE_SELF> が生成される。この際 イベント B<IN_MOVED_FROM> と B<IN_MOVED_TO> は同じ I<cookie> 値を持つ。"
2585
2586 #. type: Plain text
2587 #: build/C/man7/inotify.7:481
2588 msgid "Suppose that I<dir1/xx> and I<dir2/yy> are (the only) links to the same file, and an application is watching I<dir1>, I<dir2>, I<dir1/xx>, and I<dir2/yy>.  Executing the following calls in the order given below will generate the following events:"
2589 msgstr "I<dir1/xx> と I<dir2/yy> は同じファイルを参照するリンクで (他のリンクはないものとする)、 アプリケーションは I<dir1>, I<dir2>, I<dir1/xx>, I<dir2/yy> を監視しているものとする。 以下に示す順序で下記の呼び出しを実行すると、以下のイベントが生成される。"
2590
2591 #. type: TP
2592 #: build/C/man7/inotify.7:482
2593 #, no-wrap
2594 msgid "unlink(\"dir2/yy\");"
2595 msgstr "unlink(\"dir2/yy\");"
2596
2597 #. type: Plain text
2598 #: build/C/man7/inotify.7:493
2599 msgid "Generates an B<IN_ATTRIB> event for I<xx> (because its link count changes)  and an B<IN_DELETE> event for I<dir2>."
2600 msgstr "I<xx> に対して B<IN_ATTRIB> イベントが生成され (リンク数が変化したため)、 I<dir2> に対して B<IN_DELETE> イベントが生成される。"
2601
2602 #. type: TP
2603 #: build/C/man7/inotify.7:493
2604 #, no-wrap
2605 msgid "unlink(\"dir1/xx\");"
2606 msgstr "unlink(\"dir1/xx\");"
2607
2608 #. type: Plain text
2609 #: build/C/man7/inotify.7:506
2610 msgid "Generates B<IN_ATTRIB>, B<IN_DELETE_SELF>, and B<IN_IGNORED> events for I<xx>, and an B<IN_DELETE> event for I<dir1>."
2611 msgstr "I<xx> に対してイベント B<IN_ATTRIB>, B<IN_DELETE_SELF>, B<IN_IGNORED> が生成され、 I<dir1> に対して B<IN_DELETE> イベントが生成される。"
2612
2613 #. type: Plain text
2614 #: build/C/man7/inotify.7:513
2615 msgid "Suppose an application is watching the directory I<dir> and (the empty) directory I<dir/subdir>.  The following examples show some events that may be generated."
2616 msgstr "アプリケーションがディレクトリ I<dir> と (空の) ディレクトリ I<dir/subdir> を監視しているものとする。 以下に生成されるイベントの例を示す。"
2617
2618 #. type: TP
2619 #: build/C/man7/inotify.7:514
2620 #, no-wrap
2621 msgid "mkdir(\"dir/new\", mode);"
2622 msgstr "mkdir(\"dir/new\", mode);"
2623
2624 #. type: Plain text
2625 #: build/C/man7/inotify.7:520
2626 msgid "Generates an B<IN_CREATE | IN_ISDIR> event for I<dir>."
2627 msgstr "I<dir> に対して B<IN_CREATE | IN_ISDIR> イベントが生成される。"
2628
2629 #. type: TP
2630 #: build/C/man7/inotify.7:520
2631 #, no-wrap
2632 msgid "rmdir(\"dir/subdir\");"
2633 msgstr "rmdir(\"dir/subdir\");"
2634
2635 #. type: Plain text
2636 #: build/C/man7/inotify.7:532
2637 msgid "Generates B<IN_DELETE_SELF> and B<IN_IGNORED> events for I<subdir>, and an B<IN_DELETE | IN_ISDIR> event for I<dir>."
2638 msgstr "I<subdir> に対してイベント B<IN_DELETE_SELF> と B<IN_IGNORED> が生成され、 I<dir> に対して B<IN_DELETE | IN_ISDIR> イベントが生成される。"
2639
2640 #. type: SS
2641 #: build/C/man7/inotify.7:533
2642 #, no-wrap
2643 msgid "/proc interfaces"
2644 msgstr "/proc インターフェース"
2645
2646 #. type: Plain text
2647 #: build/C/man7/inotify.7:536
2648 msgid "The following interfaces can be used to limit the amount of kernel memory consumed by inotify:"
2649 msgstr "以下のインターフェースは、inotify で消費される カーネルメモリーの総量を制限するのに使用できる:"
2650
2651 #. type: TP
2652 #: build/C/man7/inotify.7:536
2653 #, no-wrap
2654 msgid "I</proc/sys/fs/inotify/max_queued_events>"
2655 msgstr "I</proc/sys/fs/inotify/max_queued_events>"
2656
2657 #. type: Plain text
2658 #: build/C/man7/inotify.7:545
2659 msgid "The value in this file is used when an application calls B<inotify_init>(2)  to set an upper limit on the number of events that can be queued to the corresponding inotify instance.  Events in excess of this limit are dropped, but an B<IN_Q_OVERFLOW> event is always generated."
2660 msgstr "このファイルの値は、アプリケーションが B<inotify_init>(2)  を呼び出すときに使用され、対応する inotify インスタンスについて キューに入れられるイベントの数の上限を設定する。 この制限を超えたイベントは破棄されるが、 B<IN_Q_OVERFLOW> イベントが常に生成される。"
2661
2662 #. type: TP
2663 #: build/C/man7/inotify.7:545
2664 #, no-wrap
2665 msgid "I</proc/sys/fs/inotify/max_user_instances>"
2666 msgstr "I</proc/sys/fs/inotify/max_user_instances>"
2667
2668 #. type: Plain text
2669 #: build/C/man7/inotify.7:549
2670 msgid "This specifies an upper limit on the number of inotify instances that can be created per real user ID."
2671 msgstr "1 つの実ユーザー ID に対して生成できる inotify インスタンスの数の上限を指定する。"
2672
2673 #. type: TP
2674 #: build/C/man7/inotify.7:549
2675 #, no-wrap
2676 msgid "I</proc/sys/fs/inotify/max_user_watches>"
2677 msgstr "I</proc/sys/fs/inotify/max_user_watches>"
2678
2679 #. type: Plain text
2680 #: build/C/man7/inotify.7:553
2681 msgid "This specifies an upper limit on the number of watches that can be created per real user ID."
2682 msgstr "作成可能な監視対象の数の実 UID 単位の上限を指定する。"
2683
2684 #. type: Plain text
2685 #: build/C/man7/inotify.7:561
2686 msgid "Inotify was merged into the 2.6.13 Linux kernel.  The required library interfaces were added to glibc in version 2.4.  (B<IN_DONT_FOLLOW>, B<IN_MASK_ADD>, and B<IN_ONLYDIR> were added in glibc version 2.5.)"
2687 msgstr "inotify は 2.6.13 の Linux カーネルに組込まれた。 これに必要なライブラリのインターフェースは、 glibc のバージョン 2.4 に追加された (B<IN_DONT_FOLLOW>, B<IN_MASK_ADD>, B<IN_ONLYDIR> は glibc バージョン 2.5 で追加された)。"
2688
2689 #. type: Plain text
2690 #: build/C/man7/inotify.7:563
2691 msgid "The inotify API is Linux-specific."
2692 msgstr "inotify API は Linux 独自のものである。"
2693
2694 #. type: Plain text
2695 #: build/C/man7/inotify.7:570
2696 msgid "Inotify file descriptors can be monitored using B<select>(2), B<poll>(2), and B<epoll>(7).  When an event is available, the file descriptor indicates as readable."
2697 msgstr "inotify ファイルディスクリプターは B<select>(2), B<poll>(2), B<epoll>(7)  を使って監視できる。 イベントがある場合、ファイルディスクリプターは読み込み可能と通知する。"
2698
2699 #. type: Plain text
2700 #: build/C/man7/inotify.7:599
2701 msgid "Since Linux 2.6.25, signal-driven I/O notification is available for inotify file descriptors; see the discussion of B<F_SETFL> (for setting the B<O_ASYNC> flag), B<F_SETOWN>, and B<F_SETSIG> in B<fcntl>(2).  The I<siginfo_t> structure (described in B<sigaction>(2))  that is passed to the signal handler has the following fields set: I<si_fd> is set to the inotify file descriptor number; I<si_signo> is set to the signal number; I<si_code> is set to B<POLL_IN>; and B<POLLIN> is set in I<si_band>."
2702 msgstr "Linux 2.6.25 以降では、シグナル駆動 (signal-driven) I/O の通知が inotify ファイルディスクリプターについて利用可能である。 B<fcntl>(2)  に書かれている (B<O_ASYNC> フラグを設定するための)  B<F_SETFL>, B<F_SETOWN>, B<F_SETSIG> の議論を参照のこと。 シグナルハンドラーに渡される I<siginfo_t> 構造体は、以下のフィールドが設定される (I<siginfo_t> は B<sigaction>(2)  で説明されている)。 I<si_fd> には inotify ファイルディスクリプター番号が、 I<si_signo> にはシグナル番号が、 I<si_code> には B<POLL_IN> が、 I<si_band> には B<POLLIN> が設定される。"
2703
2704 #. type: Plain text
2705 #: build/C/man7/inotify.7:612
2706 msgid "If successive output inotify events produced on the inotify file descriptor are identical (same I<wd>, I<mask>, I<cookie>, and I<name>), then they are coalesced into a single event if the older event has not yet been read (but see BUGS).  This reduces the amount of kernel memory required for the event queue, but also means that an application can't use inotify to reliably count file events."
2707 msgstr "inotify ファイルディスクリプターに対して 連続して生成される出力 inotify イベントが同一の場合 (I<wd>, I<mask>, I<cookie>, I<name> が等しい場合)、 前のイベントがまだ読み込まれていなければ、 連続するイベントが 1 つのイベントにまとめられる (ただし「バグ」の節も参照のこと)。 これによりイベントキューに必要なカーネルメモリー量が減るが、 これはまたアプリケーションがファイルイベント数を信頼性を持って数えるのに inotify を使用できないということでもある。"
2708
2709 #. type: Plain text
2710 #: build/C/man7/inotify.7:618
2711 msgid "The events returned by reading from an inotify file descriptor form an ordered queue.  Thus, for example, it is guaranteed that when renaming from one directory to another, events will be produced in the correct order on the inotify file descriptor."
2712 msgstr "inotify ファイルディスクリプターの読み込みで返されるイベントは、 順序付けられたキューになる。 従って、たとえば、あるディレクトリの名前を別の名前に変更した場合、 inotify ファイルディスクリプターについての正しい順番で イベントが生成されることが保証される。"
2713
2714 #. type: Plain text
2715 #: build/C/man7/inotify.7:624
2716 msgid "The B<FIONREAD> B<ioctl>(2)  returns the number of bytes available to read from an inotify file descriptor."
2717 msgstr "B<FIONREAD> B<ioctl>(2)  は inotify ファイルディスクリプターから何バイト読み込めるかを返す。"
2718
2719 #. type: Plain text
2720 #: build/C/man7/inotify.7:631
2721 msgid "The inotify API provides no information about the user or process that triggered the inotify event.  In particular, there is no easy way for a process that is monitoring events via inotify to distinguish events that it triggers itself from those that are triggered by other processes."
2722 msgstr "inotify API では、inotify イベントが発生するきっかけとなったユーザーやプロセスに関する情報は提供されない。とりわけ、inotify 経由でイベントを監視しているプロセスが、自分自身がきっかけとなったイベントと他のプロセスがきっかけとなったイベントを区別する簡単な手段はない。"
2723
2724 #. type: Plain text
2725 #: build/C/man7/inotify.7:644
2726 msgid "Inotify reports only events that a user-space program triggers through the filesystem API.  As a result, it does not catch remote events that occur on network filesystems.  (Applications must fall back to polling the filesystem to catch such events.)  Furthermore, various pseudo-filesystems such as I</proc>, I</sys>, and I</dev/pts> are not monitorable with inotify."
2727 msgstr "inotify は、ファイルシステム API 経由でユーザー空間プログラムがきっかけとなったイベントだけを報告する。 結果として、 inotify はネットワークファイルシステムで発生したリモートのイベントを捉えることはできない (このようなイベントを捉えるにはアプリケーションはファイルシステムをポーリングする必要がある)。 さらに、 I</proc>, I</sys>, I</dev/pts> といったいくつかの疑似ファイルシステムは inotify で監視することができない。"
2728
2729 #. type: Plain text
2730 #: build/C/man7/inotify.7:651
2731 msgid "The inotify API does not report file accesses and modifications that may occur because of B<mmap>(2), B<msync>(2), and B<munmap>(2)."
2732 msgstr "inotify API は B<mmap>(2), B<msync>(2), B<munmap>(2) により起こったファイルのアクセスと変更を報告しない。"
2733
2734 #. type: Plain text
2735 #: build/C/man7/inotify.7:655
2736 msgid "The inotify API identifies affected files by filename.  However, by the time an application processes an inotify event, the filename may already have been deleted or renamed."
2737 msgstr ""
2738 "inotify API では影響が受けるファイルをファイル名で特定する。\n"
2739 "しかしながら、アプリケーションが inotify イベントを処理する時点では、\n"
2740 "そのファイル名がすでに削除されたり変更されたりしている可能性がある。"
2741
2742 #. type: Plain text
2743 #: build/C/man7/inotify.7:660
2744 msgid "The inotify API identifies events via watch descriptors.  It is the application's responsibility to cache a mapping (if one is needed) between watch descriptors and pathnames.  Be aware that directory renamings may affect multiple cached pathnames."
2745 msgstr "inotify API では監視対象ディスクリプターを通してイベントが区別される。 (必要であれば) 監視対象ディスクリプターとパス名のマッピングをキャッシュしておくのはアプリケーションの役目である。 ディレクトリの名前変更の場合、キャッシュしている複数のパス名に影響がある点に注意すること。"
2746
2747 #. type: Plain text
2748 #: build/C/man7/inotify.7:665
2749 msgid "Inotify monitoring of directories is not recursive: to monitor subdirectories under a directory, additional watches must be created.  This can take a significant amount time for large directory trees."
2750 msgstr ""
2751 "inotify によるディレクトリの監視は再帰的に行われない: あるディレクトリ以下の\n"
2752 "サブディレクトリを監視する場合、 監視対象を追加で作成しなければならない。\n"
2753 "大きなディレクトリツリーの場合には、この作業にかなり時間がかかることがある。"
2754
2755 #. type: Plain text
2756 #: build/C/man7/inotify.7:674
2757 msgid "If monitoring an entire directory subtree, and a new subdirectory is created in that tree or an existing directory is renamed into that tree, be aware that by the time you create a watch for the new subdirectory, new files (and subdirectories) may already exist inside the subdirectory.  Therefore, you may want to scan the contents of the subdirectory immediately after adding the watch (and, if desired, recursively add watches for any subdirectories that it contains)."
2758 msgstr "ディレクトリツリー全体を監視していて、 そのツリー内に新しいサブディレクトリが作成されるか、 既存のディレクトリが名前が変更されそのツリー内に移動した場合、 新しいサブディレクトリに対する watch を作成するまでに、 新しいファイル (やサブディレクトリ) がそのサブディレクトリ内にすでに作成されている場合がある点に注意すること。 したがって、watch を追加した直後にサブディレクトリの内容をスキャンしたいと思う場合もあるだろう (必要ならそのサブディレクトリ内のサブディレクトリに対する watch も再帰的に追加することもあるだろう)。"
2759
2760 #. type: Plain text
2761 #: build/C/man7/inotify.7:686
2762 msgid "Note that the event queue can overflow.  In this case, events are lost.  Robust applications should handle the possibility of lost events gracefully.  For example, it may be necessary to rebuild part or all of the application cache.  (One simple, but possibly expensive, approach is to close the inotify file descriptor, empty the cache, create a new inotify file descriptor, and then re-create watches and cache entries for the objects to be monitored.)"
2763 msgstr "イベントキューはオーバーフローする場合があることに注意すること。 この場合、イベントは失なわれる。 ロバスト性が求められるアプリケーションでは、 イベントが失なわれる可能性も含めて適切に処理を行うべきである。 例えば、アプリケーション内のキャッシュの一部分または全てを再構築する必要があるかもしれない。 (単純だが、おそらくコストがかかる方法は、 inotify ファイルディスクリプターをクローズし、 キャッシュを空にし、 新しい inotify ファイルディスクリプターを作成し、 監視しているオブジェクトの監視対象ディスクリプターとキャッシュエントリーの再作成を行う方法である。)"
2764
2765 #. type: SS
2766 #: build/C/man7/inotify.7:686
2767 #, no-wrap
2768 msgid "Dealing with rename() events"
2769 msgstr "rename() イベントの取り扱い"
2770
2771 #. type: Plain text
2772 #: build/C/man7/inotify.7:695
2773 msgid "As noted above, the B<IN_MOVED_FROM> and B<IN_MOVED_TO> event pair that is generated by B<rename>(2)  can be matched up via their shared cookie value.  However, the task of matching has some challenges."
2774 msgstr "上述の通り、 B<rename>(2) により生成される B<IN_MOVED_FROM> と B<IN_MOVED_TO> イベントの組は、共有される cookie 値によって対応を取ることができる。 しかし、対応を取る場合にはいくつか難しい点がある。"
2775
2776 #. type: Plain text
2777 #: build/C/man7/inotify.7:712
2778 msgid "These two events are usually consecutive in the event stream available when reading from the inotify file descriptor.  However, this is not guaranteed.  If multiple processes are triggering events for monitored objects, then (on rare occasions) an arbitrary number of other events may appear between the B<IN_MOVED_FROM> and B<IN_MOVED_TO> events.  Furthermore, it is not guaranteed that the event pair is atomically inserted into the queue: there may be a brief interval where the B<IN_MOVED_FROM> has appeared, but the B<IN_MOVED_TO> has not."
2779 msgstr "これらの 2 つのイベントは、 inotify ファイルディスクリプターから読み出しを行った場合に、通常はイベントストリーム内で連続している。 しかしながら、連続していることは保証されていない。 複数のプロセスが監視対象オブジェクトでイベントを発生させた場合、 (めったに起こらないことだが) イベント B<IN_MOVED_FROM> と B<IN_MOVED_TO> の間に任意の数の他のイベントがはさまる可能性がある。 さらに、対となるイベントがアトミックにキューに挿入されることも保証されていない。 B<IN_MOVED_FROM> が現れたが B<IN_MOVED_TO> は現れていないという短い期間がありえるということだ。"
2780
2781 #. type: Plain text
2782 #: build/C/man7/inotify.7:737
2783 msgid "Matching up the B<IN_MOVED_FROM> and B<IN_MOVED_TO> event pair generated by B<rename>(2)  is thus inherently racy.  (Don't forget that if an object is renamed outside of a monitored directory, there may not even be an B<IN_MOVED_TO> event.)  Heuristic approaches (e.g., assume the events are always consecutive)  can be used to ensure a match in most cases, but will inevitably miss some cases, causing the application to perceive the B<IN_MOVED_FROM> and B<IN_MOVED_TO> events as being unrelated.  If watch descriptors are destroyed and re-created as a result, then those watch descriptors will be inconsistent with the watch descriptors in any pending events.  (Re-creating the inotify file descriptor and rebuilding the cache may be useful to deal with this scenario.)"
2784 msgstr "したがって、 B<rename>(2) により生成された B<IN_MOVED_FROM> と B<IN_MOVED_TO> のイベントの組の対応を取るのは本質的に難しいことである (監視対象のディレクトリの外へオブジェクトの rename が行われた場合には B<IN_MOVED_TO> イベントは存在しさえしないことを忘れてはならない)。 (イベントは常に連続しているとの仮定を置くといった) 発見的な方法を使うと、ほとんどの場合でイベントの組をうまく見つけることができるが、 いくつかの場合に見逃すことが避けられず、 アプリケーションが B<IN_MOVED_FROM> と B<IN_MOVED_TO> イベントが無関係だとみなしてしまう可能性がある。 結果的に、監視対象ディスクリプターが破棄され再作成された場合、これらの監視対象ディスクリプターは、処理待ちイベントの監視対象ディスクリプターと一貫性のないものになってしまう (inotify ファイルディスクリプターの再作成とキャッシュの再構成はこの状況に対処するのに有用な方法なのだが)。"
2785
2786 #. type: Plain text
2787 #: build/C/man7/inotify.7:754
2788 msgid "Applications should also allow for the possibility that the B<IN_MOVED_FROM> event was the last event that could fit in the buffer returned by the current call to B<read>(2), and the accompanying B<IN_MOVED_TO> event might be fetched only on the next B<read>(2), which should be done with a (small) timeout to allow for the fact that insertion of the B<IN_MOVED_FROM>-B<IN_MOVED_TO> event pair is not atomic, and also the possibility that there may not be any B<IN_MOVED_TO> event."
2789 msgstr "また、アプリケーションは、 B<IN_MOVED_FROM> イベントが今行った B<read>(2) の呼び出しで返されたバッファーのちょうど一番最後のイベントで、 B<IN_MOVED_TO> イベントは次の B<read>(2) を行わないと取得できない可能性も考慮に入れる必要がある。 2 つ目の B<read>(2) は (短い) タイムアウトで行うべきである。 これは、 B<IN_MOVED_FROM>-B<IN_MOVED_TO> のイベントペアのキューへの挿入はアトミックではなく、 また B<IN_MOVED_TO> イベントが全く発生しない可能性もあるという事実を考慮に入れておく必要があるからである。"
2790
2791 #. type: Plain text
2792 #: build/C/man7/inotify.7:758
2793 msgid "As of kernel 3.17, calling B<fallocate>(2)  does not create any inotify events."
2794 msgstr "カーネル 3.17 時点では、 B<fallocate>(2) の呼び出しでは inotify イベントが生成されない。"
2795
2796 #.  FIXME . kernel commit 611da04f7a31b2208e838be55a42c7a1310ae321
2797 #.  implies that unmount events were buggy 2.6.11 to 2.6.36
2798 #. type: Plain text
2799 #: build/C/man7/inotify.7:766
2800 msgid "In kernels before 2.6.16, the B<IN_ONESHOT> I<mask> flag does not work."
2801 msgstr "2.6.16 以前のカーネルでは B<IN_ONESHOT> I<mask> フラグが働かない。"
2802
2803 #. type: Plain text
2804 #: build/C/man7/inotify.7:776
2805 msgid "As originally designed and implemented, the B<IN_ONESHOT> flag did not cause an B<IN_IGNORED> event to be generated when the watch was dropped after one event.  However, as an unintended effect of other changes, since Linux 2.6.36, an B<IN_IGNORED> event is generated in this case."
2806 msgstr "元々は設計/実装時の意図通り、 イベントが一つ発生し watch が削除された際に B<IN_ONESHOT> フラグでは B<IN_IGNORED> イベントが発生しなかった。 しかし、 別の変更での意図していなかった影響により、 Linux 2.6.36 以降では、 この場合に B<IN_IGNORED> イベントが生成される。"
2807
2808 #.  commit 1c17d18e3775485bf1e0ce79575eb637a94494a2
2809 #. type: Plain text
2810 #: build/C/man7/inotify.7:785
2811 msgid "Before kernel 2.6.25, the kernel code that was intended to coalesce successive identical events (i.e., the two most recent events could potentially be coalesced if the older had not yet been read)  instead checked if the most recent event could be coalesced with the I<oldest> unread event."
2812 msgstr "カーネル 2.6.25 より前では、 連続する同一のイベントを一つにまとめることを意図したコード (古い方のイベントがまだ読み込まれていない場合に、 最新の 2 つのイベントを一つにまとめられる可能性がある) が、 最新のイベントが「最も古い」読み込まれていないイベントとまとめられるか をチェックするようになっていた。"
2813
2814 #.  FIXME . https://bugzilla.kernel.org/show_bug.cgi?id=77111
2815 #. type: Plain text
2816 #: build/C/man7/inotify.7:815
2817 msgid "When a watch descriptor is removed by calling B<inotify_rm_watch>(2)  (or because a watch file is deleted or the filesystem that contains it is unmounted), any pending unread events for that watch descriptor remain available to read.  As watch descriptors are subsequently allocated with B<inotify_add_watch>(2), the kernel cycles through the range of possible watch descriptors (0 to B<INT_MAX>)  incrementally.  When allocating a free watch descriptor, no check is made to see whether that watch descriptor number has any pending unread events in the inotify queue.  Thus, it can happen that a watch descriptor is reallocated even when pending unread events exist for a previous incarnation of that watch descriptor number, with the result that the application might then read those events and interpret them as belonging to the file associated with the newly recycled watch descriptor.  In practice, the likelihood of hitting this bug may be extremely low, since it requires that an application cycle through B<INT_MAX> watch descriptors, release a watch descriptor while leaving unread events for that watch descriptor in the queue, and then recycle that watch descriptor.  For this reason, and because there have been no reports of the bug occurring in real-world applications, as of Linux 3.15, no kernel changes have yet been made to eliminate this possible bug."
2818 msgstr "B<inotify_rm_watch>(2) の呼び出しにより監視対象ディスクリプターが削除された場合 (なお、監視対象ファイルの削除や監視対象ファイルが含まれるファイルシステムのアンマウントによっても監視対象ディスクリプターは削除される)、 この監視対象ディスクリプター関連の処理待ちの未読み出しイベントは、 読み出し可能なままとなる。 監視対象ディスクリプターは B<inotify_add_watch>(2) によって後で割り当てられるため、 カーネルは利用可能な監視対象ディスクリプターの範囲 (0 から B<INT_MAX>) から昇順にサイクリックに割り当てを行う。未使用の監視対象ディスクリプターを割り当てる際、 その監視対象ディスクリプター番号に inotify キューで処理待ちの未読み出しイベントがあるかの確認は行われない。 したがって、監視対象ディスクリプターが再割り当てされた際に、 その監視対象ディスクリプターの一つ前の使用時に発生した処理待ちの未読み出しイベントが存在するということが起こりうる。 その結果、アプリケーションはこれらのイベントを読み出す可能性があり、 これらのイベントが新しく再利用された監視対象ディスクリプターに関連付けられたファイルに属するものかを解釈する必要が出て来る。 実際のところ、このバグを踏む可能性は極めて低い。 それは、このバグを踏むためには、アプリケーションが B<INT_MAX> 個の監視対象ディスクリプターが一周させて、 キューに未読み出しイベントが残っている監視対象ディスクリプターを解放し、 その監視対象ディスクリプターを再利用する必要があるからである。 この理由と、実世界のアプリケーションで発生したというバグ報告がないことから、 Linux 3.15 時点では、この計算上は起こりうるバグを取り除くためのカーネルの変更は行われていない。"
2819
2820 #. type: Plain text
2821 #: build/C/man7/inotify.7:823
2822 msgid "The following program demonstrates the usage of the inotify API.  It marks the directories passed as a command-line arguments and waits for events of type B<IN_OPEN>, B<IN_CLOSE_NOWRITE> and B<IN_CLOSE_WRITE>."
2823 msgstr "以下のプログラムは inotify API の使用例を示したものである。 コマンドライン引き数で渡されたディレクトリに印を付け、 タイプが B<IN_OPEN>, B<IN_CLOSE_NOWRITE> B<IN_CLOSE_WRITE> のイベントを待つ。"
2824
2825 #. type: Plain text
2826 #: build/C/man7/inotify.7:838
2827 msgid "The following output was recorded while editing the file I</home/user/temp/foo> and listing directory I</tmp>.  Before the file and the directory were opened, B<IN_OPEN> events occurred.  After the file was closed, an B<IN_CLOSE_WRITE> event occurred.  After the directory was closed, an B<IN_CLOSE_NOWRITE> event occurred.  Execution of the program ended when the user pressed the ENTER key."
2828 msgstr "以下は、 ファイル I</home/user/temp/foo> を編集し、 ディレクトリ I</tmp> の一覧表示を行った場合の出力である。 対象のファイルとディレクトリがオープンされる前に、イベント B<IN_OPEN> が発生している。 対象ファイルがクローズされた後にイベント B<IN_CLOSE_WRITE> が発生している。 対象ディレクトリがクローズされた後にイベント B<IN_CLOSE_NOWRITE> が発生している。 ユーザーが ENTER キーを押すると、プログラムの実行は終了する。"
2829
2830 #. type: Plain text
2831 #: build/C/man7/inotify.7:848
2832 #, no-wrap
2833 msgid ""
2834 "$ B<./a.out /tmp /home/user/temp>\n"
2835 "Press enter key to terminate.\n"
2836 "Listening for events.\n"
2837 "IN_OPEN: /home/user/temp/foo [file]\n"
2838 "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
2839 "IN_OPEN: /tmp/ [directory]\n"
2840 "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
2841 msgstr ""
2842 "$ B<./a.out /tmp /home/user/temp>\n"
2843 "Press enter key to terminate.\n"
2844 "Listening for events.\n"
2845 "IN_OPEN: /home/user/temp/foo [file]\n"
2846 "IN_CLOSE_WRITE: /home/user/temp/foo [file]\n"
2847 "IN_OPEN: /tmp/ [directory]\n"
2848 "IN_CLOSE_NOWRITE: /tmp/ [directory]\n"
2849
2850 #. type: Plain text
2851 #: build/C/man7/inotify.7:860
2852 #, no-wrap
2853 msgid ""
2854 "#include E<lt>errno.hE<gt>\n"
2855 "#include E<lt>poll.hE<gt>\n"
2856 "#include E<lt>stdio.hE<gt>\n"
2857 "#include E<lt>stdlib.hE<gt>\n"
2858 "#include E<lt>sys/inotify.hE<gt>\n"
2859 "#include E<lt>unistd.hE<gt>\n"
2860 msgstr ""
2861 "#include E<lt>errno.hE<gt>\n"
2862 "#include E<lt>poll.hE<gt>\n"
2863 "#include E<lt>stdio.hE<gt>\n"
2864 "#include E<lt>stdlib.hE<gt>\n"
2865 "#include E<lt>sys/inotify.hE<gt>\n"
2866 "#include E<lt>unistd.hE<gt>\n"
2867
2868 #. type: Plain text
2869 #: build/C/man7/inotify.7:866
2870 #, no-wrap
2871 msgid ""
2872 "/* Read all available inotify events from the file descriptor 'fd'.\n"
2873 "   wd is the table of watch descriptors for the directories in argv.\n"
2874 "   argc is the length of wd and argv.\n"
2875 "   argv is the list of watched directories.\n"
2876 "   Entry 0 of wd and argv is unused. */\n"
2877 msgstr ""
2878 "/* Read all available inotify events from the file descriptor 'fd'.\n"
2879 "   wd is the table of watch descriptors for the directories in argv.\n"
2880 "   argc is the length of wd and argv.\n"
2881 "   argv is the list of watched directories.\n"
2882 "   Entry 0 of wd and argv is unused. */\n"
2883
2884 #. type: Plain text
2885 #: build/C/man7/inotify.7:875
2886 #, no-wrap
2887 msgid ""
2888 "static void\n"
2889 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2890 "{\n"
2891 "    /* Some systems cannot read integer variables if they are not\n"
2892 "       properly aligned. On other systems, incorrect alignment may\n"
2893 "       decrease performance. Hence, the buffer used for reading from\n"
2894 "       the inotify file descriptor should have the same alignment as\n"
2895 "       struct inotify_event. */\n"
2896 msgstr ""
2897 "static void\n"
2898 "handle_events(int fd, int *wd, int argc, char* argv[])\n"
2899 "{\n"
2900 "    /* Some systems cannot read integer variables if they are not\n"
2901 "       properly aligned. On other systems, incorrect alignment may\n"
2902 "       decrease performance. Hence, the buffer used for reading from\n"
2903 "       the inotify file descriptor should have the same alignment as\n"
2904 "       struct inotify_event. */\n"
2905
2906 #. type: Plain text
2907 #: build/C/man7/inotify.7:882
2908 #, no-wrap
2909 msgid ""
2910 "    char buf[4096]\n"
2911 "        __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2912 "    const struct inotify_event *event;\n"
2913 "    int i;\n"
2914 "    ssize_t len;\n"
2915 "    char *ptr;\n"
2916 msgstr ""
2917 "    char buf[4096]\n"
2918 "        __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
2919 "    const struct inotify_event *event;\n"
2920 "    int i;\n"
2921 "    ssize_t len;\n"
2922 "    char *ptr;\n"
2923
2924 #. type: Plain text
2925 #: build/C/man7/inotify.7:884
2926 #, no-wrap
2927 msgid "    /* Loop while events can be read from inotify file descriptor. */\n"
2928 msgstr "    /* Loop while events can be read from inotify file descriptor. */\n"
2929
2930 #. type: Plain text
2931 #: build/C/man7/inotify.7:886
2932 #, no-wrap
2933 msgid "    for (;;) {\n"
2934 msgstr "    for (;;) {\n"
2935
2936 #. type: Plain text
2937 #: build/C/man7/inotify.7:888
2938 #, no-wrap
2939 msgid "        /* Read some events. */\n"
2940 msgstr "        /* Read some events. */\n"
2941
2942 #. type: Plain text
2943 #: build/C/man7/inotify.7:894
2944 #, no-wrap
2945 msgid ""
2946 "        len = read(fd, buf, sizeof buf);\n"
2947 "        if (len == -1 && errno != EAGAIN) {\n"
2948 "            perror(\"read\");\n"
2949 "            exit(EXIT_FAILURE);\n"
2950 "        }\n"
2951 msgstr ""
2952 "        len = read(fd, buf, sizeof buf);\n"
2953 "        if (len == -1 && errno != EAGAIN) {\n"
2954 "            perror(\"read\");\n"
2955 "            exit(EXIT_FAILURE);\n"
2956 "        }\n"
2957
2958 #. type: Plain text
2959 #: build/C/man7/inotify.7:898
2960 #, no-wrap
2961 msgid ""
2962 "        /* If the nonblocking read() found no events to read, then\n"
2963 "           it returns -1 with errno set to EAGAIN. In that case,\n"
2964 "           we exit the loop. */\n"
2965 msgstr ""
2966 "        /* If the nonblocking read() found no events to read, then\n"
2967 "           it returns -1 with errno set to EAGAIN. In that case,\n"
2968 "           we exit the loop. */\n"
2969
2970 #. type: Plain text
2971 #: build/C/man7/inotify.7:906
2972 #, no-wrap
2973 msgid ""
2974 "        for (ptr = buf; ptr E<lt> buf + len;\n"
2975 "                ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2976 msgstr ""
2977 "        for (ptr = buf; ptr E<lt> buf + len;\n"
2978 "                ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
2979
2980 #. type: Plain text
2981 #: build/C/man7/inotify.7:908
2982 #, no-wrap
2983 msgid "            event = (const struct inotify_event *) ptr;\n"
2984 msgstr "            event = (const struct inotify_event *) ptr;\n"
2985
2986 #. type: Plain text
2987 #: build/C/man7/inotify.7:910
2988 #, no-wrap
2989 msgid "            /* Print event type */\n"
2990 msgstr "            /* Print event type */\n"
2991
2992 #. type: Plain text
2993 #: build/C/man7/inotify.7:917
2994 #, no-wrap
2995 msgid ""
2996 "            if (event-E<gt>mask & IN_OPEN)\n"
2997 "                printf(\"IN_OPEN: \");\n"
2998 "            if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
2999 "                printf(\"IN_CLOSE_NOWRITE: \");\n"
3000 "            if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
3001 "                printf(\"IN_CLOSE_WRITE: \");\n"
3002 msgstr ""
3003 "            if (event-E<gt>mask & IN_OPEN)\n"
3004 "                printf(\"IN_OPEN: \");\n"
3005 "            if (event-E<gt>mask & IN_CLOSE_NOWRITE)\n"
3006 "                printf(\"IN_CLOSE_NOWRITE: \");\n"
3007 "            if (event-E<gt>mask & IN_CLOSE_WRITE)\n"
3008 "                printf(\"IN_CLOSE_WRITE: \");\n"
3009
3010 #. type: Plain text
3011 #: build/C/man7/inotify.7:919
3012 #, no-wrap
3013 msgid "            /* Print the name of the watched directory */\n"
3014 msgstr "            /* Print the name of the watched directory */\n"
3015
3016 #. type: Plain text
3017 #: build/C/man7/inotify.7:926
3018 #, no-wrap
3019 msgid ""
3020 "            for (i = 1; i E<lt> argc; ++i) {\n"
3021 "                if (wd[i] == event-E<gt>wd) {\n"
3022 "                    printf(\"%s/\", argv[i]);\n"
3023 "                    break;\n"
3024 "                }\n"
3025 "            }\n"
3026 msgstr ""
3027 "            for (i = 1; i E<lt> argc; ++i) {\n"
3028 "                if (wd[i] == event-E<gt>wd) {\n"
3029 "                    printf(\"%s/\", argv[i]);\n"
3030 "                    break;\n"
3031 "                }\n"
3032 "            }\n"
3033
3034 #. type: Plain text
3035 #: build/C/man7/inotify.7:928
3036 #, no-wrap
3037 msgid "            /* Print the name of the file */\n"
3038 msgstr "            /* Print the name of the file */\n"
3039
3040 #. type: Plain text
3041 #: build/C/man7/inotify.7:931
3042 #, no-wrap
3043 msgid ""
3044 "            if (event-E<gt>len)\n"
3045 "                printf(\"%s\", event-E<gt>name);\n"
3046 msgstr ""
3047 "            if (event-E<gt>len)\n"
3048 "                printf(\"%s\", event-E<gt>name);\n"
3049
3050 #. type: Plain text
3051 #: build/C/man7/inotify.7:933
3052 #, no-wrap
3053 msgid "            /* Print type of filesystem object */\n"
3054 msgstr "            /* Print type of filesystem object */\n"
3055
3056 #. type: Plain text
3057 #: build/C/man7/inotify.7:941
3058 #, no-wrap
3059 msgid ""
3060 "            if (event-E<gt>mask & IN_ISDIR)\n"
3061 "                printf(\" [directory]\\en\");\n"
3062 "            else\n"
3063 "                printf(\" [file]\\en\");\n"
3064 "        }\n"
3065 "    }\n"
3066 "}\n"
3067 msgstr ""
3068 "            if (event-E<gt>mask & IN_ISDIR)\n"
3069 "                printf(\" [directory]\\en\");\n"
3070 "            else\n"
3071 "                printf(\" [file]\\en\");\n"
3072 "        }\n"
3073 "    }\n"
3074 "}\n"
3075
3076 #. type: Plain text
3077 #: build/C/man7/inotify.7:950
3078 #, no-wrap
3079 msgid ""
3080 "int\n"
3081 "main(int argc, char* argv[])\n"
3082 "{\n"
3083 "    char buf;\n"
3084 "    int fd, i, poll_num;\n"
3085 "    int *wd;\n"
3086 "    nfds_t nfds;\n"
3087 "    struct pollfd fds[2];\n"
3088 msgstr ""
3089 "int\n"
3090 "main(int argc, char* argv[])\n"
3091 "{\n"
3092 "    char buf;\n"
3093 "    int fd, i, poll_num;\n"
3094 "    int *wd;\n"
3095 "    nfds_t nfds;\n"
3096 "    struct pollfd fds[2];\n"
3097
3098 #. type: Plain text
3099 #: build/C/man7/inotify.7:955
3100 #, no-wrap
3101 msgid ""
3102 "    if (argc E<lt> 2) {\n"
3103 "        printf(\"Usage: %s PATH [PATH ...]\\en\", argv[0]);\n"
3104 "        exit(EXIT_FAILURE);\n"
3105 "    }\n"
3106 msgstr ""
3107 "    if (argc E<lt> 2) {\n"
3108 "        printf(\"Usage: %s PATH [PATH ...]\\en\", argv[0]);\n"
3109 "        exit(EXIT_FAILURE);\n"
3110 "    }\n"
3111
3112 #. type: Plain text
3113 #: build/C/man7/inotify.7:957
3114 #, no-wrap
3115 msgid "    printf(\"Press ENTER key to terminate.\\en\");\n"
3116 msgstr "    printf(\"Press ENTER key to terminate.\\en\");\n"
3117
3118 #. type: Plain text
3119 #: build/C/man7/inotify.7:959
3120 #, no-wrap
3121 msgid "    /* Create the file descriptor for accessing the inotify API */\n"
3122 msgstr "    /* Create the file descriptor for accessing the inotify API */\n"
3123
3124 #. type: Plain text
3125 #: build/C/man7/inotify.7:965
3126 #, no-wrap
3127 msgid ""
3128 "    fd = inotify_init1(IN_NONBLOCK);\n"
3129 "    if (fd == -1) {\n"
3130 "        perror(\"inotify_init1\");\n"
3131 "        exit(EXIT_FAILURE);\n"
3132 "    }\n"
3133 msgstr ""
3134 "    fd = inotify_init1(IN_NONBLOCK);\n"
3135 "    if (fd == -1) {\n"
3136 "        perror(\"inotify_init1\");\n"
3137 "        exit(EXIT_FAILURE);\n"
3138 "    }\n"
3139
3140 #. type: Plain text
3141 #: build/C/man7/inotify.7:967
3142 #, no-wrap
3143 msgid "    /* Allocate memory for watch descriptors */\n"
3144 msgstr "    /* Allocate memory for watch descriptors */\n"
3145
3146 #. type: Plain text
3147 #: build/C/man7/inotify.7:973
3148 #, no-wrap
3149 msgid ""
3150 "    wd = calloc(argc, sizeof(int));\n"
3151 "    if (wd == NULL) {\n"
3152 "        perror(\"calloc\");\n"
3153 "        exit(EXIT_FAILURE);\n"
3154 "    }\n"
3155 msgstr ""
3156 "    wd = calloc(argc, sizeof(int));\n"
3157 "    if (wd == NULL) {\n"
3158 "        perror(\"calloc\");\n"
3159 "        exit(EXIT_FAILURE);\n"
3160 "    }\n"
3161
3162 #. type: Plain text
3163 #: build/C/man7/inotify.7:977
3164 #, no-wrap
3165 msgid ""
3166 "    /* Mark directories for events\n"
3167 "       - file was opened\n"
3168 "       - file was closed */\n"
3169 msgstr ""
3170 "    /* Mark directories for events\n"
3171 "       - file was opened\n"
3172 "       - file was closed */\n"
3173
3174 #. type: Plain text
3175 #: build/C/man7/inotify.7:987
3176 #, no-wrap
3177 msgid ""
3178 "    for (i = 1; i E<lt> argc; i++) {\n"
3179 "        wd[i] = inotify_add_watch(fd, argv[i],\n"
3180 "                                  IN_OPEN | IN_CLOSE);\n"
3181 "        if (wd[i] == -1) {\n"
3182 "            fprintf(stderr, \"Cannot watch '%s'\\en\", argv[i]);\n"
3183 "            perror(\"inotify_add_watch\");\n"
3184 "            exit(EXIT_FAILURE);\n"
3185 "        }\n"
3186 "    }\n"
3187 msgstr ""
3188 "    for (i = 1; i E<lt> argc; i++) {\n"
3189 "        wd[i] = inotify_add_watch(fd, argv[i],\n"
3190 "                                  IN_OPEN | IN_CLOSE);\n"
3191 "        if (wd[i] == -1) {\n"
3192 "            fprintf(stderr, \"Cannot watch '%s'\\en\", argv[i]);\n"
3193 "            perror(\"inotify_add_watch\");\n"
3194 "            exit(EXIT_FAILURE);\n"
3195 "        }\n"
3196 "    }\n"
3197
3198 #. type: Plain text
3199 #: build/C/man7/inotify.7:998
3200 #, no-wrap
3201 msgid "    /* Inotify input */\n"
3202 msgstr "    /* Inotify input */\n"
3203
3204 #. type: Plain text
3205 #: build/C/man7/inotify.7:1003
3206 #, no-wrap
3207 msgid "    /* Wait for events and/or terminal input */\n"
3208 msgstr "    /* Wait for events and/or terminal input */\n"
3209
3210 #. type: Plain text
3211 #: build/C/man7/inotify.7:1013
3212 #, no-wrap
3213 msgid ""
3214 "    printf(\"Listening for events.\\en\");\n"
3215 "    while (1) {\n"
3216 "        poll_num = poll(fds, nfds, -1);\n"
3217 "        if (poll_num == -1) {\n"
3218 "            if (errno == EINTR)\n"
3219 "                continue;\n"
3220 "            perror(\"poll\");\n"
3221 "            exit(EXIT_FAILURE);\n"
3222 "        }\n"
3223 msgstr ""
3224 "    printf(\"Listening for events.\\en\");\n"
3225 "    while (1) {\n"
3226 "        poll_num = poll(fds, nfds, -1);\n"
3227 "        if (poll_num == -1) {\n"
3228 "            if (errno == EINTR)\n"
3229 "                continue;\n"
3230 "            perror(\"poll\");\n"
3231 "            exit(EXIT_FAILURE);\n"
3232 "        }\n"
3233
3234 #. type: Plain text
3235 #: build/C/man7/inotify.7:1015
3236 #, no-wrap
3237 msgid "        if (poll_num E<gt> 0) {\n"
3238 msgstr "        if (poll_num E<gt> 0) {\n"
3239
3240 #. type: Plain text
3241 #: build/C/man7/inotify.7:1017
3242 #, no-wrap
3243 msgid "            if (fds[0].revents & POLLIN) {\n"
3244 msgstr "            if (fds[0].revents & POLLIN) {\n"
3245
3246 #. type: Plain text
3247 #: build/C/man7/inotify.7:1019
3248 #, no-wrap
3249 msgid "                /* Console input is available. Empty stdin and quit */\n"
3250 msgstr "                /* Console input is available. Empty stdin and quit */\n"
3251
3252 #. type: Plain text
3253 #: build/C/man7/inotify.7:1028
3254 #, no-wrap
3255 msgid "                /* Inotify events are available */\n"
3256 msgstr "                /* Inotify events are available */\n"
3257
3258 #. type: Plain text
3259 #: build/C/man7/inotify.7:1033
3260 #, no-wrap
3261 msgid ""
3262 "                handle_events(fd, wd, argc, argv);\n"
3263 "            }\n"
3264 "        }\n"
3265 "    }\n"
3266 msgstr ""
3267 "                handle_events(fd, wd, argc, argv);\n"
3268 "            }\n"
3269 "        }\n"
3270 "    }\n"
3271
3272 #. type: Plain text
3273 #: build/C/man7/inotify.7:1035
3274 #, no-wrap
3275 msgid "    printf(\"Listening for events stopped.\\en\");\n"
3276 msgstr "    printf(\"Listening for events stopped.\\en\");\n"
3277
3278 #. type: Plain text
3279 #: build/C/man7/inotify.7:1037
3280 #, no-wrap
3281 msgid "    /* Close inotify file descriptor */\n"
3282 msgstr "    /* Close inotify file descriptor */\n"
3283
3284 #. type: Plain text
3285 #: build/C/man7/inotify.7:1039
3286 #, no-wrap
3287 msgid "    close(fd);\n"
3288 msgstr "    close(fd);\n"
3289
3290 #. type: Plain text
3291 #: build/C/man7/inotify.7:1043
3292 #, no-wrap
3293 msgid ""
3294 "    free(wd);\n"
3295 "    exit(EXIT_SUCCESS);\n"
3296 "}\n"
3297 msgstr ""
3298 "    free(wd);\n"
3299 "    exit(EXIT_SUCCESS);\n"
3300 "}\n"
3301
3302 #. type: Plain text
3303 #: build/C/man7/inotify.7:1054
3304 msgid "B<inotifywait>(1), B<inotifywatch>(1), B<inotify_add_watch>(2), B<inotify_init>(2), B<inotify_init1>(2), B<inotify_rm_watch>(2), B<read>(2), B<stat>(2), B<fanotify>(7)"
3305 msgstr "B<inotifywait>(1), B<inotifywatch>(1), B<inotify_add_watch>(2), B<inotify_init>(2), B<inotify_init1>(2), B<inotify_rm_watch>(2), B<read>(2), B<stat>(2), B<fanotify>(7)"
3306
3307 #. type: Plain text
3308 #: build/C/man7/inotify.7:1057
3309 msgid "I<Documentation/filesystems/inotify.txt> in the Linux kernel source tree"
3310 msgstr "Linux カーネルソース内の I<Documentation/filesystems/inotify.txt>"
3311
3312 #. type: TH
3313 #: build/C/man2/inotify_add_watch.2:28
3314 #, no-wrap
3315 msgid "INOTIFY_ADD_WATCH"
3316 msgstr "INOTIFY_ADD_WATCH"
3317
3318 #. type: TH
3319 #: build/C/man2/inotify_add_watch.2:28
3320 #, no-wrap
3321 msgid "2014-07-08"
3322 msgstr "2014-07-08"
3323
3324 #. type: Plain text
3325 #: build/C/man2/inotify_add_watch.2:31
3326 msgid "inotify_add_watch - add a watch to an initialized inotify instance"
3327 msgstr "inotify_add_watch - 初期化済み inotify インスタンスに監視対象を追加する"
3328
3329 #. type: Plain text
3330 #: build/C/man2/inotify_add_watch.2:33 build/C/man2/inotify_rm_watch.2:32
3331 msgid "B<#include E<lt>sys/inotify.hE<gt>>"
3332 msgstr "B<#include E<lt>sys/inotify.hE<gt>>"
3333
3334 #. type: Plain text
3335 #: build/C/man2/inotify_add_watch.2:35
3336 msgid "B<int inotify_add_watch(int >I<fd>B<, const char *>I<pathname>B<, uint32_t >I<mask>B<);>"
3337 msgstr "B<int inotify_add_watch(int >I<fd>B<, const char *>I<pathname>B<, uint32_t >I<mask>B<);>"
3338
3339 #. type: Plain text
3340 #: build/C/man2/inotify_add_watch.2:54
3341 msgid "B<inotify_add_watch>()  adds a new watch, or modifies an existing watch, for the file whose location is specified in I<pathname>; the caller must have read permission for this file.  The I<fd> argument is a file descriptor referring to the inotify instance whose watch list is to be modified.  The events to be monitored for I<pathname> are specified in the I<mask> bit-mask argument.  See B<inotify>(7)  for a description of the bits that can be set in I<mask>."
3342 msgstr "B<inotify_add_watch>()  は、 I<pathname> で指定された位置にあるファイルを監視する監視アイテム (watch) の新規追加、 または既存の監視アイテムの変更を行う。 呼び出し元は、監視対象のファイルに対する読み出し許可を 持っていなければならない。 I<fd> 引き数は、変更を行う監視対象リスト (watch list) を持つ inotify インスタンスを参照するファイルディスクリプターである。 I<pathname> のどのイベントを監視するかは、引き数のビットマスク I<mask> で指定する。 I<mask> に設定できるビットの説明については B<inotify>(7)  を参照のこと。"
3343
3344 #. type: Plain text
3345 #: build/C/man2/inotify_add_watch.2:66
3346 msgid "A successful call to B<inotify_add_watch>()  returns a unique watch descriptor for this inotify instance, for the filesystem object that corresponds to I<pathname>.  If the filesystem object was not previously being watched by this inotify instance, then the watch descriptor is newly allocated.  If the filesystem object was already being watched (perhaps via a different link to the same object), then the descriptor for the existing watch is returned."
3347 msgstr "B<inotify_add_watch>() の呼び出しが成功すると、 I<pathname> に対応するファイルシステムオブジェクトに対する、 一意な監視対象ディスクリプター (watch descriptor) を、 対象の inotify インスタンスに対して返す。 そのファイルシステムオブジェクトが対象の inotify インスタンスによって以前に監視されていない場合には、 監視対象ディスクリプターは新規に割り当てられる。 ファイルシステムオブジェクトが (おそらく同じオブジェクトに対する異なるリンク経由で) すでに監視されている場合には、 既存の監視に対するディスクリプターが返される。"
3348
3349 #. type: Plain text
3350 #: build/C/man2/inotify_add_watch.2:77
3351 msgid "The watch descriptor is returned by later B<read>(2)s from the inotify file descriptor.  These reads fetch I<inotify_event> structures (see B<inotify>(7))  indicating filesystem events; the watch descriptor inside this structure identifies the object for which the event occurred."
3352 msgstr "これ以降に inotify ファイルディスクリプターから B<read>(2)  を行うと、監視対象ディスクリプターが返される。 これらの B<read>()  を行うと、ファイルシステムイベントを示す I<inotify_event> 構造体が読み出される (B<inotify>(7)  参照)。この構造体内の監視対象ディスクリプターにより、 どのオブジェクトでそのイベントが発生したかを特定できる。"
3353
3354 #. type: Plain text
3355 #: build/C/man2/inotify_add_watch.2:84
3356 msgid "On success, B<inotify_add_watch>()  returns a nonnegative watch descriptor.  On error, -1 is returned and I<errno> is set appropriately."
3357 msgstr "成功すると、 B<inotify_add_watch>()  は非負の監視対象ディスクリプターを返す。 エラーの場合、-1 を返し、 I<errno> を適切に設定する。"
3358
3359 #. type: TP
3360 #: build/C/man2/inotify_add_watch.2:85
3361 #, no-wrap
3362 msgid "B<EACCES>"
3363 msgstr "B<EACCES>"
3364
3365 #. type: Plain text
3366 #: build/C/man2/inotify_add_watch.2:88
3367 msgid "Read access to the given file is not permitted."
3368 msgstr "指定されたファイルに対する読み出しアクセスが許可されていない。"
3369
3370 #. type: Plain text
3371 #: build/C/man2/inotify_add_watch.2:91
3372 msgid "The given file descriptor is not valid."
3373 msgstr "指定されたファイルディスクリプターが有効ではない。"
3374
3375 #. type: TP
3376 #: build/C/man2/inotify_add_watch.2:91
3377 #, no-wrap
3378 msgid "B<EFAULT>"
3379 msgstr "B<EFAULT>"
3380
3381 #. type: Plain text
3382 #: build/C/man2/inotify_add_watch.2:95
3383 msgid "I<pathname> points outside of the process's accessible address space."
3384 msgstr "I<pathname> が指すアドレスがプロセスがアクセスできるアドレス空間外である。"
3385
3386 #. type: Plain text
3387 #: build/C/man2/inotify_add_watch.2:100
3388 msgid "The given event mask contains no valid events; or I<fd> is not an inotify file descriptor."
3389 msgstr "指定されたイベントマスクに有効なイベントが含まれていない。 もしくは I<fd> が inotify ファイルディスクリプターではない。"
3390
3391 #. type: TP
3392 #: build/C/man2/inotify_add_watch.2:100
3393 #, no-wrap
3394 msgid "B<ENAMETOOLONG>"
3395 msgstr "B<ENAMETOOLONG>"
3396
3397 #. type: Plain text
3398 #: build/C/man2/inotify_add_watch.2:104
3399 msgid "I<pathname> is too long."
3400 msgstr "I<pathname> が長過ぎる。"
3401
3402 #. type: Plain text
3403 #: build/C/man2/inotify_add_watch.2:109
3404 msgid "A directory component in I<pathname> does not exist or is a dangling symbolic link."
3405 msgstr ""
3406 "I<pathname> のディレクトリ部分の構成要素が、存在しないか、\n"
3407 "リンク切れのシンボリックリンクである。"
3408
3409 #. type: Plain text
3410 #: build/C/man2/inotify_add_watch.2:112
3411 msgid "Insufficient kernel memory was available."
3412 msgstr "カーネルメモリーが十分になかった。"
3413
3414 #. type: Plain text
3415 #: build/C/man2/inotify_add_watch.2:116
3416 msgid "The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource."
3417 msgstr "inotify 監視対象の総数がユーザーが追加できる上限に達していた。 もしくは、必要な資源の割り当てにカーネルが失敗した。"
3418
3419 #. type: Plain text
3420 #: build/C/man2/inotify_add_watch.2:118 build/C/man2/inotify_rm_watch.2:69
3421 msgid "Inotify was merged into the 2.6.13 Linux kernel."
3422 msgstr "inotify は Linux カーネル 2.6.13 に組み込まれた。"
3423
3424 #. type: Plain text
3425 #: build/C/man2/inotify_add_watch.2:124
3426 msgid "B<inotify_init>(2), B<inotify_rm_watch>(2), B<inotify>(7)"
3427 msgstr "B<inotify_init>(2), B<inotify_rm_watch>(2), B<inotify>(7)"
3428
3429 #. type: TH
3430 #: build/C/man2/inotify_init.2:29
3431 #, no-wrap
3432 msgid "INOTIFY_INIT"
3433 msgstr "INOTIFY_INIT"
3434
3435 #. type: TH
3436 #: build/C/man2/inotify_init.2:29
3437 #, no-wrap
3438 msgid "2014-03-28"
3439 msgstr "2014-03-28"
3440
3441 #. type: Plain text
3442 #: build/C/man2/inotify_init.2:32
3443 msgid "inotify_init, inotify_init1 - initialize an inotify instance"
3444 msgstr "inotify_init, inotify_init1 - inotify インスタンスを初期化する"
3445
3446 #. type: Plain text
3447 #: build/C/man2/inotify_init.2:35
3448 #, no-wrap
3449 msgid "B<#include E<lt>sys/inotify.hE<gt>>\n"
3450 msgstr "B<#include E<lt>sys/inotify.hE<gt>>\n"
3451
3452 #. type: Plain text
3453 #: build/C/man2/inotify_init.2:38
3454 #, no-wrap
3455 msgid ""
3456 "B<int inotify_init(void);>\n"
3457 "B<int inotify_init1(int >I<flags>B<);>\n"
3458 msgstr ""
3459 "B<int inotify_init(void);>\n"
3460 "B<int inotify_init1(int >I<flags>B<);>\n"
3461
3462 #. type: Plain text
3463 #: build/C/man2/inotify_init.2:42
3464 msgid "For an overview of the inotify API, see B<inotify>(7)."
3465 msgstr "inotify API の概要については B<inotify>(7) を参照。"
3466
3467 #. type: Plain text
3468 #: build/C/man2/inotify_init.2:46
3469 msgid "B<inotify_init>()  initializes a new inotify instance and returns a file descriptor associated with a new inotify event queue."
3470 msgstr "B<inotify_init>()  は、新規の inotify インスタンスを初期化し、作成された inotify イベントキュー に対応するファイルディスクリプターを返す。"
3471
3472 #. type: Plain text
3473 #: build/C/man2/inotify_init.2:56
3474 msgid "If I<flags> is 0, then B<inotify_init1>()  is the same as B<inotify_init>().  The following values can be bitwise ORed in I<flags> to obtain different behavior:"
3475 msgstr "B<inotify_init1>()  は、 I<flags> が 0 の場合、 B<inotify_init>()  と同じである。 I<flags> に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作をさせることができる。"
3476
3477 #. type: TP
3478 #: build/C/man2/inotify_init.2:56
3479 #, no-wrap
3480 msgid "B<IN_NONBLOCK>"
3481 msgstr "B<IN_NONBLOCK>"
3482
3483 #. type: Plain text
3484 #: build/C/man2/inotify_init.2:64
3485 msgid "Set the B<O_NONBLOCK> file status flag on the new open file description.  Using this flag saves extra calls to B<fcntl>(2)  to achieve the same result."
3486 msgstr "新しく生成されるオープンファイル記述 (open file description) の BR O_NONBLOCK ファイルステータスフラグをセットする。 このフラグを使うことで、 B<O_NONBLOCK> をセットするために B<fcntl>(2)  を追加で呼び出す必要がなくなる。"
3487
3488 #. type: TP
3489 #: build/C/man2/inotify_init.2:64
3490 #, no-wrap
3491 msgid "B<IN_CLOEXEC>"
3492 msgstr "B<IN_CLOEXEC>"
3493
3494 #. type: Plain text
3495 #: build/C/man2/inotify_init.2:74
3496 msgid "Set the close-on-exec (B<FD_CLOEXEC>)  flag on the new file descriptor.  See the description of the B<O_CLOEXEC> flag in B<open>(2)  for reasons why this may be useful."
3497 msgstr "新しいファイルディスクリプターに対して close-on-exec (B<FD_CLOEXEC>)  フラグをセットする。 このフラグが役に立つ理由については、 B<open>(2)  の B<O_CLOEXEC> フラグの説明を参照のこと。"
3498
3499 #. type: Plain text
3500 #: build/C/man2/inotify_init.2:79
3501 msgid "On success, these system calls return a new file descriptor.  On error, -1 is returned, and I<errno> is set to indicate the error."
3502 msgstr "成功すると、これらのシステムコールは新しいファイルディスクリプターを返す。 エラーの場合、-1 を返し、 I<errno> をエラーを示す値に設定する。"
3503
3504 #. type: Plain text
3505 #: build/C/man2/inotify_init.2:85
3506 msgid "(B<inotify_init1>())  An invalid value was specified in I<flags>."
3507 msgstr "(B<inotify_init1>())  無効な値が I<flags> に指定された。"
3508
3509 #. type: Plain text
3510 #: build/C/man2/inotify_init.2:88
3511 msgid "The user limit on the total number of inotify instances has been reached."
3512 msgstr "inotify インスタンスの総数がユーザー単位の上限に達していた。"
3513
3514 #. type: Plain text
3515 #: build/C/man2/inotify_init.2:91
3516 msgid "The system limit on the total number of file descriptors has been reached."
3517 msgstr "inotify ファイルディスクリプターの総数がシステムの上限に達していた。"
3518
3519 #. type: Plain text
3520 #: build/C/man2/inotify_init.2:94
3521 msgid "Insufficient kernel memory is available."
3522 msgstr "カーネルメモリーが十分になかった。"
3523
3524 #. type: Plain text
3525 #: build/C/man2/inotify_init.2:101
3526 msgid "B<inotify_init>()  first appeared in Linux 2.6.13; library support was added to glibc in version 2.4.  B<inotify_init1>()  was added in Linux 2.6.27; library support was added to glibc in version 2.9."
3527 msgstr ""
3528 "B<inotify_init>()  は Linux 2.6.13 で初めて登場し、\n"
3529 "ライブラリによるサポートは glibc バージョン 2.4 で追加された。\n"
3530 "B<inotify_init1>()  は Linux 2.6.27 で追加され、\n"
3531 "ライブラリによるサポートは glibc バージョン 2.9 で追加された。"
3532
3533 #. type: Plain text
3534 #: build/C/man2/inotify_init.2:103
3535 msgid "These system calls are Linux-specific."
3536 msgstr "これらのシステムコールは Linux 独自である。"
3537
3538 #. type: Plain text
3539 #: build/C/man2/inotify_init.2:107
3540 msgid "B<inotify_add_watch>(2), B<inotify_rm_watch>(2), B<inotify>(7)"
3541 msgstr "B<inotify_add_watch>(2), B<inotify_rm_watch>(2), B<inotify>(7)"
3542
3543 #. type: TH
3544 #: build/C/man2/inotify_rm_watch.2:27
3545 #, no-wrap
3546 msgid "INOTIFY_RM_WATCH"
3547 msgstr "INOTIFY_RM_WATCH"
3548
3549 #. type: TH
3550 #: build/C/man2/inotify_rm_watch.2:27
3551 #, no-wrap
3552 msgid "2010-10-15"
3553 msgstr "2010-10-15"
3554
3555 #. type: Plain text
3556 #: build/C/man2/inotify_rm_watch.2:30
3557 msgid "inotify_rm_watch - remove an existing watch from an inotify instance"
3558 msgstr "inotify_rm_watch - inotify インスタンスから既存の監視アイテムを削除する"
3559
3560 #.  Before glibc 2.10, the second argument was types as uint32_t.
3561 #.  http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040
3562 #. type: Plain text
3563 #: build/C/man2/inotify_rm_watch.2:36
3564 msgid "B<int inotify_rm_watch(int >I<fd>B<, int >I<wd>B<);>"
3565 msgstr "B<int inotify_rm_watch(int >I<fd>B<, int >I<wd>B<);>"
3566
3567 #. type: Plain text
3568 #: build/C/man2/inotify_rm_watch.2:42
3569 msgid "B<inotify_rm_watch>()  removes the watch associated with the watch descriptor I<wd> from the inotify instance associated with the file descriptor I<fd>."
3570 msgstr "B<inotify_rm_watch>()  は、監視対象ディスクリプター (watch descriptor)  I<wd> に対応する監視アイテムを、 ファイルディスクリプター I<fd> に対応する inotify インスタンスから削除する。"
3571
3572 #. type: Plain text
3573 #: build/C/man2/inotify_rm_watch.2:48
3574 msgid "Removing a watch causes an B<IN_IGNORED> event to be generated for this watch descriptor.  (See B<inotify>(7).)"
3575 msgstr "監視対象を削除すると、 この監視対象ディスクリプターに対して B<IN_IGNORED> イベントが生成される (B<inotify>(7)  参照)。"
3576
3577 #. type: Plain text
3578 #: build/C/man2/inotify_rm_watch.2:55
3579 msgid "On success, B<inotify_rm_watch>()  returns zero.  On error, -1 is returned and I<errno> is set to indicate the cause of the error."
3580 msgstr "成功すると、B<inotify_rm_watch>() は 0 を返す。 エラーの場合、-1 を返し、 I<errno> をエラーの原因を示す値に設定する。"
3581
3582 #. type: Plain text
3583 #: build/C/man2/inotify_rm_watch.2:60
3584 msgid "I<fd> is not a valid file descriptor."
3585 msgstr "I<fd> が有効なファイルディスクリプターではない。"
3586
3587 #. type: Plain text
3588 #: build/C/man2/inotify_rm_watch.2:67
3589 msgid "The watch descriptor I<wd> is not valid; or I<fd> is not an inotify file descriptor."
3590 msgstr "監視対象ディスクリプター I<wd> が有効でない。もしくは、 I<fd> が inotify ファイルディスクリプターではない。"
3591
3592 #. type: Plain text
3593 #: build/C/man2/inotify_rm_watch.2:75
3594 msgid "B<inotify_add_watch>(2), B<inotify_init>(2), B<inotify>(7)"
3595 msgstr "B<inotify_add_watch>(2), B<inotify_init>(2), B<inotify>(7)"