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  */
7 #ifndef _UAPI_LINUX_CAPABILITY_H
8 #define _UAPI_LINUX_CAPABILITY_H
9 #include <linux/types.h>
10 #define _LINUX_CAPABILITY_VERSION_1 0x19980330
11 #define _LINUX_CAPABILITY_U32S_1 1
12 #define _LINUX_CAPABILITY_VERSION_2 0x20071026
13 #define _LINUX_CAPABILITY_U32S_2 2
14 #define _LINUX_CAPABILITY_VERSION_3 0x20080522
15 #define _LINUX_CAPABILITY_U32S_3 2
16 typedef struct __user_cap_header_struct {
17   __u32 version;
18   int pid;
19 }  * cap_user_header_t;
20 struct __user_cap_data_struct {
21   __u32 effective;
22   __u32 permitted;
23   __u32 inheritable;
24 };
25 typedef struct __user_cap_data_struct  * cap_user_data_t;
26 #define VFS_CAP_REVISION_MASK 0xFF000000
27 #define VFS_CAP_REVISION_SHIFT 24
28 #define VFS_CAP_FLAGS_MASK ~VFS_CAP_REVISION_MASK
29 #define VFS_CAP_FLAGS_EFFECTIVE 0x000001
30 #define VFS_CAP_REVISION_1 0x01000000
31 #define VFS_CAP_U32_1 1
32 #define XATTR_CAPS_SZ_1 (sizeof(__le32) * (1 + 2 * VFS_CAP_U32_1))
33 #define VFS_CAP_REVISION_2 0x02000000
34 #define VFS_CAP_U32_2 2
35 #define XATTR_CAPS_SZ_2 (sizeof(__le32) * (1 + 2 * VFS_CAP_U32_2))
36 #define VFS_CAP_REVISION_3 0x03000000
37 #define VFS_CAP_U32_3 2
38 #define XATTR_CAPS_SZ_3 (sizeof(__le32) * (2 + 2 * VFS_CAP_U32_3))
39 #define XATTR_CAPS_SZ XATTR_CAPS_SZ_3
40 #define VFS_CAP_U32 VFS_CAP_U32_3
41 #define VFS_CAP_REVISION VFS_CAP_REVISION_3
42 struct vfs_cap_data {
43   __le32 magic_etc;
44   struct {
45     __le32 permitted;
46     __le32 inheritable;
47   } data[VFS_CAP_U32];
48 };
49 struct vfs_ns_cap_data {
50   __le32 magic_etc;
51   struct {
52     __le32 permitted;
53     __le32 inheritable;
54   } data[VFS_CAP_U32];
55   __le32 rootid;
56 };
57 #define _LINUX_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_1
58 #define _LINUX_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_1
59 #define CAP_CHOWN 0
60 #define CAP_DAC_OVERRIDE 1
61 #define CAP_DAC_READ_SEARCH 2
62 #define CAP_FOWNER 3
63 #define CAP_FSETID 4
64 #define CAP_KILL 5
65 #define CAP_SETGID 6
66 #define CAP_SETUID 7
67 #define CAP_SETPCAP 8
68 #define CAP_LINUX_IMMUTABLE 9
69 #define CAP_NET_BIND_SERVICE 10
70 #define CAP_NET_BROADCAST 11
71 #define CAP_NET_ADMIN 12
72 #define CAP_NET_RAW 13
73 #define CAP_IPC_LOCK 14
74 #define CAP_IPC_OWNER 15
75 #define CAP_SYS_MODULE 16
76 #define CAP_SYS_RAWIO 17
77 #define CAP_SYS_CHROOT 18
78 #define CAP_SYS_PTRACE 19
79 #define CAP_SYS_PACCT 20
80 #define CAP_SYS_ADMIN 21
81 #define CAP_SYS_BOOT 22
82 #define CAP_SYS_NICE 23
83 #define CAP_SYS_RESOURCE 24
84 #define CAP_SYS_TIME 25
85 #define CAP_SYS_TTY_CONFIG 26
86 #define CAP_MKNOD 27
87 #define CAP_LEASE 28
88 #define CAP_AUDIT_WRITE 29
89 #define CAP_AUDIT_CONTROL 30
90 #define CAP_SETFCAP 31
91 #define CAP_MAC_OVERRIDE 32
92 #define CAP_MAC_ADMIN 33
93 #define CAP_SYSLOG 34
94 #define CAP_WAKE_ALARM 35
95 #define CAP_BLOCK_SUSPEND 36
96 #define CAP_AUDIT_READ 37
97 #define CAP_PERFMON 38
98 #define CAP_BPF 39
99 #define CAP_CHECKPOINT_RESTORE 40
100 #define CAP_LAST_CAP CAP_CHECKPOINT_RESTORE
101 #define cap_valid(x) ((x) >= 0 && (x) <= CAP_LAST_CAP)
102 #define CAP_TO_INDEX(x) ((x) >> 5)
103 #define CAP_TO_MASK(x) (1U << ((x) & 31))
104 #endif
105