1 .\" Copyright (C) 2005 Robert Love
2 .\" and Copyright (C) 2008, Michael Kerrisk <mtk.manpages@gmail.com>
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.
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.
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.
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/>.
25 .\" 2005-07-19 Robert Love <rlove@rlove.org> - initial version
26 .\" 2006-02-07 mtk, minor changes
27 .\" 2008-10-10 mtk: add description of inotify_init1()
29 .TH INOTIFY_INIT 2 2020-04-11 "Linux" "Linux Programmer's Manual"
31 inotify_init, inotify_init1 \- initialize an inotify instance
34 .B #include <sys/inotify.h>
36 .B "int inotify_init(void);"
37 .BI "int inotify_init1(int " flags );
40 For an overview of the inotify API, see
44 initializes a new inotify instance and returns a file descriptor associated
45 with a new inotify event queue.
53 The following values can be bitwise ORed in
55 to obtain different behavior:
60 file status flag on the open file description (see
62 referred to by the new file descriptor.
63 Using this flag saves extra calls to
65 to achieve the same result.
70 flag on the new file descriptor.
71 See the description of the
75 for reasons why this may be useful.
77 On success, these system calls return a new file descriptor.
78 On error, \-1 is returned, and
80 is set to indicate the error.
84 .RB ( inotify_init1 ())
85 An invalid value was specified in
89 The user limit on the total number of inotify instances has been reached.
92 The per-process limit on the number of open file descriptors has been reached.
95 The system-wide limit on the total number of open files has been reached.
98 Insufficient kernel memory is available.
101 first appeared in Linux 2.6.13;
102 library support was added to glibc in version 2.4.
104 was added in Linux 2.6.27;
105 library support was added to glibc in version 2.9.
107 These system calls are Linux-specific.
109 .BR inotify_add_watch (2),
110 .BR inotify_rm_watch (2),