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  new  open  file
25                   description.  Using this flag saves extra calls to fcntl(2)
26                   to achieve the same result.
27
28       IN_CLOEXEC  Set the close-on-exec (FD_CLOEXEC) flag  on  the  new  file
29                   descriptor.   See  the description of the O_CLOEXEC flag in
30                   open(2) for reasons why this may be useful.
31

RETURN VALUE

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

ERRORS

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

VERSIONS

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

CONFORMING TO

56       These system calls are Linux-specific.
57

SEE ALSO

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

COLOPHON

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