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.
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"
15 "Content-Type: text/plain; charset=UTF-8\n"
16 "Content-Transfer-Encoding: 8bit\n"
19 #: build/C/man7/inotify.7:27
25 #: build/C/man7/inotify.7:27
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
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
45 msgid "Linux Programmer's Manual"
46 msgstr "Linux Programmer's Manual"
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
58 #: build/C/man7/inotify.7:30
59 msgid "inotify - monitoring filesystem events"
60 msgstr "inotify - ファイルシステムイベントを監視する"
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
72 #: build/C/man7/inotify.7:38
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."
79 "I<inotify> API はファイルシステムイベントを監視するための機構を提供する。 "
80 "inotify は個々のファイルやディレクトリを監視するのに使える。 ディレクトリを監"
81 "視する場合、inotify はディレクトリ自身と ディレクトリ内のファイルのイベントを"
85 #: build/C/man7/inotify.7:40
86 msgid "The following system calls are used with this API:"
87 msgstr "この API では以下のシステムコールが使用される。"
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
103 #: build/C/man7/inotify.7:51
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."
110 "B<inotify_init>(2) は inotify インスタンスを作成し、inotify インスタンスを参"
111 "照する ファイルディスクリプタを返す。 より新しい B<inotify_init1>(2) も "
112 "B<inotify_init>(2) と同様だが、 こちらにはいくつかの追加の機能を利用するため"
116 #: build/C/man7/inotify.7:64
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."
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) から返される整数である。"
135 #: build/C/man7/inotify.7:70
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)."
141 "監視しているファイルやディレクトリでイベントが起こると、 それらのイベントはア"
142 "プリケーションから inotify ファイルディスクリプタから B<read>(2) を使って構造"
143 "化データとして読み出すことができる (下記参照)。"
146 #: build/C/man7/inotify.7:73
147 msgid "B<inotify_rm_watch>(2) removes an item from an inotify watch list."
149 "B<inotify_rm_watch>(2) は inotify の監視対象リストからアイテムを削除する。"
152 #: build/C/man7/inotify.7:80
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."
158 "inotify インスタンスを指している 全てのファイルディスクリプタが (B<close>(2) "
159 "を使って) クローズされた場合、 その下層にあるオブジェクトとそのリソースは、 "
160 "カーネルで再利用するために解放される。 関連が切られた監視対象は自動的に解放さ"
164 #: build/C/man7/inotify.7:89
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."
173 "注意深くプログラミングすることで、 アプリケーションは inotify を使ってファイ"
174 "ルシステムオブジェクトの集合の状態を効率的に監視しキャッシュしておくことがで"
175 "きる。 しかしながら、ロバストなアプリケーションでは、監視ロジックのバグや以下"
176 "に説明があるような種類の競合条件によりファイルシステムの状態とキャッシュが一"
177 "致しない状態になることがあるという事実も考慮に入れておくべきである。 おそらく"
178 "何らかの一貫性のチェックを行い、不一致が検出された場合にはキャッシュを再構築"
182 #: build/C/man7/inotify.7:89
184 msgid "Reading events from an inotify file descriptor"
185 msgstr "inotify ファイルディスクリプタからのイベントの読み出し"
188 #: build/C/man7/inotify.7:102
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))."
196 "どのようなイベントが起こっていたかを知るには、 アプリケーションで inotify "
197 "ファイルディスクリプタを B<read>(2) すればよい。 これまでに何もイベントが起"
198 "こっていない場合、 停止 (blocking) モードのファイルディスクリプタであれば、 "
199 "少なくとも 1 つのイベントが起こるまで B<read>(2) は停止する (シグナルにより"
200 "割り込まれなかった場合。 シグナルによる割り込みがあった場合、呼び出しはエ"
201 "ラー B<EINTR> で失敗する。 B<signal>(7) 参照)。"
204 #: build/C/man7/inotify.7:106
206 "Each successful B<read>(2) returns a buffer containing one or more of the "
207 "following structures:"
209 "B<read>(2) が成功すると、以下の構造体を 1 つ以上含むバッファが返される:"
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
216 #: build/C/man7/inotify.7:121
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"
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"
238 #: build/C/man7/inotify.7:128
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)."
243 "I<wd> はイベント発生の監視対象を指定する。 これは、前もって行われた "
244 "B<inotify_add_watch>(2) 呼び出しで返された監視対象ディスクリプタのうちの 1 "
248 #: build/C/man7/inotify.7:131
250 "I<mask> contains bits that describe the event that occurred (see below)."
252 "I<mask> には発生したイベント (下記参照) を記述するためのビットが含まれる。"
255 #: build/C/man7/inotify.7:143
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."
262 "I<cookie> は関連するイベントを関連づけるための一意な整数である。\n"
263 "現在のところ、この値は rename イベントに対してのみ使われており、\n"
264 "結果のペアである B<IN_MOVED_FROM> と B<IN_MOVED_TO> イベントを\n"
265 "アプリケーションで関連づけることができる。\n"
266 "他のイベント種別の場合には、 I<cookie> は 0 に設定する。"
269 #: build/C/man7/inotify.7:152
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 "
277 "I<name> フィールドは監視しているディレクトリ内のファイルに対して イベントが返"
278 "される場合のためにだけ存在する。 監視するディレクトリからのファイルの相対パス"
279 "名を表す。 このパス名はヌルで終端され、 その後の読み込みで適切なアドレス境界"
280 "に調整するために、 さらにヌルバイト (\\(aq\\e0\\(aq) が含まれる場合もある。"
283 #: build/C/man7/inotify.7:162
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>."
289 "I<len> フィールドはヌルバイトを含む I<name> の全てのバイト数を表す。\n"
290 "よって、 I<inotify_event> 構造体のサイズは \n"
291 "I<sizeof(struct inotify_event)+len> である。"
294 #: build/C/man7/inotify.7:173
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"
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"
308 #: build/C/man7/inotify.7:175
310 msgid " sizeof(struct inotify_event) + NAME_MAX + 1\n"
311 msgstr " sizeof(struct inotify_event) + NAME_MAX + 1\n"
314 #: build/C/man7/inotify.7:177
315 msgid "will be sufficient to read at least one event."
316 msgstr "を指定すれば、少なくとも 1 イベントで読み出しを行うには十分である。"
319 #: build/C/man7/inotify.7:177
321 msgid "inotify events"
322 msgstr "inotify イベント"
325 #: build/C/man7/inotify.7:197
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):"
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> フィールドで返される:"
340 #: build/C/man7/inotify.7:198
342 msgid "B<IN_ACCESS> (*)"
343 msgstr "B<IN_ACCESS> (*)"
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) などで) ファイルがアクセスされた。"
351 #: build/C/man7/inotify.7:203
353 msgid "B<IN_ATTRIB> (*)"
354 msgstr "B<IN_ATTRIB> (*)"
357 #: build/C/man7/inotify.7:218
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))."
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) など) などである。"
370 #: build/C/man7/inotify.7:218
372 msgid "B<IN_CLOSE_WRITE> (*)"
373 msgstr "B<IN_CLOSE_WRITE> (*)"
376 #: build/C/man7/inotify.7:221
377 msgid "File opened for writing was closed."
378 msgstr "書き込みのためにオープンされたファイルがクローズされた。"
381 #: build/C/man7/inotify.7:221
383 msgid "B<IN_CLOSE_NOWRITE> (*)"
384 msgstr "B<IN_CLOSE_NOWRITE> (*)"
387 #: build/C/man7/inotify.7:224
388 msgid "File not opened for writing was closed."
389 msgstr "書き込み以外のためにオープンされたファイルがクローズされた。"
392 #: build/C/man7/inotify.7:224
394 msgid "B<IN_CREATE> (*)"
395 msgstr "B<IN_CREATE> (*)"
398 #: build/C/man7/inotify.7:234
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)."
403 "監視対象ディレクトリ内でファイルやディレクトリが作成された (B<open>(2) "
404 "B<O_CREAT>, B<mkdir>(2), B<link>(2), B<symlink>(2), UNIX ドメインソケットに対"
408 #: build/C/man7/inotify.7:234
410 msgid "B<IN_DELETE> (*)"
411 msgstr "B<IN_DELETE> (*)"
414 #: build/C/man7/inotify.7:237
415 msgid "File/directory deleted from watched directory."
416 msgstr "監視対象ディレクトリ内でファイルやディレクトリが削除された。"
419 #: build/C/man7/inotify.7:237
421 msgid "B<IN_DELETE_SELF>"
422 msgstr "B<IN_DELETE_SELF>"
425 #: build/C/man7/inotify.7:248
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."
433 "監視対象のファイルやディレクトリ自身が削除あれた。 (このイベントはオブジェク"
434 "トが別のファイルシステムに移動された場合にも発生する。 B<mv>(1) は実際には別"
435 "のファイルシステムにファイルをコピーした後、元のファイルシステムからそのファ"
436 "イルを削除するからである。) また、 結果的に監視ディスクリプタに対して "
437 "B<IN_IGNORED> イベントも生成される。"
440 #: build/C/man7/inotify.7:248
442 msgid "B<IN_MODIFY> (*)"
443 msgstr "B<IN_MODIFY> (*)"
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) など)。"
451 #: build/C/man7/inotify.7:253
453 msgid "B<IN_MOVE_SELF>"
454 msgstr "B<IN_MOVE_SELF>"
457 #: build/C/man7/inotify.7:256
458 msgid "Watched file/directory was itself moved."
459 msgstr "監視対象のディレクトリまたはファイル自身が移動された。"
462 #: build/C/man7/inotify.7:256
464 msgid "B<IN_MOVED_FROM> (*)"
465 msgstr "B<IN_MOVED_FROM> (*)"
468 #: build/C/man7/inotify.7:260
470 "Generated for the directory containing the old filename when a file is "
473 "ファイル名の変更を行った際に変更前のファイル名が含まれるディレクトリに対して"
477 #: build/C/man7/inotify.7:260
479 msgid "B<IN_MOVED_TO> (*)"
480 msgstr "B<IN_MOVED_TO> (*)"
483 #: build/C/man7/inotify.7:264
485 "Generated for the directory containing the new filename when a file is "
488 "ファイル名の変更を行った際に新しいファイル名が含まれるディレクトリに対して生"
492 #: build/C/man7/inotify.7:264
494 msgid "B<IN_OPEN> (*)"
495 msgstr "B<IN_OPEN> (*)"
498 #: build/C/man7/inotify.7:267
499 msgid "File was opened."
500 msgstr "ファイルがオープンされた。"
503 #: build/C/man7/inotify.7:276
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 "
510 "ディレクトリを監視する場合、 上記でアスタリスク (*) を付けたイベントは、 その"
511 "ディレクトリ内のファイルに対して発生する。 このとき I<inotify_event> 構造体で"
512 "返される I<name> フィールドは、ディレクトリ内のファイル名を表す。"
515 #: build/C/man7/inotify.7:284
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)."
521 "B<IN_ALL_EVENTS> マクロは上記のイベント全てのマスクとして定義される。 このマ"
522 "クロは B<inotify_add_watch>(2) を呼び出すときの I<mask> 引き数として使える。"
525 #: build/C/man7/inotify.7:286
526 msgid "Two additional convenience macros are defined:"
527 msgstr "以下の 2 つの便利なマクロが定義されている。"
530 #: build/C/man7/inotify.7:287
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> と等価。"
541 #: build/C/man7/inotify.7:291
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> と等価。"
552 #: build/C/man7/inotify.7:301
554 "The following further bits can be specified in I<mask> when calling "
555 "B<inotify_add_watch>(2):"
557 "その他にも以下のビットを B<inotify_add_watch>(2) を呼ぶときの I<mask> に指定"
561 #: build/C/man7/inotify.7:302
563 msgid "B<IN_DONT_FOLLOW> (since Linux 2.6.15)"
564 msgstr "B<IN_DONT_FOLLOW> (Linux 2.6.15 以降)"
567 #: build/C/man7/inotify.7:307
568 msgid "Don't dereference I<pathname> if it is a symbolic link."
570 "I<pathname> がシンボリックリンクである場合に辿らない。 (Linux 2.6.15 以降)"
573 #: build/C/man7/inotify.7:307
575 msgid "B<IN_EXCL_UNLINK> (since Linux 2.6.36)"
576 msgstr "B<IN_EXCL_UNLINK> (Linux 2.6.36 以降)"
578 #. commit 8c1934c8d70b22ca8333b216aec6c7d09fdbd6a6
580 #: build/C/man7/inotify.7:323
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 "
591 "デフォルトでは、あるディレクトリの子ファイルに関するイベントを監視 (watch) し"
592 "た際、ディレクトリからその子ファイルが削除 (unlink) された場合であってもその"
593 "子ファイルに対してイベントが生成される。このことは、アプリケーションによって"
594 "はあまり興味のないイベントが大量に発生することにつながる (例えば、I</tmp> を"
595 "監視している場合、たくさんのアプリケーションが、すぐにその名前が削除される一"
596 "時ファイルをそのディレクトリに作成する)。 B<IN_EXCL_UNLINK> を指定するとこの"
597 "デフォルトの動作を変更でき、監視対象のディレクトリから子ファイルが削除された"
598 "後に子ファイルに関するイベントが生成されなくなる。"
601 #: build/C/man7/inotify.7:323
603 msgid "B<IN_MASK_ADD>"
604 msgstr "B<IN_MASK_ADD>"
607 #: build/C/man7/inotify.7:327
609 "Add (OR) events to watch mask for this pathname if it already exists "
610 "(instead of replacing mask)."
612 "I<pathname> に対する監視マスクが既に存在する場合、 (マスクの置き換えではな"
613 "く) イベントを追加 (OR) する。"
616 #: build/C/man7/inotify.7:327
618 msgid "B<IN_ONESHOT>"
619 msgstr "B<IN_ONESHOT>"
622 #: build/C/man7/inotify.7:333
623 msgid "Monitor I<pathname> for one event, then remove from watch list."
625 "1 つのイベントについて I<pathname> を監視し、 イベントが発生したら監視対象リ"
629 #: build/C/man7/inotify.7:333
631 msgid "B<IN_ONLYDIR> (since Linux 2.6.15)"
632 msgstr "B<IN_ONLYDIR> (Linux 2.6.15 以降)"
635 #: build/C/man7/inotify.7:338
636 msgid "Only watch I<pathname> if it is a directory."
637 msgstr "I<pathname> がディレクトリの場合にのみ監視する。"
640 #: build/C/man7/inotify.7:344
642 "The following bits may be set in the I<mask> field returned by B<read>(2):"
643 msgstr "以下のビットが B<read>(2) で返される I<mask> フィールドに設定される:"
646 #: build/C/man7/inotify.7:345
648 msgid "B<IN_IGNORED>"
649 msgstr "B<IN_IGNORED>"
652 #: build/C/man7/inotify.7:351
654 "Watch was removed explicitly (B<inotify_rm_watch>(2)) or automatically "
655 "(file was deleted, or filesystem was unmounted). See also BUGS."
657 "監視対象が (B<inotify_rm_watch>(2) により) 明示的に 削除された。もしくは "
658 "(ファイルの削除、またはファイル システムのアンマウントにより) 自動的に削除さ"
662 #: build/C/man7/inotify.7:351
668 #: build/C/man7/inotify.7:354
669 msgid "Subject of this event is a directory."
670 msgstr "このイベントの対象がディレクトリである。"
673 #: build/C/man7/inotify.7:354
675 msgid "B<IN_Q_OVERFLOW>"
676 msgstr "B<IN_Q_OVERFLOW>"
679 #: build/C/man7/inotify.7:359
680 msgid "Event queue overflowed (I<wd> is -1 for this event)."
681 msgstr "イベントキューが溢れた (このイベントの場合、I<wd> は -1 である)。"
684 #: build/C/man7/inotify.7:359
686 msgid "B<IN_UNMOUNT>"
687 msgstr "B<IN_UNMOUNT>"
690 #: build/C/man7/inotify.7:365
692 "Filesystem containing watched object was unmounted. In addition, an "
693 "B<IN_IGNORED> event will subsequently be generated for the watch descriptor."
695 "監視対象オブジェクトを含むファイルシステムがアンマウントされた。さらに、この"
696 "監視対象ディスクリプタに対して B<IN_IGNORED> イベントが生成される。"
699 #: build/C/man7/inotify.7:366
705 #: build/C/man7/inotify.7:374
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."
711 "アプリケーションがディレクトリ I<dir> とファイル I<dir/myfile> のすべてのイベ"
712 "ントを監視しているとする。 以下に、これらの 2 つのオブジェクトに対して生成さ"
716 #: build/C/man7/inotify.7:375
718 msgid "fd = open(\"dir/myfile\", O_RDWR);"
719 msgstr "fd = open(\"dir/myfile\", O_RDWR);"
722 #: build/C/man7/inotify.7:383
723 msgid "Generates B<IN_OPEN> events for both I<dir> and I<dir/myfile>."
725 "I<dir> と I<dir/myfile> の両方に対して B<IN_OPEN> イベントが生成される。"
728 #: build/C/man7/inotify.7:383
730 msgid "read(fd, buf, count);"
731 msgstr "read(fd, buf, count);"
734 #: build/C/man7/inotify.7:391
735 msgid "Generates B<IN_ACCESS> events for both I<dir> and I<dir/myfile>."
737 "I<dir> と I<dir/myfile> の両方に対して B<IN_ACCESS> イベントが生成される"
740 #: build/C/man7/inotify.7:391
742 msgid "write(fd, buf, count);"
743 msgstr "write(fd, buf, count);"
746 #: build/C/man7/inotify.7:399
747 msgid "Generates B<IN_MODIFY> events for both I<dir> and I<dir/myfile>."
749 "I<dir> と I<dir/myfile> の両方に対して B<IN_MODIFY> イベントが生成される"
752 #: build/C/man7/inotify.7:399
754 msgid "fchmod(fd, mode);"
755 msgstr "fchmod(fd, mode);"
758 #: build/C/man7/inotify.7:407
759 msgid "Generates B<IN_ATTRIB> events for both I<dir> and I<dir/myfile>."
761 "I<dir> と I<dir/myfile> の両方に対して B<IN_ATTRIB> イベントが生成される"
764 #: build/C/man7/inotify.7:407
770 #: build/C/man7/inotify.7:415
771 msgid "Generates B<IN_CLOSE_WRITE> events for both I<dir> and I<dir/myfile>."
773 "I<dir> と I<dir/myfile> の両方に対して B<IN_CLOSE_WRITE> イベントが生成される"
776 #: build/C/man7/inotify.7:424
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 "
782 "アプリケーションがディレクトリ I<dir1> と I<dir2>、およびファイル I<dir1/"
783 "myfile> を監視しているとする。 以下に生成されるイベントの例を示す。"
786 #: build/C/man7/inotify.7:425
788 msgid "link(\"dir1/myfile\", \"dir2/new\");"
789 msgstr "link(\"dir1/myfile\", \"dir2/new\");"
792 #: build/C/man7/inotify.7:435
794 "Generates an B<IN_ATTRIB> event for I<myfile> and an B<IN_CREATE> event for "
797 "I<myfile> に対して B<IN_ATTRIB> イベントが生成され、 I<dir2> に対して "
798 "B<IN_CREATE> イベントが生成される。"
801 #: build/C/man7/inotify.7:435
803 msgid "rename(\"dir1/myfile\", \"dir2/myfile\");"
804 msgstr "rename(\"dir1/myfile\", \"dir2/myfile\");"
807 #: build/C/man7/inotify.7:456
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."
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> 値を持"
819 #: build/C/man7/inotify.7:470
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:"
826 "I<dir1/xx> と I<dir2/yy> は同じファイルを参照するリンクで (他のリンクはないも"
827 "のとする)、 アプリケーションは I<dir1>, I<dir2>, I<dir1/xx>, I<dir2/yy> を監"
828 "視しているものとする。 以下に示す順序で下記の呼び出しを実行すると、以下のイベ"
832 #: build/C/man7/inotify.7:471
834 msgid "unlink(\"dir2/yy\");"
835 msgstr "unlink(\"dir2/yy\");"
838 #: build/C/man7/inotify.7:482
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>."
843 "I<xx> に対して B<IN_ATTRIB> イベントが生成され (リンク数が変化したため)、 "
844 "I<dir2> に対して B<IN_DELETE> イベントが生成される。"
847 #: build/C/man7/inotify.7:482
849 msgid "unlink(\"dir1/xx\");"
850 msgstr "unlink(\"dir1/xx\");"
853 #: build/C/man7/inotify.7:495
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>."
858 "I<xx> に対してイベント B<IN_ATTRIB>, B<IN_DELETE_SELF>, B<IN_IGNORED> が生成"
859 "され、 I<dir1> に対して B<IN_DELETE> イベントが生成される。"
862 #: build/C/man7/inotify.7:502
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 "
868 "アプリケーションがディレクトリ I<dir> と (空の) ディレクトリ I<dir/subdir> を"
869 "監視しているものとする。 以下に生成されるイベントの例を示す。"
872 #: build/C/man7/inotify.7:503
874 msgid "mkdir(\"dir/new\", mode);"
875 msgstr "mkdir(\"dir/new\", mode);"
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> イベントが生成される。"
883 #: build/C/man7/inotify.7:509
885 msgid "rmdir(\"dir/subdir\");"
886 msgstr "rmdir(\"dir/subdir\");"
889 #: build/C/man7/inotify.7:521
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>."
894 "I<subdir> に対してイベント B<IN_DELETE_SELF> と B<IN_IGNORED> が生成され、 "
895 "I<dir> に対して B<IN_DELETE | IN_ISDIR> イベントが生成される。"
898 #: build/C/man7/inotify.7:522
900 msgid "/proc interfaces"
901 msgstr "/proc インターフェース"
904 #: build/C/man7/inotify.7:525
906 "The following interfaces can be used to limit the amount of kernel memory "
907 "consumed by inotify:"
909 "以下のインターフェースは、inotify で消費される カーネルメモリの総量を制限する"
913 #: build/C/man7/inotify.7:525
915 msgid "I</proc/sys/fs/inotify/max_queued_events>"
916 msgstr "I</proc/sys/fs/inotify/max_queued_events>"
919 #: build/C/man7/inotify.7:534
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."
926 "このファイルの値は、アプリケーションが B<inotify_init>(2) を呼び出すときに使"
927 "用され、対応する inotify インスタンスについて キューに入れられるイベントの数"
928 "の上限を設定する。 この制限を超えたイベントは破棄されるが、 B<IN_Q_OVERFLOW> "
932 #: build/C/man7/inotify.7:534
934 msgid "I</proc/sys/fs/inotify/max_user_instances>"
935 msgstr "I</proc/sys/fs/inotify/max_user_instances>"
938 #: build/C/man7/inotify.7:538
940 "This specifies an upper limit on the number of inotify instances that can be "
941 "created per real user ID."
943 "1 つの実ユーザ ID に対して生成できる inotify インスタンスの数の上限を指定す"
947 #: build/C/man7/inotify.7:538
949 msgid "I</proc/sys/fs/inotify/max_user_watches>"
950 msgstr "I</proc/sys/fs/inotify/max_user_watches>"
953 #: build/C/man7/inotify.7:542
955 "This specifies an upper limit on the number of watches that can be created "
957 msgstr "作成可能な監視対象の数の実 UID 単位の上限を指定する。"
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
969 #: build/C/man7/inotify.7:550
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.)"
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 で追加された)。"
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
985 msgid "CONFORMING TO"
989 #: build/C/man7/inotify.7:552
990 msgid "The inotify API is Linux-specific."
991 msgstr "inotify API は Linux 独自のものである。"
994 #: build/C/man7/inotify.7:552 build/C/man7/fanotify.7:452
1000 #: build/C/man7/inotify.7:559
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 "
1006 "inotify ファイルディスクリプタは B<select>(2), B<poll>(2), B<epoll>(7) を"
1007 "使って監視できる。 イベントがある場合、ファイルディスクリプタは読み込み可能と"
1011 #: build/C/man7/inotify.7:588
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>."
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> が設定され"
1031 #: build/C/man7/inotify.7:601
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."
1040 "inotify ファイルディスクリプタに対して 連続して生成される出力 inotify イベン"
1041 "トが同一の場合 (I<wd>, I<mask>, I<cookie>, I<name> が等しい場合)、 前のイベン"
1042 "トがまだ読み込まれていなければ、 連続するイベントが 1 つのイベントにまとめら"
1043 "れる (ただし「バグ」の節も参照のこと)。 これによりイベントキューに必要なカー"
1044 "ネルメモリ量が減るが、 これはまたアプリケーションがファイルイベント数を信頼性"
1045 "を持って数えるのに inotify を使用できないということでもある。"
1048 #: build/C/man7/inotify.7:607
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."
1055 "inotify ファイルディスクリプタの読み込みで返されるイベントは、 順序付けられた"
1056 "キューになる。 従って、たとえば、あるディレクトリの名前を別の名前に変更した場"
1057 "合、 inotify ファイルディスクリプタについての正しい順番で イベントが生成され"
1061 #: build/C/man7/inotify.7:613
1063 "The B<FIONREAD> B<ioctl>(2) returns the number of bytes available to read "
1064 "from an inotify file descriptor."
1066 "B<FIONREAD> B<ioctl>(2) は inotify ファイルディスクリプタから何バイト読み込"
1070 #: build/C/man7/inotify.7:613 build/C/man7/fanotify.7:459
1072 msgid "Limitations and caveats"
1076 #: build/C/man7/inotify.7:620
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."
1083 "inotify API では、inotify イベントが発生するきっかけとなったユーザやプロセス"
1084 "に関する情報は提供されない。とりわけ、inotify 経由でイベントを監視しているプ"
1085 "ロセスが、自分自身がきっかけとなったイベントと他のプロセスがきっかけとなった"
1086 "イベントを区別する簡単な手段はない。"
1089 #: build/C/man7/inotify.7:633
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."
1097 "inotify は、ファイルシステム API 経由でユーザー空間プログラムがきっかけとなっ"
1098 "たイベントだけを報告する。 結果として、 inotify はネットワークファイルシステ"
1099 "ムで発生したリモートのイベントを捉えることはできない (このようなイベントを捉"
1100 "えるにはアプリケーションはファイルシステムをポーリングする必要がある)。 さら"
1101 "に、 I</proc>, I</sys>, I</dev/pts> といったいくつかの疑似ファイルシステムは "
1102 "inotify で監視することができない。"
1105 #: build/C/man7/inotify.7:640
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) により起こったファイルのアクセスと変更を報告しない。"
1112 #: build/C/man7/inotify.7:644
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."
1118 "inotify API では影響が受けるファイルをファイル名で特定する。\n"
1119 "しかしながら、アプリケーションが inotify イベントを処理する時点では、\n"
1120 "そのファイル名がすでに削除されたり変更されたりしている可能性がある。"
1123 #: build/C/man7/inotify.7:649
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."
1130 "inotify API では監視対象ディスクリプタを通してイベントが区別される。 (必要で"
1131 "あれば) 監視対象ディスクリプタとパス名のマッピングをキャッシュしておくのはア"
1132 "プリケーションの役目である。 ディレクトリの名前変更の場合、キャッシュしている"
1133 "複数のパス名に影響がある点に注意すること。"
1136 #: build/C/man7/inotify.7:654
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."
1142 "inotify によるディレクトリの監視は再帰的に行われない: あるディレクトリ以下"
1144 "サブディレクトリを監視する場合、 監視対象を追加で作成しなければならない。\n"
1145 "大きなディレクトリツリーの場合には、この作業にかなり時間がかかることがある。"
1148 #: build/C/man7/inotify.7:663
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)."
1158 "ディレクトリツリー全体を監視していて、 そのツリー内に新しいサブディレクトリが"
1159 "作成されるか、 既存のディレクトリが名前が変更されそのツリー内に移動した場"
1160 "合、 新しいサブディレクトリに対する watch を作成するまでに、 新しいファイル "
1161 "(やサブディレクトリ) がそのサブディレクトリ内にすでに作成されている場合がある"
1162 "点に注意すること。 したがって、watch を追加した直後にサブディレクトリの内容を"
1163 "スキャンしたいと思う場合もあるだろう (必要ならそのサブディレクトリ内のサブ"
1164 "ディレクトリに対する watch も再帰的に追加することもあるだろう)。"
1167 #: build/C/man7/inotify.7:675
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.)"
1177 "イベントキューはオーバーフローする場合があることに注意すること。 この場合、イ"
1178 "ベントは失なわれる。 ロバスト性が求められるアプリケーションでは、 イベントが"
1179 "失なわれる可能性も含めて適切に処理を行うべきである。 例えば、アプリケーション"
1180 "内のキャッシュの一部分または全てを再構築する必要があるかもしれない。 (単純だ"
1181 "が、おそらくコストがかかる方法は、 inotify ファイルディスクリプタをクローズ"
1182 "し、 キャッシュを空にし、 新しい inotify ファイルディスクリプタを作成し、 監"
1183 "視しているオブジェクトの監視対象ディスクリプタとキャッシュエントリーの再作成"
1187 #: build/C/man7/inotify.7:675
1189 msgid "Dealing with rename() events"
1190 msgstr "rename() イベントの取り扱い"
1193 #: build/C/man7/inotify.7:684
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."
1199 "上述の通り、 B<rename>(2) により生成される B<IN_MOVED_FROM> と "
1200 "B<IN_MOVED_TO> イベントの組は、共有される cookie 値によって対応を取ることがで"
1201 "きる。 しかし、対応を取る場合にはいくつか難しい点がある。"
1204 #: build/C/man7/inotify.7:695
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."
1212 "これらの 2 つのイベントは、 inotify ファイルディスクリプタから読み出しを行っ"
1213 "た場合に、通常はイベントストリーム内で連続している。 しかしながら、連続してい"
1214 "ることは保証されていない。 複数のプロセスが監視対象オブジェクトでイベントを発"
1215 "生させた場合、 (めったに起こらないことだが) イベント B<IN_MOVED_FROM> と "
1216 "B<IN_MOVED_TO> の間に任意の数の他のイベントがはさまる可能性がある。"
1219 #: build/C/man7/inotify.7:720
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.)"
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 "クリプタの再作成とキャッシュの再構成はこの状況に対処するのに有用な方法なのだ"
1247 #: build/C/man7/inotify.7:730
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)."
1254 "また、アプリケーションは、 B<IN_MOVED_FROM> イベントが今行った B<read>(2) の"
1255 "呼び出しで返されたバッファのちょうど一番最後のイベントで、 B<IN_MOVED_TO> イ"
1256 "ベントは次の B<read>(2) を行わないと取得できない可能性も考慮に入れる必要があ"
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
1266 #. FIXME kernel commit 611da04f7a31b2208e838be55a42c7a1310ae321
1267 #. implies that unmount events were buggy 2.6.11 to 2.6.36
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> フラグが働かない。"
1274 #: build/C/man7/inotify.7:748
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."
1281 "元々は設計/実装時の意図通り、 イベントが一つ発生し watch が削除された際に "
1282 "B<IN_ONESHOT> フラグでは B<IN_IGNORED> イベントが発生しなかった。 しかし、 別"
1283 "の変更での意図していなかった影響により、 Linux 2.6.36 以降では、 この場合に "
1284 "B<IN_IGNORED> イベントが生成される。"
1286 #. commit 1c17d18e3775485bf1e0ce79575eb637a94494a2
1288 #: build/C/man7/inotify.7:757
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> "
1296 "カーネル 2.6.25 より前では、 連続する同一のイベントを一つにまとめることを意図"
1297 "したコード (古い方のイベントがまだ読み込まれていない場合に、 最新の 2 つのイ"
1298 "ベントを一つにまとめられる可能性がある) が、 最新のイベントが「最も古い」読み"
1299 "込まれていないイベントとまとめられるか をチェックするようになっていた。"
1302 #: build/C/man7/inotify.7:757 build/C/man7/fanotify.7:509
1308 #: build/C/man7/inotify.7:765
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> のイベントを待つ。"
1316 #: build/C/man7/inotify.7:780
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 キーを押すると、プログラムの実行は終了する。"
1327 #: build/C/man7/inotify.7:780 build/C/man7/fanotify.7:529
1329 msgid "Example output"
1333 #: build/C/man7/inotify.7:790
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"
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"
1353 #: build/C/man7/inotify.7:792 build/C/man7/fanotify.7:539
1355 msgid "Listening for events stopped.\n"
1356 msgstr "Listening for events stopped.\n"
1359 #: build/C/man7/inotify.7:794 build/C/man7/fanotify.7:541
1361 msgid "Program source"
1365 #: build/C/man7/inotify.7:802
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"
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"
1383 #: build/C/man7/inotify.7:808
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"
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"
1399 #: build/C/man7/inotify.7:817
1403 "handle_events(int fd, int *wd, int argc, char* argv[])\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"
1412 "handle_events(int fd, int *wd, int argc, char* argv[])\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"
1421 #: build/C/man7/inotify.7:824
1425 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
1426 " const struct inotify_event *event;\n"
1432 " __attribute__ ((aligned(__alignof__(struct inotify_event))));\n"
1433 " const struct inotify_event *event;\n"
1439 #: build/C/man7/inotify.7:826
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"
1445 #: build/C/man7/inotify.7:828
1447 msgid " for (;;) {\n"
1448 msgstr " for (;;) {\n"
1451 #: build/C/man7/inotify.7:830
1453 msgid " /* Read some events. */\n"
1454 msgstr " /* Read some events. */\n"
1457 #: build/C/man7/inotify.7:836
1460 " len = read(fd, buf, sizeof buf);\n"
1461 " if (len == -1 && errno != EAGAIN) {\n"
1462 " perror(\"read\");\n"
1463 " exit(EXIT_FAILURE);\n"
1466 " len = read(fd, buf, sizeof buf);\n"
1467 " if (len == -1 && errno != EAGAIN) {\n"
1468 " perror(\"read\");\n"
1469 " exit(EXIT_FAILURE);\n"
1473 #: build/C/man7/inotify.7:840
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"
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"
1485 #: build/C/man7/inotify.7:843 build/C/man7/fanotify.7:582
1488 " if (len E<lt>= 0)\n"
1491 " if (len E<lt>= 0)\n"
1495 #: build/C/man7/inotify.7:845 build/C/man7/fanotify.7:588
1497 msgid " /* Loop over all events in the buffer */\n"
1498 msgstr " /* Loop over all events in the buffer */\n"
1501 #: build/C/man7/inotify.7:848
1504 " for (ptr = buf; ptr E<lt> buf + len;\n"
1505 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
1507 " for (ptr = buf; ptr E<lt> buf + len;\n"
1508 " ptr += sizeof(struct inotify_event) + event-E<gt>len) {\n"
1511 #: build/C/man7/inotify.7:850
1513 msgid " event = (const struct inotify_event *) ptr;\n"
1514 msgstr " event = (const struct inotify_event *) ptr;\n"
1517 #: build/C/man7/inotify.7:852
1519 msgid " /* Print event type */\n"
1520 msgstr " /* Print event type */\n"
1523 #: build/C/man7/inotify.7:859
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"
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"
1541 #: build/C/man7/inotify.7:861
1543 msgid " /* Print the name of the watched directory */\n"
1544 msgstr " /* Print the name of the watched directory */\n"
1547 #: build/C/man7/inotify.7:868
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"
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"
1565 #: build/C/man7/inotify.7:870
1567 msgid " /* Print the name of the file */\n"
1568 msgstr " /* Print the name of the file */\n"
1571 #: build/C/man7/inotify.7:873
1574 " if (event-E<gt>len)\n"
1575 " printf(\"%s\", event-E<gt>name);\n"
1577 " if (event-E<gt>len)\n"
1578 " printf(\"%s\", event-E<gt>name);\n"
1581 #: build/C/man7/inotify.7:875
1583 msgid " /* Print type of filesystem object */\n"
1584 msgstr " /* Print type of filesystem object */\n"
1587 #: build/C/man7/inotify.7:883
1590 " if (event-E<gt>mask & IN_ISDIR)\n"
1591 " printf(\" [directory]\\en\");\n"
1593 " printf(\" [file]\\en\");\n"
1598 " if (event-E<gt>mask & IN_ISDIR)\n"
1599 " printf(\" [directory]\\en\");\n"
1601 " printf(\" [file]\\en\");\n"
1607 #: build/C/man7/inotify.7:892
1611 "main(int argc, char* argv[])\n"
1614 " int fd, i, poll_num;\n"
1617 " struct pollfd fds[2];\n"
1620 "main(int argc, char* argv[])\n"
1623 " int fd, i, poll_num;\n"
1626 " struct pollfd fds[2];\n"
1629 #: build/C/man7/inotify.7:897
1632 " if (argc E<lt> 2) {\n"
1633 " printf(\"Usage: %s PATH [PATH ...]\\en\", argv[0]);\n"
1634 " exit(EXIT_FAILURE);\n"
1637 " if (argc E<lt> 2) {\n"
1638 " printf(\"Usage: %s PATH [PATH ...]\\en\", argv[0]);\n"
1639 " exit(EXIT_FAILURE);\n"
1643 #: build/C/man7/inotify.7:899
1645 msgid " printf(\"Press ENTER key to terminate.\\en\");\n"
1646 msgstr " printf(\"Press ENTER key to terminate.\\en\");\n"
1649 #: build/C/man7/inotify.7:901
1651 msgid " /* Create the file descriptor for accessing the inotify API */\n"
1652 msgstr " /* Create the file descriptor for accessing the inotify API */\n"
1655 #: build/C/man7/inotify.7:907
1658 " fd = inotify_init1(IN_NONBLOCK);\n"
1659 " if (fd == -1) {\n"
1660 " perror(\"inotify_init1\");\n"
1661 " exit(EXIT_FAILURE);\n"
1664 " fd = inotify_init1(IN_NONBLOCK);\n"
1665 " if (fd == -1) {\n"
1666 " perror(\"inotify_init1\");\n"
1667 " exit(EXIT_FAILURE);\n"
1671 #: build/C/man7/inotify.7:909
1673 msgid " /* Allocate memory for watch descriptors */\n"
1674 msgstr " /* Allocate memory for watch descriptors */\n"
1677 #: build/C/man7/inotify.7:915
1680 " wd = calloc(argc, sizeof(int));\n"
1681 " if (wd == NULL) {\n"
1682 " perror(\"calloc\");\n"
1683 " exit(EXIT_FAILURE);\n"
1686 " wd = calloc(argc, sizeof(int));\n"
1687 " if (wd == NULL) {\n"
1688 " perror(\"calloc\");\n"
1689 " exit(EXIT_FAILURE);\n"
1693 #: build/C/man7/inotify.7:919
1696 " /* Mark directories for events\n"
1697 " - file was opened\n"
1698 " - file was closed */\n"
1700 " /* Mark directories for events\n"
1701 " - file was opened\n"
1702 " - file was closed */\n"
1705 #: build/C/man7/inotify.7:929
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"
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"
1729 #: build/C/man7/inotify.7:931 build/C/man7/fanotify.7:688
1731 msgid " /* Prepare for polling */\n"
1732 msgstr " /* Prepare for polling */\n"
1735 #: build/C/man7/inotify.7:933 build/C/man7/fanotify.7:690
1737 msgid " nfds = 2;\n"
1738 msgstr " nfds = 2;\n"
1741 #: build/C/man7/inotify.7:935 build/C/man7/fanotify.7:692
1743 msgid " /* Console input */\n"
1744 msgstr " /* Console input */\n"
1747 #: build/C/man7/inotify.7:938 build/C/man7/fanotify.7:695
1750 " fds[0].fd = STDIN_FILENO;\n"
1751 " fds[0].events = POLLIN;\n"
1753 " fds[0].fd = STDIN_FILENO;\n"
1754 " fds[0].events = POLLIN;\n"
1757 #: build/C/man7/inotify.7:940
1759 msgid " /* Inotify input */\n"
1760 msgstr " /* Inotify input */\n"
1763 #: build/C/man7/inotify.7:943 build/C/man7/fanotify.7:700
1766 " fds[1].fd = fd;\n"
1767 " fds[1].events = POLLIN;\n"
1769 " fds[1].fd = fd;\n"
1770 " fds[1].events = POLLIN;\n"
1773 #: build/C/man7/inotify.7:945
1775 msgid " /* Wait for events and/or terminal input */\n"
1776 msgstr " /* Wait for events and/or terminal input */\n"
1779 #: build/C/man7/inotify.7:955
1782 " printf(\"Listening for events.\\en\");\n"
1784 " poll_num = poll(fds, nfds, -1);\n"
1785 " if (poll_num == -1) {\n"
1786 " if (errno == EINTR)\n"
1788 " perror(\"poll\");\n"
1789 " exit(EXIT_FAILURE);\n"
1792 " printf(\"Listening for events.\\en\");\n"
1794 " poll_num = poll(fds, nfds, -1);\n"
1795 " if (poll_num == -1) {\n"
1796 " if (errno == EINTR)\n"
1798 " perror(\"poll\");\n"
1799 " exit(EXIT_FAILURE);\n"
1803 #: build/C/man7/inotify.7:957
1805 msgid " if (poll_num E<gt> 0) {\n"
1806 msgstr " if (poll_num E<gt> 0) {\n"
1809 #: build/C/man7/inotify.7:959
1811 msgid " if (fds[0].revents & POLLIN) {\n"
1812 msgstr " if (fds[0].revents & POLLIN) {\n"
1815 #: build/C/man7/inotify.7:961
1817 msgid " /* Console input is available. Empty stdin and quit */\n"
1818 msgstr " /* Console input is available. Empty stdin and quit */\n"
1821 #: build/C/man7/inotify.7:966 build/C/man7/fanotify.7:724
1824 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != '\\en')\n"
1829 " while (read(STDIN_FILENO, &buf, 1) E<gt> 0 && buf != '\\en')\n"
1835 #: build/C/man7/inotify.7:968 build/C/man7/fanotify.7:726
1837 msgid " if (fds[1].revents & POLLIN) {\n"
1838 msgstr " if (fds[1].revents & POLLIN) {\n"
1841 #: build/C/man7/inotify.7:970
1843 msgid " /* Inotify events are available */\n"
1844 msgstr " /* Inotify events are available */\n"
1847 #: build/C/man7/inotify.7:975
1850 " handle_events(fd, wd, argc, argv);\n"
1855 " handle_events(fd, wd, argc, argv);\n"
1861 #: build/C/man7/inotify.7:977
1863 msgid " printf(\"Listening for events stopped.\\en\");\n"
1864 msgstr " printf(\"Listening for events stopped.\\en\");\n"
1867 #: build/C/man7/inotify.7:979
1869 msgid " /* Close inotify file descriptor */\n"
1870 msgstr " /* Close inotify file descriptor */\n"
1873 #: build/C/man7/inotify.7:981
1875 msgid " close(fd);\n"
1876 msgstr " close(fd);\n"
1879 #: build/C/man7/inotify.7:985
1883 " exit(EXIT_SUCCESS);\n"
1887 " exit(EXIT_SUCCESS);\n"
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
1900 #: build/C/man7/inotify.7:996
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)"
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)"
1911 #: build/C/man7/inotify.7:999
1913 "I<Documentation/filesystems/inotify.txt> in the Linux kernel source tree"
1914 msgstr "Linux カーネルソース内の I<Documentation/filesystems/inotify.txt>"
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
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
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-"
1936 "この man ページは Linux I<man-pages> プロジェクトのリリース 3.68 の一部\n"
1937 "である。プロジェクトの説明とバグ報告に関する情報は\n"
1938 "http://www.kernel.org/doc/man-pages/ に書かれている。"
1941 #: build/C/man2/inotify_add_watch.2:28
1943 msgid "INOTIFY_ADD_WATCH"
1944 msgstr "INOTIFY_ADD_WATCH"
1947 #: build/C/man2/inotify_add_watch.2:28 build/C/man2/inotify_init.2:29
1953 #: build/C/man2/inotify_add_watch.2:31
1954 msgid "inotify_add_watch - add a watch to an initialized inotify instance"
1956 "inotify_add_watch - 初期化済み inotify インスタンスに監視対象を追加する"
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
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>>"
1972 #: build/C/man2/inotify_add_watch.2:35
1974 "B<int inotify_add_watch(int >I<fd>B<, const char *>I<pathname>B<, uint32_t "
1977 "B<int inotify_add_watch(int >I<fd>B<, const char *>I<pathname>B<, uint32_t "
1981 #: build/C/man2/inotify_add_watch.2:54
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 "
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) を参照のこと。"
2000 #: build/C/man2/inotify_add_watch.2:68
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."
2008 "B<inotify_add_watch>() の呼び出しが成功すると、変更対象の inotify インスタン"
2009 "スで I<pathname> に対応付けられる一意な監視対象ディスクリプタ (watch "
2010 "descriptor) を返す。 I<pathname> がその inotify インスタンスに追加されていな"
2011 "ければ、 監視対象ディスクリプタが新規に割り当てられる。 I<pathname> がすでに"
2012 "監視対象になっていれば、既存の監視アイテムに対する ディスクリプタが返される。"
2015 #: build/C/man2/inotify_add_watch.2:79
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."
2022 "これ以降に inotify ファイルディスクリプタから B<read>(2) を行うと、監視対象"
2023 "ディスクリプタが返される。 これらの B<read>() を行うと、ファイルシステムイベ"
2024 "ントを示す I<inotify_event> 構造体が読み出される (B<inotify>(7) 参照)。この"
2025 "構造体内の監視対象ディスクリプタにより、 どのオブジェクトでそのイベントが発生"
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
2033 msgid "RETURN VALUE"
2037 #: build/C/man2/inotify_add_watch.2:86
2039 "On success, B<inotify_add_watch>() returns a nonnegative watch descriptor. "
2040 "On error, -1 is returned and I<errno> is set appropriately."
2042 "成功すると、 B<inotify_add_watch>() は非負の監視対象ディスクリプタを返す。 "
2043 "エラーの場合、-1 を返し、 I<errno> を適切に設定する。"
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
2054 #: build/C/man2/inotify_add_watch.2:87
2060 #: build/C/man2/inotify_add_watch.2:90
2061 msgid "Read access to the given file is not permitted."
2062 msgstr "指定されたファイルに対する読み出しアクセスが許可されていない。"
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
2072 #: build/C/man2/inotify_add_watch.2:93
2073 msgid "The given file descriptor is not valid."
2074 msgstr "指定されたファイルディスクリプタが有効ではない。"
2077 #: build/C/man2/inotify_add_watch.2:93
2083 #: build/C/man2/inotify_add_watch.2:97
2084 msgid "I<pathname> points outside of the process's accessible address space."
2086 "I<pathname> が指すアドレスがプロセスがアクセスできるアドレス空間外である。"
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
2098 #: build/C/man2/inotify_add_watch.2:102
2100 "The given event mask contains no valid events; or I<fd> is not an inotify "
2103 "指定されたイベントマスクに有効なイベントが含まれていない。 もしくは I<fd> が "
2104 "inotify ファイルディスクリプタではない。"
2107 #: build/C/man2/inotify_add_watch.2:102
2109 msgid "B<ENAMETOOLONG>"
2110 msgstr "B<ENAMETOOLONG>"
2113 #: build/C/man2/inotify_add_watch.2:106
2114 msgid "I<pathname> is too long."
2115 msgstr "I<pathname> が長過ぎる。"
2118 #: build/C/man2/inotify_add_watch.2:106 build/C/man2/fanotify_mark.2:265
2119 #: build/C/man7/fanotify.7:439
2125 #: build/C/man2/inotify_add_watch.2:111
2127 "A directory component in I<pathname> does not exist or is a dangling "
2130 "I<pathname> のディレクトリ部分の構成要素が、存在しないか、\n"
2131 "リンク切れのシンボリックリンクである。"
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
2141 #: build/C/man2/inotify_add_watch.2:114
2142 msgid "Insufficient kernel memory was available."
2143 msgstr "カーネルメモリが十分になかった。"
2146 #: build/C/man2/inotify_add_watch.2:114 build/C/man2/fanotify_mark.2:277
2152 #: build/C/man2/inotify_add_watch.2:118
2154 "The user limit on the total number of inotify watches was reached or the "
2155 "kernel failed to allocate a needed resource."
2157 "inotify 監視対象の総数がユーザが追加できる上限に達していた。 もしくは、必要な"
2158 "資源の割り当てにカーネルが失敗した。"
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 に組み込まれた。"
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 独自である。"
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)"
2177 #: build/C/man2/inotify_init.2:29
2179 msgid "INOTIFY_INIT"
2180 msgstr "INOTIFY_INIT"
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 インスタンスを初期化する"
2188 #: build/C/man2/inotify_init.2:35
2190 msgid "B<#include E<lt>sys/inotify.hE<gt>>\n"
2191 msgstr "B<#include E<lt>sys/inotify.hE<gt>>\n"
2194 #: build/C/man2/inotify_init.2:38
2197 "B<int inotify_init(void);>\n"
2198 "B<int inotify_init1(int >I<flags>B<);>\n"
2200 "B<int inotify_init(void);>\n"
2201 "B<int inotify_init1(int >I<flags>B<);>\n"
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) を参照。"
2209 #: build/C/man2/inotify_init.2:46
2211 "B<inotify_init>() initializes a new inotify instance and returns a file "
2212 "descriptor associated with a new inotify event queue."
2214 "B<inotify_init>() は、新規の inotify インスタンスを初期化し、作成された "
2215 "inotify イベントキュー に対応するファイルディスクリプタを返す。"
2218 #: build/C/man2/inotify_init.2:56
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:"
2224 "B<inotify_init1>() は、 I<flags> が 0 の場合、 B<inotify_init>() と同じであ"
2225 "る。 I<flags> に以下の値をビット毎の論理和 (OR) で指定することで、 異なる動作"
2229 #: build/C/man2/inotify_init.2:56
2231 msgid "B<IN_NONBLOCK>"
2232 msgstr "B<IN_NONBLOCK>"
2235 #: build/C/man2/inotify_init.2:64
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."
2240 "新しく生成されるオープンファイル記述 (open file description) の BR "
2241 "O_NONBLOCK ファイルステータスフラグをセットする。 このフラグを使うことで、 "
2242 "B<O_NONBLOCK> をセットするために B<fcntl>(2) を追加で呼び出す必要がなくな"
2246 #: build/C/man2/inotify_init.2:64
2248 msgid "B<IN_CLOEXEC>"
2249 msgstr "B<IN_CLOEXEC>"
2252 #: build/C/man2/inotify_init.2:74
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 "
2258 "新しいファイル・ディスクリプターに対して close-on-exec (B<FD_CLOEXEC>) フラ"
2259 "グをセットする。 このフラグが役に立つ理由については、 B<open>(2) の "
2260 "B<O_CLOEXEC> フラグの説明を参照のこと。"
2263 #: build/C/man2/inotify_init.2:79
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."
2268 "成功すると、これらのシステムコールは新しいファイルディスクリプタを返す。 エ"
2269 "ラーの場合、-1 を返し、 I<errno> をエラーを示す値に設定する。"
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> に指定された。"
2277 #: build/C/man2/inotify_init.2:85 build/C/man2/fanotify_init.2:216
2278 #: build/C/man7/fanotify.7:402
2284 #: build/C/man2/inotify_init.2:88
2286 "The user limit on the total number of inotify instances has been reached."
2287 msgstr "inotify インスタンスの総数がユーザ単位の上限に達していた。"
2290 #: build/C/man2/inotify_init.2:88 build/C/man7/fanotify.7:409
2296 #: build/C/man2/inotify_init.2:91
2298 "The system limit on the total number of file descriptors has been reached."
2299 msgstr "inotify インスタンスの総数がシステムの上限に達していた。"
2302 #: build/C/man2/inotify_init.2:94
2303 msgid "Insufficient kernel memory is available."
2304 msgstr "カーネルメモリが十分になかった。"
2307 #: build/C/man2/inotify_init.2:101
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."
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 で追加された。"
2319 #: build/C/man2/inotify_init.2:103
2320 msgid "These system calls are Linux-specific."
2321 msgstr "これらのシステムコールは Linux 独自である。"
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)"
2329 #: build/C/man2/inotify_rm_watch.2:27
2331 msgid "INOTIFY_RM_WATCH"
2332 msgstr "INOTIFY_RM_WATCH"
2335 #: build/C/man2/inotify_rm_watch.2:27
2341 #: build/C/man2/inotify_rm_watch.2:30
2342 msgid "inotify_rm_watch - remove an existing watch from an inotify instance"
2344 "inotify_rm_watch - inotify インスタンスから既存の監視アイテムを削除する"
2346 #. Before glibc 2.10, the second argument was types as uint32_t.
2347 #. http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040
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<);>"
2354 #: build/C/man2/inotify_rm_watch.2:42
2356 "B<inotify_rm_watch>() removes the watch associated with the watch "
2357 "descriptor I<wd> from the inotify instance associated with the file "
2360 "B<inotify_rm_watch>() は、監視対象ディスクリプタ (watch descriptor) I<wd> "
2361 "に対応する監視アイテムを、 ファイルディスクリプタ I<fd> に対応する inotify イ"
2365 #: build/C/man2/inotify_rm_watch.2:48
2367 "Removing a watch causes an B<IN_IGNORED> event to be generated for this "
2368 "watch descriptor. (See B<inotify>(7).)"
2370 "監視対象を削除すると、 この監視対象ディスクリプタに対して B<IN_IGNORED> イベ"
2371 "ントが生成される (B<inotify>(7) 参照)。"
2374 #: build/C/man2/inotify_rm_watch.2:55
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."
2379 "成功すると、B<inotify_rm_watch>() は 0 を返す。 エラーの場合、-1 を返し、 "
2380 "I<errno> をエラーの原因を示す値に設定する。"
2383 #: build/C/man2/inotify_rm_watch.2:60
2384 msgid "I<fd> is not a valid file descriptor."
2385 msgstr "I<fd> が有効なファイルディスクリプタではない。"
2388 #: build/C/man2/inotify_rm_watch.2:67
2390 "The watch descriptor I<wd> is not valid; or I<fd> is not an inotify file "
2393 "監視対象ディスクリプタ I<wd> が有効でない。もしくは、 I<fd> が inotify ファイ"
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)"
2402 #: build/C/man2/fanotify_init.2:24
2404 msgid "FANOTIFY_INIT"
2405 msgstr "FANOTIFY_INIT"
2408 #: build/C/man2/fanotify_init.2:24
2414 #: build/C/man2/fanotify_init.2:27
2415 msgid "fanotify_init - create and initialize fanotify group"
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>>"
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>>"
2429 #: build/C/man2/fanotify_init.2:33
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<);>"
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) を参照。"
2441 #: build/C/man2/fanotify_init.2:40
2443 "B<fanotify_init>() initializes a new fanotify group and returns a file "
2444 "descriptor for the event queue associated with the group."
2448 #: build/C/man2/fanotify_init.2:51
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."
2460 #: build/C/man2/fanotify_init.2:54
2462 "Multiple programs may be using the fanotify interface at the same time to "
2463 "monitor the same files."
2467 #: build/C/man2/fanotify_init.2:58
2469 "In the current implementation, the number of fanotify groups per user is "
2470 "limited to 128. This limit cannot be overridden."
2474 #: build/C/man2/fanotify_init.2:67
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 "
2483 #: build/C/man2/fanotify_init.2:73
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."
2491 #: build/C/man2/fanotify_init.2:77
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."
2498 #: build/C/man2/fanotify_init.2:80
2500 "Only one of the following notification classes may be specified in I<flags>:"
2504 #: build/C/man2/fanotify_init.2:80
2506 msgid "B<FAN_CLASS_PRE_CONTENT>"
2510 #: build/C/man2/fanotify_init.2:88
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."
2520 #: build/C/man2/fanotify_init.2:88
2522 msgid "B<FAN_CLASS_CONTENT>"
2526 #: build/C/man2/fanotify_init.2:96
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."
2536 #: build/C/man2/fanotify_init.2:96
2538 msgid "B<FAN_CLASS_NOTIF>"
2542 #: build/C/man2/fanotify_init.2:103
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."
2550 #: build/C/man2/fanotify_init.2:111
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 "
2559 #: build/C/man2/fanotify_init.2:114
2560 msgid "The following bits can additionally be set in I<flags>:"
2564 #: build/C/man2/fanotify_init.2:114
2566 msgid "B<FAN_CLOEXEC>"
2567 msgstr "B<FAN_CLOEXEC>"
2570 #: build/C/man2/fanotify_init.2:123
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)."
2577 #: build/C/man2/fanotify_init.2:123
2579 msgid "B<FAN_NONBLOCK>"
2580 msgstr "B<FAN_NONBLOCK>"
2583 #: build/C/man2/fanotify_init.2:133
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>."
2591 #: build/C/man2/fanotify_init.2:133
2593 msgid "B<FAN_UNLIMITED_QUEUE>"
2597 #: build/C/man2/fanotify_init.2:139
2599 "Remove the limit of 16384 events for the event queue. Use of this flag "
2600 "requires the B<CAP_SYS_ADMIN> capability."
2604 #: build/C/man2/fanotify_init.2:139
2606 msgid "B<FAN_UNLIMITED_MARKS>"
2610 #: build/C/man2/fanotify_init.2:145
2612 "Remove the limit of 8192 marks. Use of this flag requires the "
2613 "B<CAP_SYS_ADMIN> capability."
2617 #: build/C/man2/fanotify_init.2:158
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:"
2627 #: build/C/man2/fanotify_init.2:158
2633 #: build/C/man2/fanotify_init.2:161
2634 msgid "This value allows only read access."
2638 #: build/C/man2/fanotify_init.2:161
2644 #: build/C/man2/fanotify_init.2:164
2645 msgid "This value allows only write access."
2649 #: build/C/man2/fanotify_init.2:164
2655 #: build/C/man2/fanotify_init.2:167
2656 msgid "This value allows read and write access."
2660 #: build/C/man2/fanotify_init.2:171
2662 "Additional bits can be set in I<event_f_flags>. The most useful values are:"
2666 #: build/C/man2/fanotify_init.2:171
2668 msgid "B<O_LARGEFILE>"
2669 msgstr "B<O_LARGEFILE>"
2672 #: build/C/man2/fanotify_init.2:178
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."
2680 #: build/C/man2/fanotify_init.2:178
2682 msgid "B<O_CLOEXEC>"
2683 msgstr "B<O_CLOEXEC>"
2686 #: build/C/man2/fanotify_init.2:186
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."
2693 #: build/C/man2/fanotify_init.2:199
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)."
2701 #: build/C/man2/fanotify_init.2:206
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."
2708 #: build/C/man2/fanotify_init.2:216
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>."
2715 #: build/C/man2/fanotify_init.2:219
2716 msgid "The number of fanotify groups for this user exceeds 128."
2720 #: build/C/man2/fanotify_init.2:222
2721 msgid "The allocation of memory for the notification group failed."
2725 #: build/C/man2/fanotify_init.2:222 build/C/man2/fanotify_mark.2:283
2731 #: build/C/man2/fanotify_init.2:228
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>."
2738 #: build/C/man2/fanotify_init.2:228
2744 #: build/C/man2/fanotify_init.2:233
2746 "The operation is not permitted because the caller lacks the B<CAP_SYS_ADMIN> "
2751 #: build/C/man2/fanotify_init.2:237
2753 "B<fanotify_init>() was introduced in version 2.6.36 of the Linux kernel and "
2754 "enabled in version 2.6.37."
2758 #: build/C/man2/fanotify_init.2:242
2759 msgid "As of Linux 3.15, the following bug exists:"
2762 #. FIXME: Patch accepted to mm tree.
2764 #: build/C/man2/fanotify_init.2:252
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."
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)"
2778 #: build/C/man2/fanotify_mark.2:24
2780 msgid "FANOTIFY_MARK"
2781 msgstr "FANOTIFY_MARK"
2784 #: build/C/man2/fanotify_mark.2:24
2790 #: build/C/man2/fanotify_mark.2:28
2792 "fanotify_mark - add, remove, or modify an fanotify mark on a filesystem "
2797 #: build/C/man2/fanotify_mark.2:31
2799 msgid "B<#include E<lt>sys/fanotify.hE<gt>>\n"
2800 msgstr "B<#include E<lt>sys/fanotify.hE<gt>>\n"
2803 #: build/C/man2/fanotify_mark.2:35
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"
2811 #: build/C/man2/fanotify_mark.2:44
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."
2819 #: build/C/man2/fanotify_mark.2:49
2821 "The I<fanotify_fd> argument is a file descriptor returned by "
2822 "B<fanotify_init>(2)."
2826 #: build/C/man2/fanotify_mark.2:53
2828 "I<flags> is a bit mask describing the modification to perform. It must "
2829 "include exactly one of the following values:"
2833 #: build/C/man2/fanotify_mark.2:53
2835 msgid "B<FAN_MARK_ADD>"
2836 msgstr "B<FAN_MARK_ADD>"
2839 #: build/C/man2/fanotify_mark.2:62
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."
2846 #: build/C/man2/fanotify_mark.2:62
2848 msgid "B<FAN_MARK_REMOVE>"
2849 msgstr "B<FAN_MARK_REMOVE>"
2852 #: build/C/man2/fanotify_mark.2:71
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 "
2860 #: build/C/man2/fanotify_mark.2:71
2862 msgid "B<FAN_MARK_FLUSH>"
2866 #: build/C/man2/fanotify_mark.2:86
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."
2876 #: build/C/man2/fanotify_mark.2:90
2878 "If none of the values above is specified, or more than one is specified, the "
2879 "call fails with the error B<EINVAL>."
2883 #: build/C/man2/fanotify_mark.2:94
2885 "In addition, zero or more of the following values may be ORed into I<flags>:"
2889 #: build/C/man2/fanotify_mark.2:94
2891 msgid "B<FAN_MARK_DONT_FOLLOW>"
2895 #: build/C/man2/fanotify_mark.2:105
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.)"
2903 #: build/C/man2/fanotify_mark.2:105
2905 msgid "B<FAN_MARK_ONLYDIR>"
2906 msgstr "B<FAN_MARK_ONLYDIR>"
2909 #: build/C/man2/fanotify_mark.2:110
2911 "If the filesystem object to be marked is not a directory, the error "
2912 "B<ENOTDIR> shall be raised."
2916 #: build/C/man2/fanotify_mark.2:110
2918 msgid "B<FAN_MARK_MOUNT>"
2919 msgstr "B<FAN_MARK_MOUNT>"
2922 #: build/C/man2/fanotify_mark.2:121
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 "
2931 #: build/C/man2/fanotify_mark.2:121
2933 msgid "B<FAN_MARK_IGNORED_MASK>"
2934 msgstr "B<FAN_MARK_IGNORED_MASK>"
2937 #: build/C/man2/fanotify_mark.2:126
2939 "The events in I<mask> shall be added to or removed from the ignore mask."
2943 #: build/C/man2/fanotify_mark.2:126
2945 msgid "B<FAN_MARK_IGNORED_SURV_MODIFY>"
2949 #: build/C/man2/fanotify_mark.2:132
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 "
2957 #: build/C/man2/fanotify_mark.2:136
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:"
2964 #: build/C/man2/fanotify_mark.2:136 build/C/man7/fanotify.7:246
2966 msgid "B<FAN_ACCESS>"
2967 msgstr "B<FAN_ACCESS>"
2970 #: build/C/man2/fanotify_mark.2:139
2972 "Create an event when a file or directory (but see BUGS) is accessed (read)."
2976 #: build/C/man2/fanotify_mark.2:139 build/C/man7/fanotify.7:252
2978 msgid "B<FAN_MODIFY>"
2979 msgstr "B<FAN_MODIFY>"
2982 #: build/C/man2/fanotify_mark.2:142
2983 msgid "Create an event when a file is modified (write)."
2987 #: build/C/man2/fanotify_mark.2:142 build/C/man7/fanotify.7:255
2989 msgid "B<FAN_CLOSE_WRITE>"
2990 msgstr "B<FAN_CLOSE_WRITE>"
2993 #: build/C/man2/fanotify_mark.2:145
2994 msgid "Create an event when a writable file is closed."
2998 #: build/C/man2/fanotify_mark.2:145 build/C/man7/fanotify.7:262
3000 msgid "B<FAN_CLOSE_NOWRITE>"
3001 msgstr "B<FAN_CLOSE_NOWRITE>"
3004 #: build/C/man2/fanotify_mark.2:148
3005 msgid "Create an event when a read-only file or directory is closed."
3009 #: build/C/man2/fanotify_mark.2:148 build/C/man7/fanotify.7:249
3012 msgstr "B<FAN_OPEN>"
3015 #: build/C/man2/fanotify_mark.2:151
3016 msgid "Create an event when a file or directory is opened."
3020 #: build/C/man2/fanotify_mark.2:151 build/C/man7/fanotify.7:283
3022 msgid "B<FAN_OPEN_PERM>"
3023 msgstr "B<FAN_OPEN_PERM>"
3026 #: build/C/man2/fanotify_mark.2:159
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."
3034 #: build/C/man2/fanotify_mark.2:159 build/C/man7/fanotify.7:274
3036 msgid "B<FAN_ACCESS_PERM>"
3037 msgstr "B<FAN_ACCESS_PERM>"
3040 #: build/C/man2/fanotify_mark.2:167
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."
3048 #: build/C/man2/fanotify_mark.2:167
3050 msgid "B<FAN_ONDIR>"
3051 msgstr "B<FAN_ONDIR>"
3054 #: build/C/man2/fanotify_mark.2:176
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."
3062 #: build/C/man2/fanotify_mark.2:176
3064 msgid "B<FAN_EVENT_ON_CHILD>"
3068 #: build/C/man2/fanotify_mark.2:184
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."
3077 #: build/C/man2/fanotify_mark.2:186
3078 msgid "The following composed value is defined:"
3082 #: build/C/man2/fanotify_mark.2:186 build/C/man7/fanotify.7:290
3084 msgid "B<FAN_CLOSE>"
3085 msgstr "B<FAN_CLOSE>"
3088 #: build/C/man2/fanotify_mark.2:190
3089 msgid "A file is closed (B<FAN_CLOSE_WRITE>|B<FAN_CLOSE_NOWRITE>)."
3093 #: build/C/man2/fanotify_mark.2:195
3095 "The filesystem object to be marked is determined by the file descriptor "
3096 "I<dirfd> and the pathname specified in I<pathname>:"
3100 #: build/C/man2/fanotify_mark.2:201
3102 "If I<pathname> is NULL, I<dirfd> defines the filesystem object to be marked."
3106 #: build/C/man2/fanotify_mark.2:209
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."
3113 #: build/C/man2/fanotify_mark.2:215
3115 "If I<pathname> is absolute, it defines the filesystem object to be marked, "
3116 "and I<dirfd> is ignored."
3120 #: build/C/man2/fanotify_mark.2:226
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>."
3128 #: build/C/man2/fanotify_mark.2:236
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."
3136 #: build/C/man2/fanotify_mark.2:243
3138 "On success, B<fanotify_mark>() returns 0. On error, -1 is returned, and "
3139 "I<errno> is set to indicate the error."
3143 #: build/C/man2/fanotify_mark.2:248
3144 msgid "An invalid file descriptor was passed in I<fanotify_fd>."
3148 #: build/C/man2/fanotify_mark.2:257
3150 "An invalid value was passed in I<flags> or I<mask>, or I<fanotify_fd> was "
3151 "not an fanotify file descriptor."
3155 #: build/C/man2/fanotify_mark.2:265
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>)."
3163 #: build/C/man2/fanotify_mark.2:274
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 "
3171 #: build/C/man2/fanotify_mark.2:277
3172 msgid "The necessary memory could not be allocated."
3176 #: build/C/man2/fanotify_mark.2:283
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)."
3184 #: build/C/man2/fanotify_mark.2:289
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>."
3191 #: build/C/man2/fanotify_mark.2:289
3197 #: build/C/man2/fanotify_mark.2:299
3199 "I<flags> contains B<FAN_MARK_ONLYDIR>, and I<dirfd> and I<pathname> do not "
3200 "specify a directory."
3204 #: build/C/man2/fanotify_mark.2:303
3206 "B<fanotify_mark>() was introduced in version 2.6.36 of the Linux kernel and "
3207 "enabled in version 2.6.37."
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:"
3215 #. FIXME: Patch is in next-20140424.
3217 #: build/C/man2/fanotify_mark.2:318
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."
3223 #. FIXME: Patch is in next-20140424.
3225 #: build/C/man2/fanotify_mark.2:324
3226 msgid "B<readdir>(2) does not generate a B<FAN_ACCESS> event."
3229 #. FIXME: Patch proposed.
3231 #: build/C/man2/fanotify_mark.2:332
3233 "If B<fanotify_mark>(2) is called with B<FAN_MARK_FLUSH,> I<flags> is not "
3234 "checked for invalid values."
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)"
3243 #: build/C/man7/fanotify.7:25
3249 #: build/C/man7/fanotify.7:25
3255 #: build/C/man7/fanotify.7:28
3256 msgid "fanotify - monitoring filesystem events"
3260 #: build/C/man7/fanotify.7:37
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.)"
3270 #: build/C/man7/fanotify.7:44
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."
3279 #: build/C/man7/fanotify.7:52
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)."
3286 #: build/C/man7/fanotify.7:52
3288 msgid "fanotify_init(), fanotify_mark(), and notification groups"
3292 #: build/C/man7/fanotify.7:57
3294 "The B<fanotify_init>(2) system call creates and initializes an fanotify "
3295 "notification group and returns a file descriptor referring to it."
3299 #: build/C/man7/fanotify.7:61
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."
3306 #: build/C/man7/fanotify.7:72
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 "
3318 #: build/C/man7/fanotify.7:78
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."
3326 #: build/C/man7/fanotify.7:91
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."
3340 #: build/C/man7/fanotify.7:98
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."
3350 #: build/C/man7/fanotify.7:98
3352 msgid "The event queue"
3356 #: build/C/man7/fanotify.7:107
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)."
3365 #: build/C/man7/fanotify.7:121
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."
3377 #: build/C/man7/fanotify.7:128
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 "
3387 #: build/C/man7/fanotify.7:128
3389 msgid "Reading fanotify events"
3393 #: build/C/man7/fanotify.7:140
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))."
3402 #: build/C/man7/fanotify.7:144
3404 "After a successful B<read>(2), the read buffer contains one or more of the "
3405 "following structures:"
3409 #: build/C/man7/fanotify.7:156
3412 "struct fanotify_event_metadata {\n"
3413 " __u32 event_len;\n"
3416 " __u16 metadata_len;\n"
3417 " __aligned_u64 mask;\n"
3424 #: build/C/man7/fanotify.7:163
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 "
3432 #: build/C/man7/fanotify.7:168
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)."
3439 #: build/C/man7/fanotify.7:172
3440 msgid "The fields of the I<fanotify_event_metadata> structure are as follows:"
3444 #: build/C/man7/fanotify.7:172
3446 msgid "I<event_len>"
3450 #: build/C/man7/fanotify.7:182
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."
3459 #: build/C/man7/fanotify.7:182
3465 #: build/C/man7/fanotify.7:191
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 "
3475 #: build/C/man7/fanotify.7:191
3481 #: build/C/man7/fanotify.7:194
3482 msgid "This field is not used."
3486 #: build/C/man7/fanotify.7:194
3488 msgid "I<metadata_len>"
3492 #: build/C/man7/fanotify.7:200
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."
3500 #: build/C/man7/fanotify.7:200
3506 #: build/C/man7/fanotify.7:203
3507 msgid "This is a bit mask describing the event (see below)."
3511 #: build/C/man7/fanotify.7:203 build/C/man7/fanotify.7:360
3517 #: build/C/man7/fanotify.7:211
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."
3526 #: build/C/man7/fanotify.7:224
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 "
3539 #: build/C/man7/fanotify.7:224
3545 #: build/C/man7/fanotify.7:232
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."
3554 #: build/C/man7/fanotify.7:242
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."
3565 #: build/C/man7/fanotify.7:246
3566 msgid "The bits that may appear in I<mask> are as follows:"
3570 #: build/C/man7/fanotify.7:249
3571 msgid "A file or a directory (but see BUGS) was accessed (read)."
3575 #: build/C/man7/fanotify.7:252
3576 msgid "A file or a directory was opened."
3580 #: build/C/man7/fanotify.7:255
3581 msgid "A file was modified."
3585 #: build/C/man7/fanotify.7:262
3587 "A file that was opened for writing (B<O_WRONLY> or B<O_RDWR>) was closed."
3591 #: build/C/man7/fanotify.7:267
3593 "A file or directory that was opened read-only (B<O_RDONLY>) was closed."
3597 #: build/C/man7/fanotify.7:267
3599 msgid "B<FAN_Q_OVERFLOW>"
3600 msgstr "B<FAN_Q_OVERFLOW>"
3603 #: build/C/man7/fanotify.7:274
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)."
3611 #: build/C/man7/fanotify.7:283
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."
3620 #: build/C/man7/fanotify.7:288
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."
3628 #: build/C/man7/fanotify.7:290
3629 msgid "To check for any close event, the following bit mask may be used:"
3633 #: build/C/man7/fanotify.7:294
3634 msgid "A file was closed. This is a synonym for:"
3638 #: build/C/man7/fanotify.7:296
3640 msgid " FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n"
3641 msgstr " FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE\n"
3644 #: build/C/man7/fanotify.7:301
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 "
3652 #: build/C/man7/fanotify.7:301
3654 msgid "B<FAN_EVENT_OK(meta, len)>"
3658 #: build/C/man7/fanotify.7:310
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."
3666 #: build/C/man7/fanotify.7:310
3668 msgid "B<FAN_EVENT_NEXT(meta, len)>"
3672 #: build/C/man7/fanotify.7:329
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>)."
3684 #: build/C/man7/fanotify.7:331
3685 msgid "In addition, there is:"
3689 #: build/C/man7/fanotify.7:331
3691 msgid "B<FAN_EVENT_METADATA_LEN>"
3695 #: build/C/man7/fanotify.7:337
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."
3703 #: build/C/man7/fanotify.7:337
3705 msgid "Monitoring an fanotify file descriptor for events"
3709 #: build/C/man7/fanotify.7:344
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)."
3716 #: build/C/man7/fanotify.7:344
3718 msgid "Dealing with permission events"
3722 #: build/C/man7/fanotify.7:349
3724 "For permission events, the application must B<write>(2) a structure of the "
3725 "following form to the fanotify file descriptor:"
3729 #: build/C/man7/fanotify.7:356
3732 "struct fanotify_response {\n"
3734 " __u32 response;\n"
3739 #: build/C/man7/fanotify.7:360
3740 msgid "The fields of this structure are as follows:"
3744 #: build/C/man7/fanotify.7:364
3746 "This is the file descriptor from the structure I<fanotify_event_metadata>."
3750 #: build/C/man7/fanotify.7:364
3756 #: build/C/man7/fanotify.7:372
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."
3764 #: build/C/man7/fanotify.7:376
3766 "If access is denied, the requesting application call will receive an "
3771 #: build/C/man7/fanotify.7:376
3773 msgid "Closing the fanotify file descriptor"
3777 #: build/C/man7/fanotify.7:384
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 "
3786 #: build/C/man7/fanotify.7:384
3788 msgid "/proc/[pid]/fdinfo"
3792 #: build/C/man7/fanotify.7:394
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."
3800 #: build/C/man7/fanotify.7:399
3802 "In addition to the usual errors for B<read>(2), the following errors can "
3803 "occur when reading from the fanotify file descriptor:"
3807 #: build/C/man7/fanotify.7:402
3808 msgid "The buffer is too small to hold the event."
3812 #: build/C/man7/fanotify.7:409
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)."
3819 #: build/C/man7/fanotify.7:416
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)."
3826 #: build/C/man7/fanotify.7:416
3832 #: build/C/man7/fanotify.7:429
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."
3840 #: build/C/man7/fanotify.7:433
3842 "In addition to the usual errors for B<write>(2), the following errors can "
3843 "occur when writing to the fanotify file descriptor:"
3847 #: build/C/man7/fanotify.7:439
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."
3854 #: build/C/man7/fanotify.7:446
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."
3861 #: build/C/man7/fanotify.7:450
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."
3868 #: build/C/man7/fanotify.7:452
3869 msgid "The fanotify API is Linux-specific."
3870 msgstr "fanotify API は Linux 独自のものである。"
3873 #: build/C/man7/fanotify.7:459
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."
3882 #: build/C/man7/fanotify.7:464
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."
3890 #: build/C/man7/fanotify.7:471
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) により起こったファイルのアクセスと変更を報告しない。"
3897 #: build/C/man7/fanotify.7:476
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."
3905 #: build/C/man7/fanotify.7:484
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 "
3916 #: build/C/man7/fanotify.7:487
3917 msgid "The event queue can overflow. In this case, events are lost."
3920 #. FIXME: A patch was proposed.
3922 #: build/C/man7/fanotify.7:499
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 "
3932 #: build/C/man7/fanotify.7:509
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."
3942 #: build/C/man7/fanotify.7:519
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."
3951 #: build/C/man7/fanotify.7:529
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."
3960 #: build/C/man7/fanotify.7:537
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"
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"
3976 #: build/C/man7/fanotify.7:552
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"
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"
4000 #: build/C/man7/fanotify.7:554
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"
4006 #: build/C/man7/fanotify.7:565
4010 "handle_events(int fd)\n"
4012 " const struct fanotify_event_metadata *metadata;\n"
4013 " struct fanotify_event_metadata buf[200];\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"
4021 "handle_events(int fd)\n"
4023 " const struct fanotify_event_metadata *metadata;\n"
4024 " struct fanotify_event_metadata buf[200];\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"
4032 #: build/C/man7/fanotify.7:567
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"
4038 #: build/C/man7/fanotify.7:569
4040 msgid " for(;;) {\n"
4041 msgstr " for(;;) {\n"
4044 #: build/C/man7/fanotify.7:571
4046 msgid " /* Read some events */\n"
4047 msgstr " /* Read some events */\n"
4050 #: build/C/man7/fanotify.7:577
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"
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"
4066 #: build/C/man7/fanotify.7:579
4068 msgid " /* Check if end of available data reached */\n"
4069 msgstr " /* Check if end of available data reached */\n"
4072 #: build/C/man7/fanotify.7:584
4074 msgid " /* Point to the first event in the buffer */\n"
4075 msgstr " /* Point to the first event in the buffer */\n"
4078 #: build/C/man7/fanotify.7:586
4080 msgid " metadata = buf;\n"
4081 msgstr " metadata = buf;\n"
4084 #: build/C/man7/fanotify.7:590
4086 msgid " while (FAN_EVENT_OK(metadata, len)) {\n"
4087 msgstr " while (FAN_EVENT_OK(metadata, len)) {\n"
4090 #: build/C/man7/fanotify.7:592
4092 msgid " /* Check that run-time and compile-time structures match */\n"
4093 msgstr " /* Check that run-time and compile-time structures match */\n"
4096 #: build/C/man7/fanotify.7:598
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"
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"
4112 #: build/C/man7/fanotify.7:602
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"
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"
4124 #: build/C/man7/fanotify.7:604
4126 msgid " if (metadata-E<gt>fd E<gt>= 0) {\n"
4127 msgstr " if (metadata-E<gt>fd E<gt>= 0) {\n"
4130 #: build/C/man7/fanotify.7:606
4132 msgid " /* Handle open permission event */\n"
4133 msgstr " /* Handle open permission event */\n"
4136 #: build/C/man7/fanotify.7:609
4139 " if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n"
4140 " printf(\"FAN_OPEN_PERM: \");\n"
4142 " if (metadata-E<gt>mask & FAN_OPEN_PERM) {\n"
4143 " printf(\"FAN_OPEN_PERM: \");\n"
4146 #: build/C/man7/fanotify.7:611
4148 msgid " /* Allow file to be opened */\n"
4149 msgstr " /* Allow file to be opened */\n"
4152 #: build/C/man7/fanotify.7:617
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"
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"
4168 #: build/C/man7/fanotify.7:619
4170 msgid " /* Handle closing of writable file event */\n"
4171 msgstr " /* Handle closing of writable file event */\n"
4174 #: build/C/man7/fanotify.7:622
4177 " if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n"
4178 " printf(\"FAN_CLOSE_WRITE: \");\n"
4180 " if (metadata-E<gt>mask & FAN_CLOSE_WRITE)\n"
4181 " printf(\"FAN_CLOSE_WRITE: \");\n"
4184 #: build/C/man7/fanotify.7:624
4186 msgid " /* Retrieve and print pathname of the accessed file */\n"
4187 msgstr " /* Retrieve and print pathname of the accessed file */\n"
4190 #: build/C/man7/fanotify.7:633
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"
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"
4212 #: build/C/man7/fanotify.7:636
4215 " path[path_len] = '\\e0';\n"
4216 " printf(\"File %s\\en\", path);\n"
4218 " path[path_len] = '\\e0';\n"
4219 " printf(\"File %s\\en\", path);\n"
4222 #: build/C/man7/fanotify.7:638
4224 msgid " /* Close the file descriptor of the event */\n"
4225 msgstr " /* Close the file descriptor of the event */\n"
4228 #: build/C/man7/fanotify.7:641
4231 " close(metadata-E<gt>fd);\n"
4234 " close(metadata-E<gt>fd);\n"
4238 #: build/C/man7/fanotify.7:643
4240 msgid " /* Advance to next event */\n"
4241 msgstr " /* Advance to next event */\n"
4244 #: build/C/man7/fanotify.7:648
4247 " metadata = FAN_EVENT_NEXT(metadata, len);\n"
4252 " metadata = FAN_EVENT_NEXT(metadata, len);\n"
4258 #: build/C/man7/fanotify.7:656
4262 "main(int argc, char *argv[])\n"
4265 " int fd, poll_num;\n"
4267 " struct pollfd fds[2];\n"
4270 "main(int argc, char *argv[])\n"
4273 " int fd, poll_num;\n"
4275 " struct pollfd fds[2];\n"
4278 #: build/C/man7/fanotify.7:658
4280 msgid " /* Check mount point is supplied */\n"
4281 msgstr " /* Check mount point is supplied */\n"
4284 #: build/C/man7/fanotify.7:663
4287 " if (argc != 2) {\n"
4288 " fprintf(stderr, \"Usage: %s MOUNT\\en\", argv[0]);\n"
4289 " exit(EXIT_FAILURE);\n"
4292 " if (argc != 2) {\n"
4293 " fprintf(stderr, \"Usage: %s MOUNT\\en\", argv[0]);\n"
4294 " exit(EXIT_FAILURE);\n"
4298 #: build/C/man7/fanotify.7:665
4300 msgid " printf(\"Press enter key to terminate.\\en\");\n"
4301 msgstr " printf(\"Press enter key to terminate.\\en\");\n"
4304 #: build/C/man7/fanotify.7:667
4306 msgid " /* Create the file descriptor for accessing the fanotify API */\n"
4307 msgstr " /* Create the file descriptor for accessing the fanotify API */\n"
4310 #: build/C/man7/fanotify.7:674
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"
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"
4328 #: build/C/man7/fanotify.7:679
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"
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"
4342 #: build/C/man7/fanotify.7:686
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"
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"
4360 #: build/C/man7/fanotify.7:697
4362 msgid " /* Fanotify input */\n"
4363 msgstr " /* Fanotify input */\n"
4366 #: build/C/man7/fanotify.7:702
4368 msgid " /* This is the loop to wait for incoming events */\n"
4369 msgstr " /* This is the loop to wait for incoming events */\n"
4372 #: build/C/man7/fanotify.7:704
4374 msgid " printf(\"Listening for events.\\en\");\n"
4375 msgstr " printf(\"Listening for events.\\en\");\n"
4378 #: build/C/man7/fanotify.7:710
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"
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"
4394 #: build/C/man7/fanotify.7:714
4397 " perror(\"poll\"); /* Unexpected error */\n"
4398 " exit(EXIT_FAILURE);\n"
4401 " perror(\"poll\"); /* Unexpected error */\n"
4402 " exit(EXIT_FAILURE);\n"
4406 #: build/C/man7/fanotify.7:717
4409 " if (poll_num E<gt> 0) {\n"
4410 " if (fds[0].revents & POLLIN) {\n"
4412 " if (poll_num E<gt> 0) {\n"
4413 " if (fds[0].revents & POLLIN) {\n"
4416 #: build/C/man7/fanotify.7:719
4418 msgid " /* Console input is available: empty stdin and quit */\n"
4419 msgstr " /* Console input is available: empty stdin and quit */\n"
4422 #: build/C/man7/fanotify.7:728
4424 msgid " /* Fanotify events are available */\n"
4425 msgstr " /* Fanotify events are available */\n"
4428 #: build/C/man7/fanotify.7:733
4431 " handle_events(fd);\n"
4436 " handle_events(fd);\n"
4442 #: build/C/man7/fanotify.7:737
4445 " printf(\"Listening for events stopped.\\en\");\n"
4446 " exit(EXIT_SUCCESS);\n"
4449 " printf(\"Listening for events stopped.\\en\");\n"
4450 " exit(EXIT_SUCCESS);\n"
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)"