forked from luck/tmp_suning_uos_patched
52c923dd07
NAME fanotify_init - initialize an fanotify group SYNOPSIS int fanotify_init(unsigned int flags, unsigned int event_f_flags, int priority); DESCRIPTION fanotify_init() initializes a new fanotify instance and returns a file descriptor associated with the new fanotify event queue. The following values can be OR'd into the flags field: FAN_NONBLOCK Set the O_NONBLOCK file status flag on the new open file description. Using this flag saves extra calls to fcntl(2) to achieve the same result. FAN_CLOEXEC Set the close-on-exec (FD_CLOEXEC) flag on the new file descriptor. See the description of the O_CLOEXEC flag in open(2) for reasons why this may be useful. The event_f_flags argument is unused and must be set to 0 The priority argument is unused and must be set to 0 RETURN VALUE On success, this system call return a new file descriptor. On error, -1 is returned, and errno is set to indicate the error. ERRORS EINVAL An invalid value was specified in flags. EINVAL A non-zero valid was passed in event_f_flags or in priority ENFILE The system limit on the total number of file descriptors has been reached. ENOMEM Insufficient kernel memory is available. CONFORMING TO These system calls are Linux-specific. Signed-off-by: Eric Paris <eparis@redhat.com>
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
#ifndef _LINUX_FANOTIFY_H
|
|
#define _LINUX_FANOTIFY_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
/* the following events that user-space can register for */
|
|
#define FAN_ACCESS 0x00000001 /* File was accessed */
|
|
#define FAN_MODIFY 0x00000002 /* File was modified */
|
|
#define FAN_CLOSE_WRITE 0x00000008 /* Unwrittable file closed */
|
|
#define FAN_CLOSE_NOWRITE 0x00000010 /* Writtable file closed */
|
|
#define FAN_OPEN 0x00000020 /* File was opened */
|
|
|
|
#define FAN_EVENT_ON_CHILD 0x08000000 /* interested in child events */
|
|
|
|
/* FIXME currently Q's have no limit.... */
|
|
#define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */
|
|
|
|
/* helper events */
|
|
#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */
|
|
|
|
#define FAN_CLOEXEC 0x00000001
|
|
#define FAN_NONBLOCK 0x00000002
|
|
|
|
#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK)
|
|
/*
|
|
* All of the events - we build the list by hand so that we can add flags in
|
|
* the future and not break backward compatibility. Apps will get only the
|
|
* events that they originally wanted. Be sure to add new events here!
|
|
*/
|
|
#define FAN_ALL_EVENTS (FAN_ACCESS |\
|
|
FAN_MODIFY |\
|
|
FAN_CLOSE |\
|
|
FAN_OPEN)
|
|
|
|
/*
|
|
* All legal FAN bits userspace can request (although possibly not all
|
|
* at the same time.
|
|
*/
|
|
#define FAN_ALL_INCOMING_EVENTS (FAN_ALL_EVENTS |\
|
|
FAN_EVENT_ON_CHILD)
|
|
#ifdef __KERNEL__
|
|
|
|
#endif /* __KERNEL__ */
|
|
#endif /* _LINUX_FANOTIFY_H */
|