1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef _UAPI_LINUX_WATCH_QUEUE_H 20 #define _UAPI_LINUX_WATCH_QUEUE_H 21 #include <linux/types.h> 22 #include <linux/fcntl.h> 23 #include <linux/ioctl.h> 24 #define O_NOTIFICATION_PIPE O_EXCL 25 #define IOC_WATCH_QUEUE_SET_SIZE _IO('W', 0x60) 26 #define IOC_WATCH_QUEUE_SET_FILTER _IO('W', 0x61) 27 enum watch_notification_type { 28 WATCH_TYPE_META = 0, 29 WATCH_TYPE_KEY_NOTIFY = 1, 30 WATCH_TYPE__NR = 2 31 }; 32 enum watch_meta_notification_subtype { 33 WATCH_META_REMOVAL_NOTIFICATION = 0, 34 WATCH_META_LOSS_NOTIFICATION = 1, 35 }; 36 struct watch_notification { 37 __u32 type : 24; 38 __u32 subtype : 8; 39 __u32 info; 40 #define WATCH_INFO_LENGTH 0x0000007f 41 #define WATCH_INFO_LENGTH__SHIFT 0 42 #define WATCH_INFO_ID 0x0000ff00 43 #define WATCH_INFO_ID__SHIFT 8 44 #define WATCH_INFO_TYPE_INFO 0xffff0000 45 #define WATCH_INFO_TYPE_INFO__SHIFT 16 46 #define WATCH_INFO_FLAG_0 0x00010000 47 #define WATCH_INFO_FLAG_1 0x00020000 48 #define WATCH_INFO_FLAG_2 0x00040000 49 #define WATCH_INFO_FLAG_3 0x00080000 50 #define WATCH_INFO_FLAG_4 0x00100000 51 #define WATCH_INFO_FLAG_5 0x00200000 52 #define WATCH_INFO_FLAG_6 0x00400000 53 #define WATCH_INFO_FLAG_7 0x00800000 54 }; 55 struct watch_notification_type_filter { 56 __u32 type; 57 __u32 info_filter; 58 __u32 info_mask; 59 __u32 subtype_filter[8]; 60 }; 61 struct watch_notification_filter { 62 __u32 nr_filters; 63 __u32 __reserved; 64 struct watch_notification_type_filter filters[]; 65 }; 66 struct watch_notification_removal { 67 struct watch_notification watch; 68 __u64 id; 69 }; 70 enum key_notification_subtype { 71 NOTIFY_KEY_INSTANTIATED = 0, 72 NOTIFY_KEY_UPDATED = 1, 73 NOTIFY_KEY_LINKED = 2, 74 NOTIFY_KEY_UNLINKED = 3, 75 NOTIFY_KEY_CLEARED = 4, 76 NOTIFY_KEY_REVOKED = 5, 77 NOTIFY_KEY_INVALIDATED = 6, 78 NOTIFY_KEY_SETATTR = 7, 79 }; 80 struct key_notification { 81 struct watch_notification watch; 82 __u32 key_id; 83 __u32 aux; 84 }; 85 #endif 86