]>
Commit | Line | Data |
---|---|---|
4d2b74dd | 1 | .\" Copyright (C) 2005 Robert Love |
e5c75695 | 2 | .\" and Copyright (C) 2008, Michael Kerrisk <mtk.manpages@gmail.com> |
4d2b74dd | 3 | .\" |
1dd72f9c | 4 | .\" %%%LICENSE_START(GPLv2+_DOC_FULL) |
4d2b74dd MK |
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 | |
c715f741 MK |
21 | .\" License along with this manual; if not, see |
22 | .\" <http://www.gnu.org/licenses/>. | |
6a8d8745 | 23 | .\" %%%LICENSE_END |
4d2b74dd MK |
24 | .\" |
25 | .\" 2005-07-19 Robert Love <rlove@rlove.org> - initial version | |
26 | .\" 2006-02-07 mtk, minor changes | |
ef4d5ffd | 27 | .\" 2008-10-10 mtk: add description of inotify_init1() |
4d2b74dd | 28 | .\" |
e8426ca2 | 29 | .TH INOTIFY_INIT 2 2020-04-11 "Linux" "Linux Programmer's Manual" |
4d2b74dd | 30 | .SH NAME |
ef4d5ffd | 31 | inotify_init, inotify_init1 \- initialize an inotify instance |
4d2b74dd | 32 | .SH SYNOPSIS |
ef4d5ffd | 33 | .nf |
6e969f22 | 34 | .B #include <sys/inotify.h> |
68e4db0a | 35 | .PP |
0daa9e92 | 36 | .B "int inotify_init(void);" |
ef4d5ffd MK |
37 | .BI "int inotify_init1(int " flags ); |
38 | .fi | |
4d2b74dd | 39 | .SH DESCRIPTION |
41d9a4af MK |
40 | For an overview of the inotify API, see |
41 | .BR inotify (7). | |
efeece04 | 42 | .PP |
4d2b74dd MK |
43 | .BR inotify_init () |
44 | initializes a new inotify instance and returns a file descriptor associated | |
45 | with a new inotify event queue. | |
efeece04 | 46 | .PP |
ef4d5ffd MK |
47 | If |
48 | .I flags | |
49 | is 0, then | |
50 | .BR inotify_init1 () | |
51 | is the same as | |
52 | .BR inotify_init (). | |
53 | The following values can be bitwise ORed in | |
54 | .IR flags | |
55 | to obtain different behavior: | |
0019177e | 56 | .TP |
ef4d5ffd MK |
57 | .B IN_NONBLOCK |
58 | Set the | |
59 | .BR O_NONBLOCK | |
7f11e32c MK |
60 | file status flag on the open file description (see |
61 | .BR open (2)) | |
62 | referred to by the new file descriptor. | |
ef4d5ffd | 63 | Using this flag saves extra calls to |
ef7db4f5 | 64 | .BR fcntl (2) |
ef4d5ffd MK |
65 | to achieve the same result. |
66 | .TP | |
67 | .B IN_CLOEXEC | |
68 | Set the close-on-exec | |
51d61866 | 69 | .RB ( FD_CLOEXEC ) |
ef4d5ffd | 70 | flag on the new file descriptor. |
c5571b61 | 71 | See the description of the |
ef4d5ffd MK |
72 | .B O_CLOEXEC |
73 | flag in | |
74 | .BR open (2) | |
75 | for reasons why this may be useful. | |
47297adb | 76 | .SH RETURN VALUE |
ef4d5ffd MK |
77 | On success, these system calls return a new file descriptor. |
78 | On error, \-1 is returned, and | |
4d2b74dd | 79 | .I errno |
ef4d5ffd | 80 | is set to indicate the error. |
4d2b74dd MK |
81 | .SH ERRORS |
82 | .TP | |
ef4d5ffd MK |
83 | .B EINVAL |
84 | .RB ( inotify_init1 ()) | |
85 | An invalid value was specified in | |
86 | .IR flags . | |
87 | .TP | |
4d2b74dd MK |
88 | .B EMFILE |
89 | The user limit on the total number of inotify instances has been reached. | |
90 | .TP | |
78d8b29e MK |
91 | .B EMFILE |
92 | The per-process limit on the number of open file descriptors has been reached. | |
93 | .TP | |
4d2b74dd | 94 | .B ENFILE |
e258766b | 95 | The system-wide limit on the total number of open files has been reached. |
4d2b74dd MK |
96 | .TP |
97 | .B ENOMEM | |
98 | Insufficient kernel memory is available. | |
ff457ccb | 99 | .SH VERSIONS |
ef4d5ffd | 100 | .BR inotify_init () |
982ff543 | 101 | first appeared in Linux 2.6.13; |
80657327 | 102 | library support was added to glibc in version 2.4. |
ef4d5ffd | 103 | .BR inotify_init1 () |
c95b6ae1 | 104 | was added in Linux 2.6.27; |
80657327 | 105 | library support was added to glibc in version 2.9. |
47297adb | 106 | .SH CONFORMING TO |
ef4d5ffd | 107 | These system calls are Linux-specific. |
47297adb | 108 | .SH SEE ALSO |
4d2b74dd | 109 | .BR inotify_add_watch (2), |
c13182ef | 110 | .BR inotify_rm_watch (2), |
ccd2b351 | 111 | .BR inotify (7) |