| ... | ... | @@ -4,27 +4,109 @@ |
| 4 | 4 | // The MIT license requires this copyright notice to be included in all copies |
| 5 | 5 | // and substantial portions of the software. |
| 6 | 6 | |
| 7 | | pub const PR_SET_PDEATHSIG = 1; |
| 8 | | pub const PR_GET_PDEATHSIG = 2; |
| 7 | pub const PR = extern enum(i32) { |
| 8 | SET_PDEATHSIG = 1, |
| 9 | GET_PDEATHSIG = 2, |
| 9 | 10 | |
| 10 | | pub const PR_GET_DUMPABLE = 3; |
| 11 | | pub const PR_SET_DUMPABLE = 4; |
| 11 | GET_DUMPABLE = 3, |
| 12 | SET_DUMPABLE = 4, |
| 12 | 13 | |
| 13 | | pub const PR_GET_UNALIGN = 5; |
| 14 | | pub const PR_SET_UNALIGN = 6; |
| 14 | GET_UNALIGN = 5, |
| 15 | SET_UNALIGN = 6, |
| 16 | |
| 17 | GET_KEEPCAPS = 7, |
| 18 | SET_KEEPCAPS = 8, |
| 19 | |
| 20 | GET_FPEMU = 9, |
| 21 | SET_FPEMU = 10, |
| 22 | |
| 23 | GET_FPEXC = 11, |
| 24 | SET_FPEXC = 12, |
| 25 | |
| 26 | GET_TIMING = 13, |
| 27 | SET_TIMING = 14, |
| 28 | |
| 29 | SET_NAME = 15, |
| 30 | GET_NAME = 16, |
| 31 | |
| 32 | GET_ENDIAN = 19, |
| 33 | SET_ENDIAN = 20, |
| 34 | |
| 35 | GET_SECCOMP = 21, |
| 36 | SET_SECCOMP = 22, |
| 37 | |
| 38 | CAPBSET_READ = 23, |
| 39 | CAPBSET_DROP = 24, |
| 40 | |
| 41 | GET_TSC = 25, |
| 42 | SET_TSC = 26, |
| 43 | |
| 44 | GET_SECUREBITS = 27, |
| 45 | SET_SECUREBITS = 28, |
| 46 | |
| 47 | SET_TIMERSLACK = 29, |
| 48 | GET_TIMERSLACK = 30, |
| 49 | |
| 50 | TASK_PERF_EVENTS_DISABLE = 31, |
| 51 | TASK_PERF_EVENTS_ENABLE = 32, |
| 52 | |
| 53 | MCE_KILL = 33, |
| 54 | |
| 55 | MCE_KILL_GET = 34, |
| 56 | |
| 57 | SET_MM = 35, |
| 58 | |
| 59 | SET_PTRACER = 0x59616d61, |
| 60 | |
| 61 | SET_CHILD_SUBREAPER = 36, |
| 62 | GET_CHILD_SUBREAPER = 37, |
| 63 | |
| 64 | SET_NO_NEW_PRIVS = 38, |
| 65 | GET_NO_NEW_PRIVS = 39, |
| 66 | |
| 67 | GET_TID_ADDRESS = 40, |
| 68 | |
| 69 | SET_THP_DISABLE = 41, |
| 70 | GET_THP_DISABLE = 42, |
| 71 | |
| 72 | MPX_ENABLE_MANAGEMENT = 43, |
| 73 | MPX_DISABLE_MANAGEMENT = 44, |
| 74 | |
| 75 | SET_FP_MODE = 45, |
| 76 | GET_FP_MODE = 46, |
| 77 | |
| 78 | CAP_AMBIENT = 47, |
| 79 | |
| 80 | SVE_SET_VL = 50, |
| 81 | SVE_GET_VL = 51, |
| 82 | |
| 83 | GET_SPECULATION_CTRL = 52, |
| 84 | SET_SPECULATION_CTRL = 53, |
| 85 | |
| 86 | _, |
| 87 | }; |
| 88 | |
| 89 | pub const PR_SET_PDEATHSIG = @enumToInt(PR.PR_SET_PDEATHSIG); |
| 90 | pub const PR_GET_PDEATHSIG = @enumToInt(PR.PR_GET_PDEATHSIG); |
| 91 | |
| 92 | pub const PR_GET_DUMPABLE = @enumToInt(PR.PR_GET_DUMPABLE); |
| 93 | pub const PR_SET_DUMPABLE = @enumToInt(PR.PR_SET_DUMPABLE); |
| 94 | |
| 95 | pub const PR_GET_UNALIGN = @enumToInt(PR.PR_GET_UNALIGN); |
| 96 | pub const PR_SET_UNALIGN = @enumToInt(PR.PR_SET_UNALIGN); |
| 15 | 97 | pub const PR_UNALIGN_NOPRINT = 1; |
| 16 | 98 | pub const PR_UNALIGN_SIGBUS = 2; |
| 17 | 99 | |
| 18 | | pub const PR_GET_KEEPCAPS = 7; |
| 19 | | pub const PR_SET_KEEPCAPS = 8; |
| 100 | pub const PR_GET_KEEPCAPS = @enumToInt(PR.PR_GET_KEEPCAPS); |
| 101 | pub const PR_SET_KEEPCAPS = @enumToInt(PR.PR_SET_KEEPCAPS); |
| 20 | 102 | |
| 21 | | pub const PR_GET_FPEMU = 9; |
| 22 | | pub const PR_SET_FPEMU = 10; |
| 103 | pub const PR_GET_FPEMU = @enumToInt(PR.PR_GET_FPEMU); |
| 104 | pub const PR_SET_FPEMU = @enumToInt(PR.PR_SET_FPEMU); |
| 23 | 105 | pub const PR_FPEMU_NOPRINT = 1; |
| 24 | 106 | pub const PR_FPEMU_SIGFPE = 2; |
| 25 | 107 | |
| 26 | | pub const PR_GET_FPEXC = 11; |
| 27 | | pub const PR_SET_FPEXC = 12; |
| 108 | pub const PR_GET_FPEXC = @enumToInt(PR.PR_GET_FPEXC); |
| 109 | pub const PR_SET_FPEXC = @enumToInt(PR.PR_SET_FPEXC); |
| 28 | 110 | pub const PR_FP_EXC_SW_ENABLE = 0x80; |
| 29 | 111 | pub const PR_FP_EXC_DIV = 0x010000; |
| 30 | 112 | pub const PR_FP_EXC_OVF = 0x020000; |
| ... | ... | @@ -36,41 +118,41 @@ pub const PR_FP_EXC_NONRECOV = 1; |
| 36 | 118 | pub const PR_FP_EXC_ASYNC = 2; |
| 37 | 119 | pub const PR_FP_EXC_PRECISE = 3; |
| 38 | 120 | |
| 39 | | pub const PR_GET_TIMING = 13; |
| 40 | | pub const PR_SET_TIMING = 14; |
| 121 | pub const PR_GET_TIMING = @enumToInt(PR.PR_GET_TIMING); |
| 122 | pub const PR_SET_TIMING = @enumToInt(PR.PR_SET_TIMING); |
| 41 | 123 | pub const PR_TIMING_STATISTICAL = 0; |
| 42 | 124 | pub const PR_TIMING_TIMESTAMP = 1; |
| 43 | 125 | |
| 44 | | pub const PR_SET_NAME = 15; |
| 45 | | pub const PR_GET_NAME = 16; |
| 126 | pub const PR_SET_NAME = @enumToInt(PR.PR_SET_NAME); |
| 127 | pub const PR_GET_NAME = @enumToInt(PR.PR_GET_NAME); |
| 46 | 128 | |
| 47 | | pub const PR_GET_ENDIAN = 19; |
| 48 | | pub const PR_SET_ENDIAN = 20; |
| 129 | pub const PR_GET_ENDIAN = @enumToInt(PR.PR_GET_ENDIAN); |
| 130 | pub const PR_SET_ENDIAN = @enumToInt(PR.PR_SET_ENDIAN); |
| 49 | 131 | pub const PR_ENDIAN_BIG = 0; |
| 50 | 132 | pub const PR_ENDIAN_LITTLE = 1; |
| 51 | 133 | pub const PR_ENDIAN_PPC_LITTLE = 2; |
| 52 | 134 | |
| 53 | | pub const PR_GET_SECCOMP = 21; |
| 54 | | pub const PR_SET_SECCOMP = 22; |
| 135 | pub const PR_GET_SECCOMP = @enumToInt(PR.PR_GET_SECCOMP); |
| 136 | pub const PR_SET_SECCOMP = @enumToInt(PR.PR_SET_SECCOMP); |
| 55 | 137 | |
| 56 | | pub const PR_CAPBSET_READ = 23; |
| 57 | | pub const PR_CAPBSET_DROP = 24; |
| 138 | pub const PR_CAPBSET_READ = @enumToInt(PR.PR_CAPBSET_READ); |
| 139 | pub const PR_CAPBSET_DROP = @enumToInt(PR.PR_CAPBSET_DROP); |
| 58 | 140 | |
| 59 | | pub const PR_GET_TSC = 25; |
| 60 | | pub const PR_SET_TSC = 26; |
| 141 | pub const PR_GET_TSC = @enumToInt(PR.PR_GET_TSC); |
| 142 | pub const PR_SET_TSC = @enumToInt(PR.PR_SET_TSC); |
| 61 | 143 | pub const PR_TSC_ENABLE = 1; |
| 62 | 144 | pub const PR_TSC_SIGSEGV = 2; |
| 63 | 145 | |
| 64 | | pub const PR_GET_SECUREBITS = 27; |
| 65 | | pub const PR_SET_SECUREBITS = 28; |
| 146 | pub const PR_GET_SECUREBITS = @enumToInt(PR.PR_GET_SECUREBITS); |
| 147 | pub const PR_SET_SECUREBITS = @enumToInt(PR.PR_SET_SECUREBITS); |
| 66 | 148 | |
| 67 | | pub const PR_SET_TIMERSLACK = 29; |
| 68 | | pub const PR_GET_TIMERSLACK = 30; |
| 149 | pub const PR_SET_TIMERSLACK = @enumToInt(PR.PR_SET_TIMERSLACK); |
| 150 | pub const PR_GET_TIMERSLACK = @enumToInt(PR.PR_GET_TIMERSLACK); |
| 69 | 151 | |
| 70 | | pub const PR_TASK_PERF_EVENTS_DISABLE = 31; |
| 71 | | pub const PR_TASK_PERF_EVENTS_ENABLE = 32; |
| 152 | pub const PR_TASK_PERF_EVENTS_DISABLE = @enumToInt(PR.PR_TASK_PERF_EVENTS_DISABLE); |
| 153 | pub const PR_TASK_PERF_EVENTS_ENABLE = @enumToInt(PR.PR_TASK_PERF_EVENTS_ENABLE); |
| 72 | 154 | |
| 73 | | pub const PR_MCE_KILL = 33; |
| 155 | pub const PR_MCE_KILL = @enumToInt(PR.PR_MCE_KILL); |
| 74 | 156 | pub const PR_MCE_KILL_CLEAR = 0; |
| 75 | 157 | pub const PR_MCE_KILL_SET = 1; |
| 76 | 158 | |
| ... | ... | @@ -78,9 +160,9 @@ pub const PR_MCE_KILL_LATE = 0; |
| 78 | 160 | pub const PR_MCE_KILL_EARLY = 1; |
| 79 | 161 | pub const PR_MCE_KILL_DEFAULT = 2; |
| 80 | 162 | |
| 81 | | pub const PR_MCE_KILL_GET = 34; |
| 163 | pub const PR_MCE_KILL_GET = @enumToInt(PR.PR_MCE_KILL_GET); |
| 82 | 164 | |
| 83 | | pub const PR_SET_MM = 35; |
| 165 | pub const PR_SET_MM = @enumToInt(PR.PR_SET_MM); |
| 84 | 166 | pub const PR_SET_MM_START_CODE = 1; |
| 85 | 167 | pub const PR_SET_MM_END_CODE = 2; |
| 86 | 168 | pub const PR_SET_MM_START_DATA = 3; |
| ... | ... | @@ -114,42 +196,42 @@ pub const prctl_mm_map = extern struct { |
| 114 | 196 | exe_fd: u32, |
| 115 | 197 | }; |
| 116 | 198 | |
| 117 | | pub const PR_SET_PTRACER = 0x59616d61; |
| 199 | pub const PR_SET_PTRACER = @enumToInt(PR.PR_SET_PTRACER); |
| 118 | 200 | pub const PR_SET_PTRACER_ANY = std.math.maxInt(c_ulong); |
| 119 | 201 | |
| 120 | | pub const PR_SET_CHILD_SUBREAPER = 36; |
| 121 | | pub const PR_GET_CHILD_SUBREAPER = 37; |
| 202 | pub const PR_SET_CHILD_SUBREAPER = @enumToInt(PR.PR_SET_CHILD_SUBREAPER); |
| 203 | pub const PR_GET_CHILD_SUBREAPER = @enumToInt(PR.PR_GET_CHILD_SUBREAPER); |
| 122 | 204 | |
| 123 | | pub const PR_SET_NO_NEW_PRIVS = 38; |
| 124 | | pub const PR_GET_NO_NEW_PRIVS = 39; |
| 205 | pub const PR_SET_NO_NEW_PRIVS = @enumToInt(PR.PR_SET_NO_NEW_PRIVS); |
| 206 | pub const PR_GET_NO_NEW_PRIVS = @enumToInt(PR.PR_GET_NO_NEW_PRIVS); |
| 125 | 207 | |
| 126 | | pub const PR_GET_TID_ADDRESS = 40; |
| 208 | pub const PR_GET_TID_ADDRESS = @enumToInt(PR.PR_GET_TID_ADDRESS); |
| 127 | 209 | |
| 128 | | pub const PR_SET_THP_DISABLE = 41; |
| 129 | | pub const PR_GET_THP_DISABLE = 42; |
| 210 | pub const PR_SET_THP_DISABLE = @enumToInt(PR.PR_SET_THP_DISABLE); |
| 211 | pub const PR_GET_THP_DISABLE = @enumToInt(PR.PR_GET_THP_DISABLE); |
| 130 | 212 | |
| 131 | | pub const PR_MPX_ENABLE_MANAGEMENT = 43; |
| 132 | | pub const PR_MPX_DISABLE_MANAGEMENT = 44; |
| 213 | pub const PR_MPX_ENABLE_MANAGEMENT = @enumToInt(PR.PR_MPX_ENABLE_MANAGEMENT); |
| 214 | pub const PR_MPX_DISABLE_MANAGEMENT = @enumToInt(PR.PR_MPX_DISABLE_MANAGEMENT); |
| 133 | 215 | |
| 134 | | pub const PR_SET_FP_MODE = 45; |
| 135 | | pub const PR_GET_FP_MODE = 46; |
| 216 | pub const PR_SET_FP_MODE = @enumToInt(PR.PR_SET_FP_MODE); |
| 217 | pub const PR_GET_FP_MODE = @enumToInt(PR.PR_GET_FP_MODE); |
| 136 | 218 | pub const PR_FP_MODE_FR = 1 << 0; |
| 137 | 219 | pub const PR_FP_MODE_FRE = 1 << 1; |
| 138 | 220 | |
| 139 | | pub const PR_CAP_AMBIENT = 47; |
| 221 | pub const PR_CAP_AMBIENT = @enumToInt(PR.PR_CAP_AMBIENT); |
| 140 | 222 | pub const PR_CAP_AMBIENT_IS_SET = 1; |
| 141 | 223 | pub const PR_CAP_AMBIENT_RAISE = 2; |
| 142 | 224 | pub const PR_CAP_AMBIENT_LOWER = 3; |
| 143 | 225 | pub const PR_CAP_AMBIENT_CLEAR_ALL = 4; |
| 144 | 226 | |
| 145 | | pub const PR_SVE_SET_VL = 50; |
| 227 | pub const PR_SVE_SET_VL = @enumToInt(PR.PR_SVE_SET_VL); |
| 146 | 228 | pub const PR_SVE_SET_VL_ONEXEC = 1 << 18; |
| 147 | | pub const PR_SVE_GET_VL = 51; |
| 229 | pub const PR_SVE_GET_VL = @enumToInt(PR.PR_SVE_GET_VL); |
| 148 | 230 | pub const PR_SVE_VL_LEN_MASK = 0xffff; |
| 149 | 231 | pub const PR_SVE_VL_INHERIT = 1 << 17; |
| 150 | 232 | |
| 151 | | pub const PR_GET_SPECULATION_CTRL = 52; |
| 152 | | pub const PR_SET_SPECULATION_CTRL = 53; |
| 233 | pub const PR_GET_SPECULATION_CTRL = @enumToInt(PR.PR_GET_SPECULATION_CTRL); |
| 234 | pub const PR_SET_SPECULATION_CTRL = @enumToInt(PR.PR_SET_SPECULATION_CTRL); |
| 153 | 235 | pub const PR_SPEC_STORE_BYPASS = 0; |
| 154 | 236 | pub const PR_SPEC_NOT_AFFECTED = 0; |
| 155 | 237 | pub const PR_SPEC_PRCTL = 1 << 0; |