OSDN Git Service

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