122851890Sopenharmony_ci/****************************************************************************
222851890Sopenharmony_ci ****************************************************************************
322851890Sopenharmony_ci ***
422851890Sopenharmony_ci ***   This header was automatically generated from a Linux kernel header
522851890Sopenharmony_ci ***   of the same name, to make information necessary for userspace to
622851890Sopenharmony_ci ***   call into the kernel available to libc.  It contains only constants,
722851890Sopenharmony_ci ***   structures, and macros generated from the original header, and thus,
822851890Sopenharmony_ci ***   contains no copyrightable information.
922851890Sopenharmony_ci ***
1022851890Sopenharmony_ci ***   To edit the content of this header, modify the corresponding
1122851890Sopenharmony_ci ***   source file (e.g. under external/kernel-headers/original/) then
1222851890Sopenharmony_ci ***   run bionic/libc/kernel/tools/update_all.py
1322851890Sopenharmony_ci ***
1422851890Sopenharmony_ci ***   Any manual change here will be lost the next time this script will
1522851890Sopenharmony_ci ***   be run. You've been warned!
1622851890Sopenharmony_ci ***
1722851890Sopenharmony_ci ****************************************************************************
1822851890Sopenharmony_ci ****************************************************************************/
1922851890Sopenharmony_ci#ifndef _UAPI_LINUX_FANOTIFY_H
2022851890Sopenharmony_ci#define _UAPI_LINUX_FANOTIFY_H
2122851890Sopenharmony_ci#include <linux/types.h>
2222851890Sopenharmony_ci#define FAN_ACCESS 0x00000001
2322851890Sopenharmony_ci#define FAN_MODIFY 0x00000002
2422851890Sopenharmony_ci#define FAN_ATTRIB 0x00000004
2522851890Sopenharmony_ci#define FAN_CLOSE_WRITE 0x00000008
2622851890Sopenharmony_ci#define FAN_CLOSE_NOWRITE 0x00000010
2722851890Sopenharmony_ci#define FAN_OPEN 0x00000020
2822851890Sopenharmony_ci#define FAN_MOVED_FROM 0x00000040
2922851890Sopenharmony_ci#define FAN_MOVED_TO 0x00000080
3022851890Sopenharmony_ci#define FAN_CREATE 0x00000100
3122851890Sopenharmony_ci#define FAN_DELETE 0x00000200
3222851890Sopenharmony_ci#define FAN_DELETE_SELF 0x00000400
3322851890Sopenharmony_ci#define FAN_MOVE_SELF 0x00000800
3422851890Sopenharmony_ci#define FAN_OPEN_EXEC 0x00001000
3522851890Sopenharmony_ci#define FAN_Q_OVERFLOW 0x00004000
3622851890Sopenharmony_ci#define FAN_OPEN_PERM 0x00010000
3722851890Sopenharmony_ci#define FAN_ACCESS_PERM 0x00020000
3822851890Sopenharmony_ci#define FAN_OPEN_EXEC_PERM 0x00040000
3922851890Sopenharmony_ci#define FAN_EVENT_ON_CHILD 0x08000000
4022851890Sopenharmony_ci#define FAN_ONDIR 0x40000000
4122851890Sopenharmony_ci#define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE)
4222851890Sopenharmony_ci#define FAN_MOVE (FAN_MOVED_FROM | FAN_MOVED_TO)
4322851890Sopenharmony_ci#define FAN_CLOEXEC 0x00000001
4422851890Sopenharmony_ci#define FAN_NONBLOCK 0x00000002
4522851890Sopenharmony_ci#define FAN_CLASS_NOTIF 0x00000000
4622851890Sopenharmony_ci#define FAN_CLASS_CONTENT 0x00000004
4722851890Sopenharmony_ci#define FAN_CLASS_PRE_CONTENT 0x00000008
4822851890Sopenharmony_ci#define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT)
4922851890Sopenharmony_ci#define FAN_UNLIMITED_QUEUE 0x00000010
5022851890Sopenharmony_ci#define FAN_UNLIMITED_MARKS 0x00000020
5122851890Sopenharmony_ci#define FAN_ENABLE_AUDIT 0x00000040
5222851890Sopenharmony_ci#define FAN_REPORT_TID 0x00000100
5322851890Sopenharmony_ci#define FAN_REPORT_FID 0x00000200
5422851890Sopenharmony_ci#define FAN_REPORT_DIR_FID 0x00000400
5522851890Sopenharmony_ci#define FAN_REPORT_NAME 0x00000800
5622851890Sopenharmony_ci#define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME)
5722851890Sopenharmony_ci#define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE | FAN_UNLIMITED_MARKS)
5822851890Sopenharmony_ci#define FAN_MARK_ADD 0x00000001
5922851890Sopenharmony_ci#define FAN_MARK_REMOVE 0x00000002
6022851890Sopenharmony_ci#define FAN_MARK_DONT_FOLLOW 0x00000004
6122851890Sopenharmony_ci#define FAN_MARK_ONLYDIR 0x00000008
6222851890Sopenharmony_ci#define FAN_MARK_IGNORED_MASK 0x00000020
6322851890Sopenharmony_ci#define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040
6422851890Sopenharmony_ci#define FAN_MARK_FLUSH 0x00000080
6522851890Sopenharmony_ci#define FAN_MARK_INODE 0x00000000
6622851890Sopenharmony_ci#define FAN_MARK_MOUNT 0x00000010
6722851890Sopenharmony_ci#define FAN_MARK_FILESYSTEM 0x00000100
6822851890Sopenharmony_ci#define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD | FAN_MARK_REMOVE | FAN_MARK_DONT_FOLLOW | FAN_MARK_ONLYDIR | FAN_MARK_MOUNT | FAN_MARK_IGNORED_MASK | FAN_MARK_IGNORED_SURV_MODIFY | FAN_MARK_FLUSH)
6922851890Sopenharmony_ci#define FAN_ALL_EVENTS (FAN_ACCESS | FAN_MODIFY | FAN_CLOSE | FAN_OPEN)
7022851890Sopenharmony_ci#define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM | FAN_ACCESS_PERM)
7122851890Sopenharmony_ci#define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS | FAN_ALL_PERM_EVENTS | FAN_Q_OVERFLOW)
7222851890Sopenharmony_ci#define FANOTIFY_METADATA_VERSION 3
7322851890Sopenharmony_cistruct fanotify_event_metadata {
7422851890Sopenharmony_ci  __u32 event_len;
7522851890Sopenharmony_ci  __u8 vers;
7622851890Sopenharmony_ci  __u8 reserved;
7722851890Sopenharmony_ci  __u16 metadata_len;
7822851890Sopenharmony_ci  __aligned_u64 mask;
7922851890Sopenharmony_ci  __s32 fd;
8022851890Sopenharmony_ci  __s32 pid;
8122851890Sopenharmony_ci};
8222851890Sopenharmony_ci#define FAN_EVENT_INFO_TYPE_FID 1
8322851890Sopenharmony_ci#define FAN_EVENT_INFO_TYPE_DFID_NAME 2
8422851890Sopenharmony_ci#define FAN_EVENT_INFO_TYPE_DFID 3
8522851890Sopenharmony_cistruct fanotify_event_info_header {
8622851890Sopenharmony_ci  __u8 info_type;
8722851890Sopenharmony_ci  __u8 pad;
8822851890Sopenharmony_ci  __u16 len;
8922851890Sopenharmony_ci};
9022851890Sopenharmony_cistruct fanotify_event_info_fid {
9122851890Sopenharmony_ci  struct fanotify_event_info_header hdr;
9222851890Sopenharmony_ci  __kernel_fsid_t fsid;
9322851890Sopenharmony_ci  unsigned char handle[0];
9422851890Sopenharmony_ci};
9522851890Sopenharmony_cistruct fanotify_response {
9622851890Sopenharmony_ci  __s32 fd;
9722851890Sopenharmony_ci  __u32 response;
9822851890Sopenharmony_ci};
9922851890Sopenharmony_ci#define FAN_ALLOW 0x01
10022851890Sopenharmony_ci#define FAN_DENY 0x02
10122851890Sopenharmony_ci#define FAN_AUDIT 0x10
10222851890Sopenharmony_ci#define FAN_NOFD - 1
10322851890Sopenharmony_ci#define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata))
10422851890Sopenharmony_ci#define FAN_EVENT_NEXT(meta,len) ((len) -= (meta)->event_len, (struct fanotify_event_metadata *) (((char *) (meta)) + (meta)->event_len))
10522851890Sopenharmony_ci#define FAN_EVENT_OK(meta,len) ((long) (len) >= (long) FAN_EVENT_METADATA_LEN && (long) (meta)->event_len >= (long) FAN_EVENT_METADATA_LEN && (long) (meta)->event_len <= (long) (len))
10622851890Sopenharmony_ci#endif
107