Elliott Hughes | 180edef | 2023-11-02 00:08:05 +0000 | [diff] [blame] | 1 | /* |
| 2 | * This file is auto-generated. Modifications will be lost. |
| 3 | * |
| 4 | * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/ |
| 5 | * for more information. |
| 6 | */ |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 7 | #ifndef _UAPI_LINUX_WATCH_QUEUE_H |
| 8 | #define _UAPI_LINUX_WATCH_QUEUE_H |
| 9 | #include <linux/types.h> |
| 10 | #include <linux/fcntl.h> |
| 11 | #include <linux/ioctl.h> |
| 12 | #define O_NOTIFICATION_PIPE O_EXCL |
| 13 | #define IOC_WATCH_QUEUE_SET_SIZE _IO('W', 0x60) |
| 14 | #define IOC_WATCH_QUEUE_SET_FILTER _IO('W', 0x61) |
| 15 | enum watch_notification_type { |
| 16 | WATCH_TYPE_META = 0, |
| 17 | WATCH_TYPE_KEY_NOTIFY = 1, |
| 18 | WATCH_TYPE__NR = 2 |
| 19 | }; |
| 20 | enum watch_meta_notification_subtype { |
| 21 | WATCH_META_REMOVAL_NOTIFICATION = 0, |
| 22 | WATCH_META_LOSS_NOTIFICATION = 1, |
| 23 | }; |
| 24 | struct watch_notification { |
| 25 | __u32 type : 24; |
| 26 | __u32 subtype : 8; |
| 27 | __u32 info; |
| 28 | #define WATCH_INFO_LENGTH 0x0000007f |
| 29 | #define WATCH_INFO_LENGTH__SHIFT 0 |
| 30 | #define WATCH_INFO_ID 0x0000ff00 |
| 31 | #define WATCH_INFO_ID__SHIFT 8 |
| 32 | #define WATCH_INFO_TYPE_INFO 0xffff0000 |
| 33 | #define WATCH_INFO_TYPE_INFO__SHIFT 16 |
| 34 | #define WATCH_INFO_FLAG_0 0x00010000 |
| 35 | #define WATCH_INFO_FLAG_1 0x00020000 |
| 36 | #define WATCH_INFO_FLAG_2 0x00040000 |
| 37 | #define WATCH_INFO_FLAG_3 0x00080000 |
| 38 | #define WATCH_INFO_FLAG_4 0x00100000 |
| 39 | #define WATCH_INFO_FLAG_5 0x00200000 |
| 40 | #define WATCH_INFO_FLAG_6 0x00400000 |
| 41 | #define WATCH_INFO_FLAG_7 0x00800000 |
| 42 | }; |
| 43 | struct watch_notification_type_filter { |
| 44 | __u32 type; |
| 45 | __u32 info_filter; |
| 46 | __u32 info_mask; |
| 47 | __u32 subtype_filter[8]; |
| 48 | }; |
| 49 | struct watch_notification_filter { |
| 50 | __u32 nr_filters; |
| 51 | __u32 __reserved; |
| 52 | struct watch_notification_type_filter filters[]; |
| 53 | }; |
| 54 | struct watch_notification_removal { |
| 55 | struct watch_notification watch; |
| 56 | __u64 id; |
| 57 | }; |
| 58 | enum key_notification_subtype { |
| 59 | NOTIFY_KEY_INSTANTIATED = 0, |
| 60 | NOTIFY_KEY_UPDATED = 1, |
| 61 | NOTIFY_KEY_LINKED = 2, |
| 62 | NOTIFY_KEY_UNLINKED = 3, |
| 63 | NOTIFY_KEY_CLEARED = 4, |
| 64 | NOTIFY_KEY_REVOKED = 5, |
| 65 | NOTIFY_KEY_INVALIDATED = 6, |
| 66 | NOTIFY_KEY_SETATTR = 7, |
| 67 | }; |
| 68 | struct key_notification { |
| 69 | struct watch_notification watch; |
| 70 | __u32 key_id; |
| 71 | __u32 aux; |
| 72 | }; |
| 73 | #endif |