]>
Commit | Line | Data |
---|---|---|
4d2b74dd | 1 | .\" Copyright (C) 2005 Robert Love |
e5c75695 | 2 | .\" and Copyright (C) 2008, Michael Kerrisk <mtk.manpages@gmail.com> |
4d2b74dd | 3 | .\" |
e4a74ca8 | 4 | .\" SPDX-License-Identifier: GPL-2.0-or-later |
4d2b74dd MK |
5 | .\" |
6 | .\" 2005-07-19 Robert Love <rlove@rlove.org> - initial version | |
7 | .\" 2006-02-07 mtk, minor changes | |
ef4d5ffd | 8 | .\" 2008-10-10 mtk: add description of inotify_init1() |
4d2b74dd | 9 | .\" |
4c1c5274 | 10 | .TH inotify_init 2 (date) "Linux man-pages (unreleased)" |
4d2b74dd | 11 | .SH NAME |
ef4d5ffd | 12 | inotify_init, inotify_init1 \- initialize an inotify instance |
66f137aa AC |
13 | .SH LIBRARY |
14 | Standard C library | |
8fc3b2cf | 15 | .RI ( libc ", " \-lc ) |
4d2b74dd | 16 | .SH SYNOPSIS |
ef4d5ffd | 17 | .nf |
6e969f22 | 18 | .B #include <sys/inotify.h> |
68e4db0a | 19 | .PP |
0daa9e92 | 20 | .B "int inotify_init(void);" |
ef4d5ffd MK |
21 | .BI "int inotify_init1(int " flags ); |
22 | .fi | |
4d2b74dd | 23 | .SH DESCRIPTION |
41d9a4af MK |
24 | For an overview of the inotify API, see |
25 | .BR inotify (7). | |
efeece04 | 26 | .PP |
4d2b74dd MK |
27 | .BR inotify_init () |
28 | initializes a new inotify instance and returns a file descriptor associated | |
29 | with a new inotify event queue. | |
efeece04 | 30 | .PP |
ef4d5ffd MK |
31 | If |
32 | .I flags | |
33 | is 0, then | |
34 | .BR inotify_init1 () | |
35 | is the same as | |
36 | .BR inotify_init (). | |
37 | The following values can be bitwise ORed in | |
1ae6b2c7 | 38 | .I flags |
ef4d5ffd | 39 | to obtain different behavior: |
0019177e | 40 | .TP |
ef4d5ffd MK |
41 | .B IN_NONBLOCK |
42 | Set the | |
1ae6b2c7 | 43 | .B O_NONBLOCK |
7f11e32c MK |
44 | file status flag on the open file description (see |
45 | .BR open (2)) | |
46 | referred to by the new file descriptor. | |
ef4d5ffd | 47 | Using this flag saves extra calls to |
ef7db4f5 | 48 | .BR fcntl (2) |
ef4d5ffd MK |
49 | to achieve the same result. |
50 | .TP | |
51 | .B IN_CLOEXEC | |
52 | Set the close-on-exec | |
51d61866 | 53 | .RB ( FD_CLOEXEC ) |
ef4d5ffd | 54 | flag on the new file descriptor. |
c5571b61 | 55 | See the description of the |
ef4d5ffd MK |
56 | .B O_CLOEXEC |
57 | flag in | |
58 | .BR open (2) | |
59 | for reasons why this may be useful. | |
47297adb | 60 | .SH RETURN VALUE |
ef4d5ffd MK |
61 | On success, these system calls return a new file descriptor. |
62 | On error, \-1 is returned, and | |
4d2b74dd | 63 | .I errno |
ef4d5ffd | 64 | is set to indicate the error. |
4d2b74dd MK |
65 | .SH ERRORS |
66 | .TP | |
ef4d5ffd MK |
67 | .B EINVAL |
68 | .RB ( inotify_init1 ()) | |
69 | An invalid value was specified in | |
70 | .IR flags . | |
71 | .TP | |
4d2b74dd MK |
72 | .B EMFILE |
73 | The user limit on the total number of inotify instances has been reached. | |
74 | .TP | |
78d8b29e MK |
75 | .B EMFILE |
76 | The per-process limit on the number of open file descriptors has been reached. | |
77 | .TP | |
4d2b74dd | 78 | .B ENFILE |
e258766b | 79 | The system-wide limit on the total number of open files has been reached. |
4d2b74dd MK |
80 | .TP |
81 | .B ENOMEM | |
82 | Insufficient kernel memory is available. | |
ff457ccb | 83 | .SH VERSIONS |
ef4d5ffd | 84 | .BR inotify_init () |
982ff543 | 85 | first appeared in Linux 2.6.13; |
80657327 | 86 | library support was added to glibc in version 2.4. |
ef4d5ffd | 87 | .BR inotify_init1 () |
c95b6ae1 | 88 | was added in Linux 2.6.27; |
80657327 | 89 | library support was added to glibc in version 2.9. |
3113c7f3 | 90 | .SH STANDARDS |
ef4d5ffd | 91 | These system calls are Linux-specific. |
47297adb | 92 | .SH SEE ALSO |
4d2b74dd | 93 | .BR inotify_add_watch (2), |
c13182ef | 94 | .BR inotify_rm_watch (2), |
ccd2b351 | 95 | .BR inotify (7) |