OSDN Git Service

8c862d5d124aa7dcbaaaa477cb5c6a9ee2b8c3fb
[linuxjm/LDP_man-pages.git] / release / man2 / inotify_add_watch.2
1 .\" Copyright (C) 2005 Robert Love
2 .\" and Copyright, 2006 Michael Kerrisk
3 .\"
4 .\" %%%LICENSE_START(GPLv2+_DOC_FULL)
5 .\" This is free documentation; you can redistribute it and/or
6 .\" modify it under the terms of the GNU General Public License as
7 .\" published by the Free Software Foundation; either version 2 of
8 .\" the License, or (at your option) any later version.
9 .\"
10 .\" The GNU General Public License's references to "object code"
11 .\" and "executables" are to be interpreted as the output of any
12 .\" document formatting or typesetting system, including
13 .\" intermediate and printed output.
14 .\"
15 .\" This manual is distributed in the hope that it will be useful,
16 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
17 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 .\" GNU General Public License for more details.
19 .\"
20 .\" You should have received a copy of the GNU General Public
21 .\" License along with this manual; if not, see
22 .\" <http://www.gnu.org/licenses/>.
23 .\" %%%LICENSE_END
24 .\"
25 .\" 2005-07-19 Robert Love <rlove@rlove.org> - initial version
26 .\" 2006-02-07 mtk, various changes
27 .\"
28 .\"*******************************************************************
29 .\"
30 .\" This file was generated with po4a. Translate the source file.
31 .\"
32 .\"*******************************************************************
33 .\"
34 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI
35 .\"         all rights reserved.
36 .\" Translated 2006-08-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.39
37 .\"
38 .TH INOTIFY_ADD_WATCH 2 2010\-10\-20 Linux "Linux Programmer's Manual"
39 .SH 名前
40 inotify_add_watch \- 初期化済み inotify インスタンスに監視対象を追加する
41 .SH 書式
42 \fB#include <sys/inotify.h>\fP
43 .sp
44 \fBint inotify_add_watch(int \fP\fIfd\fP\fB, const char *\fP\fIpathname\fP\fB, uint32_t
45 \fP\fImask\fP\fB);\fP
46 .SH 説明
47 \fBinotify_add_watch\fP()  は、 \fIpathname\fP で指定された位置にあるファイルを監視する監視アイテム (watch)
48 の新規追加、 または既存の監視アイテムの変更を行う。 呼び出し元は、監視対象のファイルに対する読み出し許可を 持っていなければならない。 \fIfd\fP
49 引き数は、変更を行う監視対象リスト (watch list) を持つ inotify インスタンスを参照するファイルディスクリプタである。
50 \fIpathname\fP のどのイベントを監視するかは、引き数のビットマスク \fImask\fP で指定する。 \fImask\fP
51 に設定できるビットの説明については \fBinotify\fP(7)  を参照のこと。
52
53 \fBinotify_add_watch\fP()  の呼び出しが成功すると、変更対象の inotify インスタンスで \fIpathname\fP
54 に対応付けられる一意な監視対象ディスクリプタ (watch descriptor) を返す。 \fIpathname\fP がその inotify
55 インスタンスに追加されていなければ、 監視対象ディスクリプタが新規に割り当てられる。 \fIpathname\fP
56 がすでに監視対象になっていれば、既存の監視アイテムに対する ディスクリプタが返される。
57
58 The watch descriptor is returned by later \fBread\fP(2)s from the inotify file
59 descriptor.  These reads fetch \fIinotify_event\fP structures (see
60 \fBinotify\fP(7))  indicating filesystem events; the watch descriptor inside
61 this structure identifies the object for which the event occurred.
62 .SH 返り値
63 成功すると、 \fBinotify_add_watch\fP()  は非負の監視対象ディスクリプタを返す。 エラーの場合、\-1 を返し、 \fIerrno\fP
64 を適切に設定する。
65 .SH エラー
66 .TP 
67 \fBEACCES\fP
68 指定されたファイルに対する読み出しアクセスが許可されていない。
69 .TP 
70 \fBEBADF\fP
71 指定されたファイルディスクリプタが有効ではない。
72 .TP 
73 \fBEFAULT\fP
74 \fIpathname\fP が指すアドレスがプロセスがアクセスできるアドレス空間外である。
75 .TP 
76 \fBEINVAL\fP
77 指定されたイベントマスクに有効なイベントが含まれていない。 もしくは \fIfd\fP が inotify ファイルディスクリプタではない。
78 .TP 
79 \fBENOENT\fP
80 \fIpathname\fP のディレクトリ部分の構成要素が、存在しないか、
81 リンク切れのシンボリックリンクである。
82 .TP 
83 \fBENOMEM\fP
84 カーネルメモリが十分になかった。
85 .TP 
86 \fBENOSPC\fP
87 inotify 監視対象の総数がユーザが追加できる上限に達していた。 もしくは、必要な資源の割り当てにカーネルが失敗した。
88 .SH バージョン
89 inotify は Linux カーネル 2.6.13 に組み込まれた。
90 .SH 準拠
91 このシステムコールは Linux 独自である。
92 .SH 関連項目
93 \fBinotify_init\fP(2), \fBinotify_rm_watch\fP(2), \fBinotify\fP(7)
94 .SH この文書について
95 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.54 の一部
96 である。プロジェクトの説明とバグ報告に関する情報は
97 http://www.kernel.org/doc/man\-pages/ に書かれている。