OSDN Git Service

(split) LDP: Translation snapshots for ja.po.
[linuxjm/LDP_man-pages.git] / draft / man7 / inotify.7
1 '\" t
2 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\"
4 .\" Copyright (C) 2006 Michael Kerrisk <mtk.manpages@gmail.com>
5 .\"
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\"
26 .\" Japanese Version Copyright (c) 2006 Yuichi SATO
27 .\"     and Copyright (c) 2007-2008 Akihiro MOTOKI
28 .\" Translated 2006-07-05 by Yuichi SATO <ysato444@yahoo.co.jp>, LDP v2.29
29 .\" Updated 2006-07-20 by Yuichi SATO, LDP v2.36
30 .\" Updated 2007-06-13, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.55
31 .\" Updated 2008-08-10, Akihiro MOTOKI, LDP v3.05
32 .\" Updated 2008-09-19, Akihiro MOTOKI, LDP v3.08
33 .\"
34 .TH INOTIFY 7 2008-11-18 "Linux" "Linux Programmer's Manual"
35 .\"O .SH NAME
36 .SH 名前
37 .\"O inotify \- monitoring file system events
38 inotify \- ファイルシステムイベントを監視する
39 .\"O .SH DESCRIPTION
40 .SH 説明
41 .\"O The
42 .\"O .I inotify
43 .\"O API provides a mechanism for monitoring file system events.
44 .I inotify
45 API はファイルシステムイベントを監視するための機構を提供する。
46 .\"O Inotify can be used to monitor individual files,
47 .\"O or to monitor directories.
48 inotify は個々のファイルやディレクトリを監視するのに使える。
49 .\"O When a directory is monitored, inotify will return events
50 .\"O for the directory itself, and for files inside the directory.
51 ディレクトリを監視する場合、inotify はディレクトリ自身と
52 ディレクトリ内のファイルのイベントを返す。
53
54 .\"O The following system calls are used with this API:
55 .\"O .BR inotify_init (2)
56 .\"O (or
57 .\"O .BR inotify_init1 (2)),
58 .\"O .BR inotify_add_watch (2),
59 .\"O .BR inotify_rm_watch (2),
60 .\"O .BR read (2),
61 .\"O and
62 .\"O .BR close (2).
63 以下のシステムコールがこの API と共に使用される:
64 .BR inotify_init (2)
65 (や
66 .BR inotify_init1 (2)),
67 .BR inotify_add_watch (2),
68 .BR inotify_rm_watch (2),
69 .BR read (2),
70 .BR close (2).
71
72 .\"O .BR inotify_init (2)
73 .\"O creates an inotify instance and returns a file descriptor
74 .\"O referring to the inotify instance.
75 .\"O The more recent
76 .\"O .BR inotify_init1 (2)
77 .\"O is like
78 .\"O .BR inotify_init (2),
79 .\"O but provides some extra functionality.
80 .BR inotify_init (2)
81 は inotify インスタンスを作成し、inotify インスタンスを参照する
82 ファイルディスクリプタを返す。
83 もっと新しい
84 .BR inotify_init1 (2)
85
86 .BR inotify_init (2)
87 と同様だが、いくつかの追加の機能が提供されている。
88
89 .\"O .BR inotify_add_watch (2)
90 .\"O manipulates the "watch list" associated with an inotify instance.
91 .BR inotify_add_watch (2)
92 は inotify インスタンスに関連づけられた「監視対象 (watch) リスト」を操作する。
93 .\"O Each item ("watch") in the watch list specifies the pathname of
94 .\"O a file or directory,
95 .\"O along with some set of events that the kernel should monitor for the
96 .\"O file referred to by that pathname.
97 監視対象リストの各アイテム ("watch") は、
98 ファイルまたはディレクトリのパス名と、
99 そのパス名で参照されるファイルに対して
100 カーネルが監視する複数のイベントの集合を指定する。
101 .\"O .BR inotify_add_watch (2)
102 .\"O either creates a new watch item, or modifies an existing watch.
103 .BR inotify_add_watch (2)
104 は新しい監視アイテムの作成や既存の監視対象の変更ができる。
105 .\"O Each watch has a unique "watch descriptor", an integer
106 .\"O returned by
107 .\"O .BR inotify_add_watch (2)
108 .\"O when the watch is created.
109 各監視対象は一意の「監視対象ディスクリプタ」を持つ。
110 これは監視対象を作成したときに
111 .BR inotify_add_watch (2)
112 から返される整数である。
113
114 .\"O .BR inotify_rm_watch (2)
115 .\"O removes an item from an inotify watch list.
116 .BR inotify_rm_watch (2)
117 は inotify の監視対象リストからアイテムを削除する。
118
119 .\"O When all file descriptors referring to an inotify
120 .\"O instance have been closed,
121 .\"O the underlying object and its resources are
122 .\"O freed for reuse by the kernel;
123 .\"O all associated watches are automatically freed.
124 inotify インスタンスを指している
125 全てのファイルディスクリプタがクローズされた場合、
126 その下層にあるオブジェクトとそのリソースは、
127 カーネルで再利用するために解放される。
128 関連が切られた監視対象は自動的に解放される。
129
130 .\"O To determine what events have occurred, an application
131 .\"O .BR read (2)s
132 .\"O from the inotify file descriptor.
133 どのようなイベントが起こっていたかを知るには、
134 アプリケーションで inotify ファイルディスクリプタを
135 .BR read (2)
136 すればよい。
137 .\"O If no events have so far occurred, then,
138 .\"O assuming a blocking file descriptor,
139 .\"O .BR read (2)
140 .\"O will block until at least one event occurs
141 .\"O (unless interrupted by a signal,
142 .\"O in which case the call fails with the error
143 .\"O .BR EINTR ;
144 .\"O see
145 .\"O .BR signal (7)).
146 これまでに何もイベントが起こっていない場合、
147 停止 (blocking) モードのファイルディスクリプタであれば、
148 少なくとも 1 つのイベントが起こるまで
149 .BR read (2)
150 は停止する (シグナルにより割り込まれなかった場合。
151 シグナルによる割り込みがあった場合、呼び出しはエラー
152 .BR EINTR
153 で失敗する。
154 .BR signal (7)
155 参照)。
156
157 .\"O Each successful
158 .\"O .BR read (2)
159 .\"O returns a buffer containing one or more of the following structures:
160 .BR read (2)
161 が成功すると、以下の構造体を 1 つ以上含むバッファが返される:
162 .in +4n
163 .nf
164
165 struct inotify_event {
166 .\"O     int      wd;       /* Watch descriptor */
167     int      wd;       /* 監視対象ディスクリプタ */
168 .\" FIXME . The type of the 'wd' field should probably be "int32_t".
169 .\" I submitted a patch to fix this.  See the LKML thread
170 .\" "[patch] Fix type errors in inotify interfaces", 18 Nov 2008
171 .\" Glibc bug filed: http://sources.redhat.com/bugzilla/show_bug.cgi?id=7040
172 .\"O     uint32_t mask;     /* Mask of events */
173 .\"O     uint32_t cookie;   /* Unique cookie associating related
174 .\"O                           events (for rename(2)) */
175 .\"O     uint32_t len;      /* Size of \(aqname\(aq field */
176 .\"O     char     name[];   /* Optional null-terminated name */
177     uint32_t mask;     /* イベントのマスク */
178     uint32_t cookie;   /* 関連するイベント群を関連づける
179                           一意なクッキー (rename(2) 用) */
180     uint32_t len;      /* \(aqname\(aq フィールドのサイズ */
181     char     name[];   /* NULL で終端された任意の名前 */
182 };
183 .fi
184 .in
185
186 .\"O .I wd
187 .\"O identifies the watch for which this event occurs.
188 .\"O It is one of the watch descriptors returned by a previous call to
189 .\"O .BR inotify_add_watch (2).
190 .I wd
191 はイベント発生の監視対象を指定する。
192 これは、前もって行われた
193 .BR inotify_add_watch (2)
194 呼び出しで返された監視対象ディスクリプタのうちの 1 つである。
195
196 .\"O .I mask
197 .\"O contains bits that describe the event that occurred (see below).
198 .I mask
199 には発生したイベント (下記参照) を記述するためのビットが含まれる。
200
201 .\"O .I cookie
202 .\"O is a unique integer that connects related events.
203 .I cookie
204 は関連するイベントを関連づけるための一意な整数である。
205 .\"O Currently this is only used for rename events, and
206 .\"O allows the resulting pair of
207 .\"O .B IN_MOVE_FROM
208 .\"O and
209 .\"O .B IN_MOVE_TO
210 .\"O events to be connected by the application.
211 現在のところ、この値は rename イベントに対してのみ使われており、
212 結果のペアである
213 .B IN_MOVE_FROM
214
215 .B IN_MOVE_TO
216 イベントをアプリケーションで関連づけることができる。
217
218 .\"O The
219 .\"O .I name
220 .\"O field is only present when an event is returned
221 .\"O for a file inside a watched directory;
222 .\"O it identifies the file pathname relative to the watched directory.
223 .I name
224 フィールドは監視しているディレクトリ内のファイルに対して
225 イベントが返される場合のためにだけ存在する。
226 監視するディレクトリからのファイルの相対パス名を表す。
227 .\"O This pathname is null-terminated,
228 .\"O and may include further null bytes to align subsequent reads to a
229 .\"O suitable address boundary.
230 このパス名は NULL で終端され、
231 その後の読み込みで適切なアドレス境界に調整するために、
232 さらに NULL バイトが含まれる場合もある。
233
234 .\"O The
235 .\"O .I len
236 .\"O field counts all of the bytes in
237 .\"O .IR name ,
238 .\"O including the null bytes;
239 .\"O the length of each
240 .\"O .I inotify_event
241 .\"O structure is thus
242 .\"O .IR "sizeof(inotify_event)+len" .
243 .I len
244 フィールドは NULL バイトを含む
245 .I name
246 の全てのバイト数を表す。
247 よって、
248 .I inotify_event
249 構造体のサイズは
250 .I "sizeof(inotify_event)+len"
251 である。
252
253 .\"O The behavior when the buffer given to
254 .\"O .BR read (2)
255 .\"O is too small to return information about the next event depends
256 .\"O on the kernel version: in kernels before 2.6.21,
257 .\"O .BR read (2)
258 .\"O returns 0; since kernel 2.6.21,
259 .\"O .BR read (2)
260 .\"O fails with the error
261 .\"O .BR EINVAL .
262 .BR read (2)
263 に渡されたバッファが小さすぎて次のイベントに関する情報を返せない
264 場合の動作はカーネルのバージョンにより異なる。
265 2.6.21 より前のカーネルでは、
266 .BR read (2)
267 は 0 を返す。
268 2.6.21 以降のカーネルでは、
269 .BR read (2)
270 はエラー
271 .B EINVAL
272 で失敗する。
273 .\"O .SS inotify events
274 .SS inotify イベント
275 .\"O The
276 .\"O .BR inotify_add_watch (2)
277 .\"O .I mask
278 .\"O argument and the
279 .\"O .I mask
280 .\"O field of the
281 .\"O .I inotify_event
282 .\"O structure returned when
283 .\"O .BR read (2)ing
284 .\"O an inotify file descriptor are both bit masks identifying
285 .\"O inotify events.
286 .BR inotify_add_watch (2)
287
288 .I mask
289 引き数と、inotify ファイル構造体を
290 .BR read (2)
291 したときに返される
292 .I inotify_event
293 構造体の
294 .I mask
295 フィールドは、ともに inotify イベントを識別するための
296 ビットマスクである。
297 .\"O The following bits can be specified in
298 .\"O .I mask
299 .\"O when calling
300 .\"O .BR inotify_add_watch (2)
301 .\"O and may be returned in the
302 .\"O .I mask
303 .\"O field returned by
304 .\"O .BR read (2):
305 以下のビットが
306 .BR inotify_add_watch (2)
307 を呼ぶときの
308 .I mask
309 に指定可能であり、
310 .BR read (2)
311 で返される
312 .I mask
313 フィールドで返される:
314 .RS 4
315 .sp
316 .PD 0
317 .TP 18
318 .B IN_ACCESS
319 .\"O File was accessed (read) (*).
320 ファイルがアクセス (read) された。(*)
321 .TP
322 .B IN_ATTRIB
323 .\"O Metadata changed, e.g., permissions, timestamps, extended attributes,
324 .\"O link count (since Linux 2.6.25), UID, GID, etc. (*).
325 メタデータが変更された。
326 メタデータとは、例えば、許可 (permission)、タイムスタンプ、拡張属性、
327 リンクカウント (Linux 2.6.25 以降)、UID、GID などである。(*)
328 .TP
329 .B IN_CLOSE_WRITE
330 .\"O File opened for writing was closed (*).
331 書き込みのためにオープンされたファイルがクローズされた。(*)
332 .TP
333 .B IN_CLOSE_NOWRITE
334 .\"O File not opened for writing was closed (*).
335 書き込み以外のためにオープンされたファイルがクローズされた。(*)
336 .TP
337 .B IN_CREATE
338 .\"O File/directory created in watched directory (*).
339 監視対象ディレクトリ内でファイルやディレクトリが作成された。(*)
340 .TP
341 .B IN_DELETE
342 .\"O File/directory deleted from watched directory (*).
343 監視対象ディレクトリ内でファイルやディレクトリが削除された。(*)
344 .TP
345 .B IN_DELETE_SELF
346 .\"O Watched file/directory was itself deleted.
347 監視対象のディレクトリまたはファイル自身が削除された。
348 .TP
349 .B IN_MODIFY
350 .\"O File was modified (*).
351 ファイルが修正された。(*)
352 .TP
353 .B IN_MOVE_SELF
354 .\"O Watched file/directory was itself moved.
355 監視対象のディレクトリまたはファイル自身が移動された。
356 .TP
357 .B IN_MOVED_FROM
358 .\"O File moved out of watched directory (*).
359 ファイルが監視対象ディレクトリ外へ移動された。(*)
360 .TP
361 .B IN_MOVED_TO
362 .\"O File moved into watched directory (*).
363 ファイルが監視対象ディレクトリ内へ移動された。(*)
364 .TP
365 .B IN_OPEN
366 .\"O File was opened (*).
367 ファイルがオープンされた。(*)
368 .PD
369 .RE
370 .PP
371 .\"O When monitoring a directory,
372 .\"O the events marked with an asterisk (*) above can occur for
373 .\"O files in the directory, in which case the
374 .\"O .I name
375 .\"O field in the returned
376 .\"O .I inotify_event
377 .\"O structure identifies the name of the file within the directory.
378 ディレクトリを監視する場合、
379 上記でアスタリスク (*) を付けたイベントは、
380 そのディレクトリ内のファイルに対して発生する。
381 このとき
382 .I inotify_event
383 構造体で返される
384 .I name
385 フィールドは、ディレクトリ内のファイル名を表す。
386 .PP
387 .\"O The
388 .\"O .B IN_ALL_EVENTS
389 .\"O macro is defined as a bit mask of all of the above events.
390 .\"O This macro can be used as the
391 .\"O .I mask
392 .\"O argument when calling
393 .\"O .BR inotify_add_watch (2).
394 .B IN_ALL_EVENTS
395 マクロは上記のイベント全てのマスクとして定義される。
396 このマクロは
397 .BR inotify_add_watch (2)
398 を呼び出すときの
399 .I mask
400 引き数として使える。
401
402 .\"O Two additional convenience macros are
403 .\"O .BR IN_MOVE ,
404 .\"O which equates to
405 .\"O IN_MOVED_FROM|IN_MOVED_TO,
406 .\"O and
407 .\"O .B IN_CLOSE
408 .\"O which equates to
409 .\"O IN_CLOSE_WRITE|IN_CLOSE_NOWRITE.
410 さらに 2 つの便利なマクロがある。
411 .B IN_MOVE
412
413 IN_MOVED_FROM|IN_MOVED_TO
414 と等しく、
415 .B IN_CLOSE
416
417 IN_CLOSE_WRITE|IN_CLOSE_NOWRITE
418 と等しい。
419 .PP
420 .\"O The following further bits can be specified in
421 .\"O .I mask
422 .\"O when calling
423 .\"O .BR inotify_add_watch (2):
424 その他にも以下のビットを
425 .BR inotify_add_watch (2)
426 を呼ぶときの
427 .I mask
428 に指定できる:
429 .RS 4
430 .sp
431 .PD 0
432 .TP 18
433 .B IN_DONT_FOLLOW
434 .\"O Don't dereference \fIpathname\fP if it is a symbolic link
435 .\"O (since Linux 2.6.15).
436 \fIpathname\fP がシンボリックリンクである場合に辿らない。
437 (Linux 2.6.15 以降)
438 .TP
439 .B IN_MASK_ADD
440 .\"O Add (OR) events to watch mask for this pathname if
441 .\"O it already exists (instead of replacing mask).
442 \fIpathname\fP に対する監視マスクが既に存在する場合、
443 (マスクの置き換えではなく) イベントを追加 (OR) する。
444 .TP
445 .B IN_ONESHOT
446 .\"O Monitor \fIpathname\fP for one event, then remove from
447 .\"O watch list.
448 1 つのイベントについて \fIpathname\fP を監視し、
449 イベントが発生したら監視対象リストから削除する。
450 .TP
451 .\"O .BR IN_ONLYDIR " (since Linux 2.6.15)"
452 .BR IN_ONLYDIR " (Linux 2.6.15 以降)"
453 .\"O Only watch \fIpathname\fP if it is a directory.
454 \fIpathname\fP がディレクトリの場合にのみ監視する。
455 .PD
456 .RE
457 .PP
458 .\"O The following bits may be set in the
459 .\"O .I mask
460 .\"O field returned by
461 .\"O .BR read (2):
462 以下のビットが
463 .BR read (2)
464 で返される
465 .I mask
466 フィールドに設定される:
467 .RS 4
468 .sp
469 .PD 0
470 .TP 18
471 .B IN_IGNORED
472 .\"O Watch was removed explicitly (\fBinotify_rm_watch\fP(2))
473 .\"O or automatically (file was deleted, or file system was unmounted).
474 監視対象が (\fBinotify_rm_watch\fP(2) により) 明示的に
475 削除された。もしくは (ファイルの削除、またはファイル
476 システムのアンマウントにより) 自動的に削除された。
477 .TP
478 .B IN_ISDIR
479 .\"O Subject of this event is a directory.
480 このイベントの対象がディレクトリである。
481 .TP
482 .B IN_Q_OVERFLOW
483 .\"O Event queue overflowed (\fIwd\fP is \-1 for this event).
484 イベントキューが溢れた (このイベントの場合、\fIwd\fP は \-1 である)。
485 .TP
486 .B IN_UNMOUNT
487 .\"O File system containing watched object was unmounted.
488 監視対象オブジェクトを含むファイルシステムがアンマウントされた。
489 .PD
490 .RE
491 .\"O .SS /proc interfaces
492 .SS /proc インターフェース
493 .\"O The following interfaces can be used to limit the amount of
494 .\"O kernel memory consumed by inotify:
495 以下のインターフェースは、inotify で消費される
496 カーネルメモリの総量を制限するのに使用できる:
497 .TP
498 .I /proc/sys/fs/inotify/max_queued_events
499 .\"O The value in this file is used when an application calls
500 .\"O .BR inotify_init (2)
501 .\"O to set an upper limit on the number of events that can be
502 .\"O queued to the corresponding inotify instance.
503 このファイルの値は、アプリケーションが
504 .BR inotify_init (2)
505 を呼び出すときに使用され、対応する inotify インスタンスについて
506 キューに入れられるイベントの数の上限を設定する。
507 .\"O Events in excess of this limit are dropped, but an
508 .\"O .B IN_Q_OVERFLOW
509 .\"O event is always generated.
510 この制限を超えたイベントは破棄されるが、
511 .B IN_Q_OVERFLOW
512 イベントが常に生成される。
513 .TP
514 .I /proc/sys/fs/inotify/max_user_instances
515 .\"O This specifies an upper limit on the number of inotify instances
516 .\"O that can be created per real user ID.
517 1 つの実ユーザ ID に対して生成できる
518 inotify インスタンスの数の上限を指定する。
519 .TP
520 .I /proc/sys/fs/inotify/max_user_watches
521 .\"O This specifies an upper limit on the number of watches
522 .\"O that can be created per real user ID.
523 作成可能な監視対象の数の実 UID 単位の上限を指定する。
524 .\"O .SH "VERSIONS"
525 .SH バージョン
526 .\"O Inotify was merged into the 2.6.13 Linux kernel.
527 .\"O The required library interfaces were added to glibc in version 2.4.
528 .\"O .RB ( IN_DONT_FOLLOW ,
529 .\"O .BR IN_MASK_ADD ,
530 .\"O and
531 .\"O .B IN_ONLYDIR
532 .\"O were only added in version 2.5.)
533 inotify は 2.6.13 の Linux カーネルに組込まれた。
534 これに必要なライブラリのインターフェースは、
535 glibc のバージョン 2.4 に追加された
536 .RB ( IN_DONT_FOLLOW ,
537 .BR IN_MASK_ADD ,
538 .B IN_ONLYDIR
539 だけはバージョン 2.5 で追加された)。
540 .\"O .SH "CONFORMING TO"
541 .SH 準拠
542 .\"O The inotify API is Linux-specific.
543 inotify API は Linux 独自のものである。
544 .\"O .SH "NOTES"
545 .SH 注意
546 .\"O Inotify file descriptors can be monitored using
547 .\"O .BR select (2),
548 .\"O .BR poll (2),
549 .\"O and
550 .\"O .BR epoll (7).
551 inotify ファイルディスクリプタは
552 .BR select (2),
553 .BR poll (2),
554 .BR epoll (7)
555 を使って監視できる。
556 .\"O When an event is available, the file descriptor indicates as readable.
557 イベントがある場合、ファイルディスクリプタは読み込み可能と通知する。
558
559 .\"O Since Linux 2.6.25,
560 .\"O signal-driven I/O notification is available for inotify file descriptors;
561 .\"O see the discussion of
562 .\"O .B F_SETFL
563 .\"O (for setting the
564 .\"O .B O_ASYNC
565 .\"O flag),
566 .\"O .BR F_SETOWN ,
567 .\"O and
568 .\"O .B F_SETSIG
569 .\"O in
570 .\"O .BR fcntl (2).
571 Linux 2.6.25 以降では、シグナル駆動 (signal-driven) I/O の通知が
572 inotify ファイルディスクリプタについて利用可能である。
573 .BR fcntl (2)
574 に書かれている
575 .RB ( O_ASYNC
576 フラグを設定するための)
577 .BR F_SETFL ,
578 .BR F_SETOWN ,
579 .B F_SETSIG
580 の議論を参照のこと。
581 .\"O The
582 .\"O .I siginfo_t
583 .\"O structure (described in
584 .\"O .BR sigaction (2))
585 .\"O that is passed to the signal handler has the following fields set:
586 .\"O .IR si_fd
587 .\"O is set to the inotify file descriptor number;
588 .\"O .IR si_signo
589 .\"O is set to the signal number;
590 .\"O .IR si_code
591 .\"O is set to
592 .\"O .BR POLL_IN ;
593 .\"O and
594 .\"O .B POLLIN
595 .\"O is set in
596 .\"O .IR si_band .
597 シグナルハンドラに渡される
598 .I siginfo_t
599 構造体は、以下のフィールドが設定される
600 .RI ( siginfo_t
601
602 .BR sigaction (2)
603 で説明されている)。
604 .I si_fd
605 には inotify ファイルディスクリプタ番号が、
606 .I si_signo
607 にはシグナル番号が、
608 .I si_code
609 には
610 .BR POLL_IN
611 が、
612 .I si_band
613 には
614 .B POLLIN
615 が設定される。
616
617 .\"O If successive output inotify events produced on the
618 .\"O inotify file descriptor are identical (same
619 .\"O .IR wd ,
620 .\"O .IR mask ,
621 .\"O .IR cookie ,
622 .\"O and
623 .\"O .IR name )
624 .\"O then they are coalesced into a single event if the
625 .\"O older event has not yet been read (but see BUGS).
626 inotify ファイルディスクリプタに対して
627 連続して生成される出力 inotify イベントが同一の場合
628 .RI ( wd ,
629 .IR mask ,
630 .IR cookie ,
631 .I name
632 が等しい場合)、
633 前のイベントがまだ読み込まれていなければ、
634 連続するイベントが 1 つのイベントにまとめられる
635 (ただし「バグ」の節も参照のこと)。
636
637 .\"O The events returned by reading from an inotify file descriptor
638 .\"O form an ordered queue.
639 .\"O Thus, for example, it is guaranteed that when renaming from
640 .\"O one directory to another, events will be produced in the
641 .\"O correct order on the inotify file descriptor.
642 .\"Osato:
643 .\"Osato: 以下の訳が上手くできていない気がする。
644 .\"Osato:
645 inotify ファイルディスクリプタの読み込みで返されるイベントは、
646 順序付けられたキューになる。
647 従って、たとえば、あるディレクトリの名前を別の名前に変更した場合、
648 inotify ファイルディスクリプタについての正しい順番で
649 イベントが生成されることが保証される。
650
651 .\"O The
652 .\"O .B FIONREAD
653 .\"O .BR ioctl (2)
654 .\"O returns the number of bytes available to read from an
655 .\"O inotify file descriptor.
656 .B FIONREAD
657 .BR ioctl (2)
658 は inotify ファイルディスクリプタから何バイト読み込めるかを返す。
659
660 .\"O Inotify monitoring of directories is not recursive:
661 .\"O to monitor subdirectories under a directory,
662 .\"O additional watches must be created.
663 inotify によるディレクトリの監視は再帰的に行われない:
664 あるディレクトリ以下のサブディレクトリを監視する場合、
665 監視対象を追加で作成しなければならない。
666 .\"O .SH "BUGS"
667 .SH バグ
668 .\"O In kernels before 2.6.16, the
669 .\"O .B IN_ONESHOT
670 .\"O .I mask
671 .\"O flag does not work.
672 2.6.16 以前のカーネルでは
673 .B IN_ONESHOT
674 .I mask
675 フラグが働かない。
676
677 .\"O Before kernel 2.6.25,
678 .\"O the kernel code that was intended to coalesce successive identical events
679 .\"O (i.e., the two most recent events could potentially be coalesced
680 .\"O if the older had not yet been read)
681 .\"O instead checked if the most recent event could be coalesced with the
682 .\"O .I oldest
683 .\"O unread event.
684 カーネル 2.6.25 より前では、
685 連続する同一のイベントを一つにまとめることを意図したコード
686 (古い方のイベントがまだ読み込まれていない場合に、
687 最新の 2 つのイベントを一つにまとめられる可能性がある) が、
688 最新のイベントが「最も古い」読み込まれていないイベントとまとめられるか
689 をチェックするようになっていた。
690 .\"O .SH "SEE ALSO"
691 .SH 関連項目
692 .BR inotify_add_watch (2),
693 .BR inotify_init (2),
694 .BR inotify_init1 (2),
695 .BR inotify_rm_watch (2),
696 .BR read (2),
697 .BR stat (2),
698 .IR Documentation/filesystems/inotify.txt .