1 .\" man2/inotify_add_watch.2 - inotify_add_watch man page
3 .\" Copyright (C) 2005 Robert Love
4 .\" and Copyright, 2006 Michael Kerrisk
6 .\" This is free documentation; you can redistribute it and/or
7 .\" modify it under the terms of the GNU General Public License as
8 .\" published by the Free Software Foundation; either version 2 of
9 .\" the License, or (at your option) any later version.
11 .\" The GNU General Public License's references to "object code"
12 .\" and "executables" are to be interpreted as the output of any
13 .\" document formatting or typesetting system, including
14 .\" intermediate and printed output.
16 .\" This manual is distributed in the hope that it will be useful,
17 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
18 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 .\" GNU General Public License for more details.
21 .\" You should have received a copy of the GNU General Public
22 .\" License along with this manual; if not, write to the Free
23 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
26 .\" 2005-07-19 Robert Love <rlove@rlove.org> - initial version
27 .\" 2006-02-07 mtk, various changes
29 .\" Japanese Version Copyright (c) 2006 Akihiro MOTOKI
30 .\" all rights reserved.
31 .\" Translated 2006-08-15, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.39
33 .TH INOTIFY_ADD_WATCH 2 2006-02-07 "Linux" "Linux Programmer's Manual"
35 inotify_add_watch \- ½é´ü²½ºÑ¤ß inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ë´Æ»ëÂоݤòÄɲ乤ë
37 .B #include <sys/inotify.h>
39 .BI "int inotify_add_watch(int " fd ", const char *" pathname ", uint32_t " mask );
41 .BR inotify_add_watch ()
44 ¤Ç»ØÄꤵ¤ì¤¿°ÌÃ֤ˤ¢¤ë¥Õ¥¡¥¤¥ë¤ò´Æ»ë¤¹¤ë´Æ»ë¥¢¥¤¥Æ¥à (watch) ¤Î¿·µ¬Äɲá¢
45 ¤Þ¤¿¤Ï´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤ÎÊѹ¹¤ò¹Ô¤¦¡£
46 ¸Æ¤Ó½Ð¤·¸µ¤Ï¡¢´Æ»ëÂоݤΥե¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·µö²Ä¤ò
47 »ý¤Ã¤Æ¤¤¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
49 °ú¤¿ô¤Ï¡¢Êѹ¹¤ò¹Ô¤¦´Æ»ëÂоݥꥹ¥È (watch list) ¤ò»ý¤Ä inotify
50 ¥¤¥ó¥¹¥¿¥ó¥¹¤ò»²¾È¤¹¤ë¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤¢¤ë¡£
52 ¤Î¤É¤Î¥¤¥Ù¥ó¥È¤ò´Æ»ë¤¹¤ë¤«¤Ï¡¢°ú¤¿ô¤Î¥Ó¥Ã¥È¥Þ¥¹¥¯
56 ¤ËÀßÄê¤Ç¤¤ë¥Ó¥Ã¥È¤ÎÀâÌÀ¤Ë¤Ä¤¤¤Æ¤Ï
60 .BR inotify_add_watch ()
61 ¤Î¸Æ¤Ó½Ð¤·¤¬À®¸ù¤¹¤ë¤È¡¢Êѹ¹ÂоݤΠinotify ¥¤¥ó¥¹¥¿¥ó¥¹¤Ç
63 ¤ËÂбþÉÕ¤±¤é¤ì¤ë°ì°Õ¤Ê´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿ (watch descriptor) ¤òÊÖ¤¹¡£
65 ¤¬¤½¤Î inotify ¥¤¥ó¥¹¥¿¥ó¥¹¤ËÄɲ䵤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢
66 ´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤¬¿·µ¬¤Ë³ä¤êÅö¤Æ¤é¤ì¤ë¡£
68 ¤¬¤¹¤Ç¤Ë´Æ»ëÂоݤˤʤäƤ¤¤ì¤Ð¡¢´û¸¤Î´Æ»ë¥¢¥¤¥Æ¥à¤ËÂФ¹¤ë
69 ¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£
71 ¤³¤ì°Ê¹ß¤Ë inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤«¤é
73 ¤ò¹Ô¤¦¤È¡¢´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤¬ÊÖ¤µ¤ì¤ë¡£
76 ¤ò¹Ô¤¦¤È¡¢¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥¤¥Ù¥ó¥È¤ò¼¨¤¹
80 »²¾È)¡£¤³¤Î¹½Â¤ÂÎÆâ¤Î´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤Ë¤è¤ê¡¢
81 ¤É¤Î¥ª¥Ö¥¸¥§¥¯¥È¤Ç¤½¤Î¥¤¥Ù¥ó¥È¤¬È¯À¸¤·¤¿¤«¤òÆÃÄê¤Ç¤¤ë¡£
84 .BR inotify_add_watch ()
85 ¤ÏÈóÉé¤Î´Æ»ëÂоݥǥ£¥¹¥¯¥ê¥×¥¿¤òÊÖ¤¹¡£
86 ¥¨¥é¡¼¤Î¾ì¹ç¡¢\-1 ¤òÊÖ¤·¡¢
92 »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤ËÂФ¹¤ëÆɤ߽Ф·¥¢¥¯¥»¥¹¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¡£
95 »ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤¬Í¸ú¤Ç¤Ï¤Ê¤¤¡£
99 ¤¬»Ø¤¹¥¢¥É¥ì¥¹¤¬¥×¥í¥»¥¹¤¬¥¢¥¯¥»¥¹¤Ç¤¤ë¥¢¥É¥ì¥¹¶õ´Ö³°¤Ç¤¢¤ë¡£
102 »ØÄꤵ¤ì¤¿¥¤¥Ù¥ó¥È¥Þ¥¹¥¯¤Ë͸ú¤Ê¥¤¥Ù¥ó¥È¤¬´Þ¤Þ¤ì¤Æ¤¤¤Ê¤¤¡£
105 ¤¬ inotify ¥Õ¥¡¥¤¥ë¥Ç¥£¥¹¥¯¥ê¥×¥¿¤Ç¤Ï¤Ê¤¤¡£
108 ¥«¡¼¥Í¥ë¥á¥â¥ê¤¬½½Ê¬¤Ë¤Ê¤«¤Ã¤¿¡£
111 inotify ´Æ»ëÂоݤÎÁí¿ô¤¬¥æ¡¼¥¶¤¬ÄɲäǤ¤ë¾å¸Â¤Ë㤷¤Æ¤¤¤¿¡£
112 ¤â¤·¤¯¤Ï¡¢É¬Íפʻñ¸»¤Î³ä¤êÅö¤Æ¤Ë¥«¡¼¥Í¥ë¤¬¼ºÇÔ¤·¤¿¡£
114 inotify ¤Ï Linux ¥«¡¼¥Í¥ë 2.6.13 ¤ËÁȤ߹þ¤Þ¤ì¤¿¡£
116 ¤³¤Î¥·¥¹¥Æ¥à¥³¡¼¥ë¤Ï Linux Æȼ«¤Ç¤¢¤ë¡£
118 .BR inotify_init (2),
119 .BR inotify_rm_watch (2),