1 .\" Copyright (C) 2005 Robert Love
2 .\" and Copyright (C) 2008, Michael Kerrisk <mtk.manpages@gmail.com>
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" 2005-07-19 Robert Love <rlove@rlove.org> - initial version
7 .\" 2006-02-07 mtk, minor changes
8 .\" 2008-10-10 mtk: add description of inotify_init1()
10 .TH INOTIFY_INIT 2 2020-04-11 "Linux man-pages (unreleased)"
12 inotify_init, inotify_init1 \- initialize an inotify instance
15 .RI ( libc ", " \-lc )
18 .B #include <sys/inotify.h>
20 .B "int inotify_init(void);"
21 .BI "int inotify_init1(int " flags );
24 For an overview of the inotify API, see
28 initializes a new inotify instance and returns a file descriptor associated
29 with a new inotify event queue.
37 The following values can be bitwise ORed in
39 to obtain different behavior:
44 file status flag on the open file description (see
46 referred to by the new file descriptor.
47 Using this flag saves extra calls to
49 to achieve the same result.
54 flag on the new file descriptor.
55 See the description of the
59 for reasons why this may be useful.
61 On success, these system calls return a new file descriptor.
62 On error, \-1 is returned, and
64 is set to indicate the error.
68 .RB ( inotify_init1 ())
69 An invalid value was specified in
73 The user limit on the total number of inotify instances has been reached.
76 The per-process limit on the number of open file descriptors has been reached.
79 The system-wide limit on the total number of open files has been reached.
82 Insufficient kernel memory is available.
85 first appeared in Linux 2.6.13;
86 library support was added to glibc in version 2.4.
88 was added in Linux 2.6.27;
89 library support was added to glibc in version 2.9.
91 These system calls are Linux-specific.
93 .BR inotify_add_watch (2),
94 .BR inotify_rm_watch (2),