1INOTIFY_INIT(2)            Linux Programmer's Manual           INOTIFY_INIT(2)
2
3
4

NAME

6       inotify_init, inotify_init1 - initialize an inotify instance
7

SYNOPSIS

9       #include <sys/inotify.h>
10
11       int inotify_init(void);
12       int inotify_init1(int flags);
13

DESCRIPTION

15       For an overview of the inotify API, see inotify(7).
16
17       inotify_init()  initializes  a  new inotify instance and returns a file
18       descriptor associated with a new inotify event queue.
19
20       If flags is 0, then inotify_init1() is the same as inotify_init().  The
21       following  values  can  be  bitwise  ORed  in flags to obtain different
22       behavior:
23
24       IN_NONBLOCK Set the O_NONBLOCK  file  status  flag  on  the  open  file
25                   description  (see  open(2))  referred  to  by  the new file
26                   descriptor.  Using this flag saves extra calls to  fcntl(2)
27                   to achieve the same result.
28
29       IN_CLOEXEC  Set  the  close-on-exec  (FD_CLOEXEC)  flag on the new file
30                   descriptor.  See the description of the O_CLOEXEC  flag  in
31                   open(2) for reasons why this may be useful.
32

RETURN VALUE

34       On success, these system calls return a new file descriptor.  On error,
35       -1 is returned, and errno is set to indicate the error.
36

ERRORS

38       EINVAL (inotify_init1()) An invalid value was specified in flags.
39
40       EMFILE The user limit on the total number of inotify instances has been
41              reached.
42
43       EMFILE The per-process limit on the number of open file descriptors has
44              been reached.
45
46       ENFILE The system-wide limit on the total number of open files has been
47              reached.
48
49       ENOMEM Insufficient kernel memory is available.
50

VERSIONS

52       inotify_init()  first  appeared  in  Linux  2.6.13; library support was
53       added to glibc in version 2.4.   inotify_init1()  was  added  in  Linux
54       2.6.27; library support was added to glibc in version 2.9.
55

CONFORMING TO

57       These system calls are Linux-specific.
58

SEE ALSO

60       inotify_add_watch(2), inotify_rm_watch(2), inotify(7)
61

COLOPHON

63       This  page  is  part of release 5.04 of the Linux man-pages project.  A
64       description of the project, information about reporting bugs,  and  the
65       latest     version     of     this    page,    can    be    found    at
66       https://www.kernel.org/doc/man-pages/.
67
68
69
70Linux                             2019-03-06                   INOTIFY_INIT(2)
Impressum