authorgravatar for quae@daurnimator.comdaurnimator <quae@daurnimator.com> 2020-03-02 23:30:53+11:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-03-31 10:16:20-04:00
log63409cf422c71fee64c55f2b77999ee94366400f
tree812702ccc1f2f89150b2a6763cd1801e1deb2b39
parent839d85e4405aef4856d1a35a6580226e997cc369

std: linux syscall numbers are now an extensible enum


16 files changed, 2484 insertions(+), 2460 deletions(-)

lib/std/os.zig+1-1
...@@ -2065,7 +2065,7 @@ pub fn isatty(handle: fd_t) bool {...@@ -2065,7 +2065,7 @@ pub fn isatty(handle: fd_t) bool {
2065 }2065 }
2066 if (builtin.os.tag == .linux) {2066 if (builtin.os.tag == .linux) {
2067 var wsz: linux.winsize = undefined;2067 var wsz: linux.winsize = undefined;
2068 return linux.syscall3(linux.SYS_ioctl, @bitCast(usize, @as(isize, handle)), linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0;2068 return linux.syscall3(.ioctl, @bitCast(usize, @as(isize, handle)), linux.TIOCGWINSZ, @ptrToInt(&wsz)) == 0;
2069 }2069 }
2070 unreachable;2070 unreachable;
2071}2071}
lib/std/os/bits/linux/arm-eabi.zig+403-399
...@@ -9,406 +9,410 @@ const sigset_t = linux.sigset_t;...@@ -9,406 +9,410 @@ const sigset_t = linux.sigset_t;
9const uid_t = linux.uid_t;9const uid_t = linux.uid_t;
10const gid_t = linux.gid_t;10const gid_t = linux.gid_t;
1111
12pub const SYS_restart_syscall = 0;12pub const SYS = extern enum(usize) {
13pub const SYS_exit = 1;13 restart_syscall = 0,
14pub const SYS_fork = 2;14 exit = 1,
15pub const SYS_read = 3;15 fork = 2,
16pub const SYS_write = 4;16 read = 3,
17pub const SYS_open = 5;17 write = 4,
18pub const SYS_close = 6;18 open = 5,
19pub const SYS_creat = 8;19 close = 6,
20pub const SYS_link = 9;20 creat = 8,
21pub const SYS_unlink = 10;21 link = 9,
22pub const SYS_execve = 11;22 unlink = 10,
23pub const SYS_chdir = 12;23 execve = 11,
24pub const SYS_mknod = 14;24 chdir = 12,
25pub const SYS_chmod = 15;25 mknod = 14,
26pub const SYS_lchown = 16;26 chmod = 15,
27pub const SYS_lseek = 19;27 lchown = 16,
28pub const SYS_getpid = 20;28 lseek = 19,
29pub const SYS_mount = 21;29 getpid = 20,
30pub const SYS_setuid = 23;30 mount = 21,
31pub const SYS_getuid = 24;31 setuid = 23,
32pub const SYS_ptrace = 26;32 getuid = 24,
33pub const SYS_pause = 29;33 ptrace = 26,
34pub const SYS_access = 33;34 pause = 29,
35pub const SYS_nice = 34;35 access = 33,
36pub const SYS_sync = 36;36 nice = 34,
37pub const SYS_kill = 37;37 sync = 36,
38pub const SYS_rename = 38;38 kill = 37,
39pub const SYS_mkdir = 39;39 rename = 38,
40pub const SYS_rmdir = 40;40 mkdir = 39,
41pub const SYS_dup = 41;41 rmdir = 40,
42pub const SYS_pipe = 42;42 dup = 41,
43pub const SYS_times = 43;43 pipe = 42,
44pub const SYS_brk = 45;44 times = 43,
45pub const SYS_setgid = 46;45 brk = 45,
46pub const SYS_getgid = 47;46 setgid = 46,
47pub const SYS_geteuid = 49;47 getgid = 47,
48pub const SYS_getegid = 50;48 geteuid = 49,
49pub const SYS_acct = 51;49 getegid = 50,
50pub const SYS_umount2 = 52;50 acct = 51,
51pub const SYS_ioctl = 54;51 umount2 = 52,
52pub const SYS_fcntl = 55;52 ioctl = 54,
53pub const SYS_setpgid = 57;53 fcntl = 55,
54pub const SYS_umask = 60;54 setpgid = 57,
55pub const SYS_chroot = 61;55 umask = 60,
56pub const SYS_ustat = 62;56 chroot = 61,
57pub const SYS_dup2 = 63;57 ustat = 62,
58pub const SYS_getppid = 64;58 dup2 = 63,
59pub const SYS_getpgrp = 65;59 getppid = 64,
60pub const SYS_setsid = 66;60 getpgrp = 65,
61pub const SYS_sigaction = 67;61 setsid = 66,
62pub const SYS_setreuid = 70;62 sigaction = 67,
63pub const SYS_setregid = 71;63 setreuid = 70,
64pub const SYS_sigsuspend = 72;64 setregid = 71,
65pub const SYS_sigpending = 73;65 sigsuspend = 72,
66pub const SYS_sethostname = 74;66 sigpending = 73,
67pub const SYS_setrlimit = 75;67 sethostname = 74,
68pub const SYS_getrusage = 77;68 setrlimit = 75,
69pub const SYS_gettimeofday = 78;69 getrusage = 77,
70pub const SYS_settimeofday = 79;70 gettimeofday = 78,
71pub const SYS_getgroups = 80;71 settimeofday = 79,
72pub const SYS_setgroups = 81;72 getgroups = 80,
73pub const SYS_symlink = 83;73 setgroups = 81,
74pub const SYS_readlink = 85;74 symlink = 83,
75pub const SYS_uselib = 86;75 readlink = 85,
76pub const SYS_swapon = 87;76 uselib = 86,
77pub const SYS_reboot = 88;77 swapon = 87,
78pub const SYS_munmap = 91;78 reboot = 88,
79pub const SYS_truncate = 92;79 munmap = 91,
80pub const SYS_ftruncate = 93;80 truncate = 92,
81pub const SYS_fchmod = 94;81 ftruncate = 93,
82pub const SYS_fchown = 95;82 fchmod = 94,
83pub const SYS_getpriority = 96;83 fchown = 95,
84pub const SYS_setpriority = 97;84 getpriority = 96,
85pub const SYS_statfs = 99;85 setpriority = 97,
86pub const SYS_fstatfs = 100;86 statfs = 99,
87pub const SYS_syslog = 103;87 fstatfs = 100,
88pub const SYS_setitimer = 104;88 syslog = 103,
89pub const SYS_getitimer = 105;89 setitimer = 104,
90pub const SYS_stat = 106;90 getitimer = 105,
91pub const SYS_lstat = 107;91 stat = 106,
92pub const SYS_fstat = 108;92 lstat = 107,
93pub const SYS_vhangup = 111;93 fstat = 108,
94pub const SYS_wait4 = 114;94 vhangup = 111,
95pub const SYS_swapoff = 115;95 wait4 = 114,
96pub const SYS_sysinfo = 116;96 swapoff = 115,
97pub const SYS_fsync = 118;97 sysinfo = 116,
98pub const SYS_sigreturn = 119;98 fsync = 118,
99pub const SYS_clone = 120;99 sigreturn = 119,
100pub const SYS_setdomainname = 121;100 clone = 120,
101pub const SYS_uname = 122;101 setdomainname = 121,
102pub const SYS_adjtimex = 124;102 uname = 122,
103pub const SYS_mprotect = 125;103 adjtimex = 124,
104pub const SYS_sigprocmask = 126;104 mprotect = 125,
105pub const SYS_init_module = 128;105 sigprocmask = 126,
106pub const SYS_delete_module = 129;106 init_module = 128,
107pub const SYS_quotactl = 131;107 delete_module = 129,
108pub const SYS_getpgid = 132;108 quotactl = 131,
109pub const SYS_fchdir = 133;109 getpgid = 132,
110pub const SYS_bdflush = 134;110 fchdir = 133,
111pub const SYS_sysfs = 135;111 bdflush = 134,
112pub const SYS_personality = 136;112 sysfs = 135,
113pub const SYS_setfsuid = 138;113 personality = 136,
114pub const SYS_setfsgid = 139;114 setfsuid = 138,
115pub const SYS__llseek = 140;115 setfsgid = 139,
116pub const SYS_getdents = 141;116 _llseek = 140,
117pub const SYS__newselect = 142;117 getdents = 141,
118pub const SYS_flock = 143;118 _newselect = 142,
119pub const SYS_msync = 144;119 flock = 143,
120pub const SYS_readv = 145;120 msync = 144,
121pub const SYS_writev = 146;121 readv = 145,
122pub const SYS_getsid = 147;122 writev = 146,
123pub const SYS_fdatasync = 148;123 getsid = 147,
124pub const SYS__sysctl = 149;124 fdatasync = 148,
125pub const SYS_mlock = 150;125 _sysctl = 149,
126pub const SYS_munlock = 151;126 mlock = 150,
127pub const SYS_mlockall = 152;127 munlock = 151,
128pub const SYS_munlockall = 153;128 mlockall = 152,
129pub const SYS_sched_setparam = 154;129 munlockall = 153,
130pub const SYS_sched_getparam = 155;130 sched_setparam = 154,
131pub const SYS_sched_setscheduler = 156;131 sched_getparam = 155,
132pub const SYS_sched_getscheduler = 157;132 sched_setscheduler = 156,
133pub const SYS_sched_yield = 158;133 sched_getscheduler = 157,
134pub const SYS_sched_get_priority_max = 159;134 sched_yield = 158,
135pub const SYS_sched_get_priority_min = 160;135 sched_get_priority_max = 159,
136pub const SYS_sched_rr_get_interval = 161;136 sched_get_priority_min = 160,
137pub const SYS_nanosleep = 162;137 sched_rr_get_interval = 161,
138pub const SYS_mremap = 163;138 nanosleep = 162,
139pub const SYS_setresuid = 164;139 mremap = 163,
140pub const SYS_getresuid = 165;140 setresuid = 164,
141pub const SYS_poll = 168;141 getresuid = 165,
142pub const SYS_nfsservctl = 169;142 poll = 168,
143pub const SYS_setresgid = 170;143 nfsservctl = 169,
144pub const SYS_getresgid = 171;144 setresgid = 170,
145pub const SYS_prctl = 172;145 getresgid = 171,
146pub const SYS_rt_sigreturn = 173;146 prctl = 172,
147pub const SYS_rt_sigaction = 174;147 rt_sigreturn = 173,
148pub const SYS_rt_sigprocmask = 175;148 rt_sigaction = 174,
149pub const SYS_rt_sigpending = 176;149 rt_sigprocmask = 175,
150pub const SYS_rt_sigtimedwait = 177;150 rt_sigpending = 176,
151pub const SYS_rt_sigqueueinfo = 178;151 rt_sigtimedwait = 177,
152pub const SYS_rt_sigsuspend = 179;152 rt_sigqueueinfo = 178,
153pub const SYS_pread64 = 180;153 rt_sigsuspend = 179,
154pub const SYS_pwrite64 = 181;154 pread64 = 180,
155pub const SYS_chown = 182;155 pwrite64 = 181,
156pub const SYS_getcwd = 183;156 chown = 182,
157pub const SYS_capget = 184;157 getcwd = 183,
158pub const SYS_capset = 185;158 capget = 184,
159pub const SYS_sigaltstack = 186;159 capset = 185,
160pub const SYS_sendfile = 187;160 sigaltstack = 186,
161pub const SYS_vfork = 190;161 sendfile = 187,
162pub const SYS_ugetrlimit = 191;162 vfork = 190,
163pub const SYS_mmap2 = 192;163 ugetrlimit = 191,
164pub const SYS_truncate64 = 193;164 mmap2 = 192,
165pub const SYS_ftruncate64 = 194;165 truncate64 = 193,
166pub const SYS_stat64 = 195;166 ftruncate64 = 194,
167pub const SYS_lstat64 = 196;167 stat64 = 195,
168pub const SYS_fstat64 = 197;168 lstat64 = 196,
169pub const SYS_lchown32 = 198;169 fstat64 = 197,
170pub const SYS_getuid32 = 199;170 lchown32 = 198,
171pub const SYS_getgid32 = 200;171 getuid32 = 199,
172pub const SYS_geteuid32 = 201;172 getgid32 = 200,
173pub const SYS_getegid32 = 202;173 geteuid32 = 201,
174pub const SYS_setreuid32 = 203;174 getegid32 = 202,
175pub const SYS_setregid32 = 204;175 setreuid32 = 203,
176pub const SYS_getgroups32 = 205;176 setregid32 = 204,
177pub const SYS_setgroups32 = 206;177 getgroups32 = 205,
178pub const SYS_fchown32 = 207;178 setgroups32 = 206,
179pub const SYS_setresuid32 = 208;179 fchown32 = 207,
180pub const SYS_getresuid32 = 209;180 setresuid32 = 208,
181pub const SYS_setresgid32 = 210;181 getresuid32 = 209,
182pub const SYS_getresgid32 = 211;182 setresgid32 = 210,
183pub const SYS_chown32 = 212;183 getresgid32 = 211,
184pub const SYS_setuid32 = 213;184 chown32 = 212,
185pub const SYS_setgid32 = 214;185 setuid32 = 213,
186pub const SYS_setfsuid32 = 215;186 setgid32 = 214,
187pub const SYS_setfsgid32 = 216;187 setfsuid32 = 215,
188pub const SYS_getdents64 = 217;188 setfsgid32 = 216,
189pub const SYS_pivot_root = 218;189 getdents64 = 217,
190pub const SYS_mincore = 219;190 pivot_root = 218,
191pub const SYS_madvise = 220;191 mincore = 219,
192pub const SYS_fcntl64 = 221;192 madvise = 220,
193pub const SYS_gettid = 224;193 fcntl64 = 221,
194pub const SYS_readahead = 225;194 gettid = 224,
195pub const SYS_setxattr = 226;195 readahead = 225,
196pub const SYS_lsetxattr = 227;196 setxattr = 226,
197pub const SYS_fsetxattr = 228;197 lsetxattr = 227,
198pub const SYS_getxattr = 229;198 fsetxattr = 228,
199pub const SYS_lgetxattr = 230;199 getxattr = 229,
200pub const SYS_fgetxattr = 231;200 lgetxattr = 230,
201pub const SYS_listxattr = 232;201 fgetxattr = 231,
202pub const SYS_llistxattr = 233;202 listxattr = 232,
203pub const SYS_flistxattr = 234;203 llistxattr = 233,
204pub const SYS_removexattr = 235;204 flistxattr = 234,
205pub const SYS_lremovexattr = 236;205 removexattr = 235,
206pub const SYS_fremovexattr = 237;206 lremovexattr = 236,
207pub const SYS_tkill = 238;207 fremovexattr = 237,
208pub const SYS_sendfile64 = 239;208 tkill = 238,
209pub const SYS_futex = 240;209 sendfile64 = 239,
210pub const SYS_sched_setaffinity = 241;210 futex = 240,
211pub const SYS_sched_getaffinity = 242;211 sched_setaffinity = 241,
212pub const SYS_io_setup = 243;212 sched_getaffinity = 242,
213pub const SYS_io_destroy = 244;213 io_setup = 243,
214pub const SYS_io_getevents = 245;214 io_destroy = 244,
215pub const SYS_io_submit = 246;215 io_getevents = 245,
216pub const SYS_io_cancel = 247;216 io_submit = 246,
217pub const SYS_exit_group = 248;217 io_cancel = 247,
218pub const SYS_lookup_dcookie = 249;218 exit_group = 248,
219pub const SYS_epoll_create = 250;219 lookup_dcookie = 249,
220pub const SYS_epoll_ctl = 251;220 epoll_create = 250,
221pub const SYS_epoll_wait = 252;221 epoll_ctl = 251,
222pub const SYS_remap_file_pages = 253;222 epoll_wait = 252,
223pub const SYS_set_tid_address = 256;223 remap_file_pages = 253,
224pub const SYS_timer_create = 257;224 set_tid_address = 256,
225pub const SYS_timer_settime = 258;225 timer_create = 257,
226pub const SYS_timer_gettime = 259;226 timer_settime = 258,
227pub const SYS_timer_getoverrun = 260;227 timer_gettime = 259,
228pub const SYS_timer_delete = 261;228 timer_getoverrun = 260,
229pub const SYS_clock_settime = 262;229 timer_delete = 261,
230pub const SYS_clock_gettime = 263;230 clock_settime = 262,
231pub const SYS_clock_getres = 264;231 clock_gettime = 263,
232pub const SYS_clock_nanosleep = 265;232 clock_getres = 264,
233pub const SYS_statfs64 = 266;233 clock_nanosleep = 265,
234pub const SYS_fstatfs64 = 267;234 statfs64 = 266,
235pub const SYS_tgkill = 268;235 fstatfs64 = 267,
236pub const SYS_utimes = 269;236 tgkill = 268,
237pub const SYS_fadvise64_64 = 270;237 utimes = 269,
238pub const SYS_arm_fadvise64_64 = 270;238 fadvise64_64 = 270,
239pub const SYS_pciconfig_iobase = 271;239 arm_fadvise64_64 = 270,
240pub const SYS_pciconfig_read = 272;240 pciconfig_iobase = 271,
241pub const SYS_pciconfig_write = 273;241 pciconfig_read = 272,
242pub const SYS_mq_open = 274;242 pciconfig_write = 273,
243pub const SYS_mq_unlink = 275;243 mq_open = 274,
244pub const SYS_mq_timedsend = 276;244 mq_unlink = 275,
245pub const SYS_mq_timedreceive = 277;245 mq_timedsend = 276,
246pub const SYS_mq_notify = 278;246 mq_timedreceive = 277,
247pub const SYS_mq_getsetattr = 279;247 mq_notify = 278,
248pub const SYS_waitid = 280;248 mq_getsetattr = 279,
249pub const SYS_socket = 281;249 waitid = 280,
250pub const SYS_bind = 282;250 socket = 281,
251pub const SYS_connect = 283;251 bind = 282,
252pub const SYS_listen = 284;252 connect = 283,
253pub const SYS_accept = 285;253 listen = 284,
254pub const SYS_getsockname = 286;254 accept = 285,
255pub const SYS_getpeername = 287;255 getsockname = 286,
256pub const SYS_socketpair = 288;256 getpeername = 287,
257pub const SYS_send = 289;257 socketpair = 288,
258pub const SYS_sendto = 290;258 send = 289,
259pub const SYS_recv = 291;259 sendto = 290,
260pub const SYS_recvfrom = 292;260 recv = 291,
261pub const SYS_shutdown = 293;261 recvfrom = 292,
262pub const SYS_setsockopt = 294;262 shutdown = 293,
263pub const SYS_getsockopt = 295;263 setsockopt = 294,
264pub const SYS_sendmsg = 296;264 getsockopt = 295,
265pub const SYS_recvmsg = 297;265 sendmsg = 296,
266pub const SYS_semop = 298;266 recvmsg = 297,
267pub const SYS_semget = 299;267 semop = 298,
268pub const SYS_semctl = 300;268 semget = 299,
269pub const SYS_msgsnd = 301;269 semctl = 300,
270pub const SYS_msgrcv = 302;270 msgsnd = 301,
271pub const SYS_msgget = 303;271 msgrcv = 302,
272pub const SYS_msgctl = 304;272 msgget = 303,
273pub const SYS_shmat = 305;273 msgctl = 304,
274pub const SYS_shmdt = 306;274 shmat = 305,
275pub const SYS_shmget = 307;275 shmdt = 306,
276pub const SYS_shmctl = 308;276 shmget = 307,
277pub const SYS_add_key = 309;277 shmctl = 308,
278pub const SYS_request_key = 310;278 add_key = 309,
279pub const SYS_keyctl = 311;279 request_key = 310,
280pub const SYS_semtimedop = 312;280 keyctl = 311,
281pub const SYS_vserver = 313;281 semtimedop = 312,
282pub const SYS_ioprio_set = 314;282 vserver = 313,
283pub const SYS_ioprio_get = 315;283 ioprio_set = 314,
284pub const SYS_inotify_init = 316;284 ioprio_get = 315,
285pub const SYS_inotify_add_watch = 317;285 inotify_init = 316,
286pub const SYS_inotify_rm_watch = 318;286 inotify_add_watch = 317,
287pub const SYS_mbind = 319;287 inotify_rm_watch = 318,
288pub const SYS_get_mempolicy = 320;288 mbind = 319,
289pub const SYS_set_mempolicy = 321;289 get_mempolicy = 320,
290pub const SYS_openat = 322;290 set_mempolicy = 321,
291pub const SYS_mkdirat = 323;291 openat = 322,
292pub const SYS_mknodat = 324;292 mkdirat = 323,
293pub const SYS_fchownat = 325;293 mknodat = 324,
294pub const SYS_futimesat = 326;294 fchownat = 325,
295pub const SYS_fstatat64 = 327;295 futimesat = 326,
296pub const SYS_unlinkat = 328;296 fstatat64 = 327,
297pub const SYS_renameat = 329;297 unlinkat = 328,
298pub const SYS_linkat = 330;298 renameat = 329,
299pub const SYS_symlinkat = 331;299 linkat = 330,
300pub const SYS_readlinkat = 332;300 symlinkat = 331,
301pub const SYS_fchmodat = 333;301 readlinkat = 332,
302pub const SYS_faccessat = 334;302 fchmodat = 333,
303pub const SYS_pselect6 = 335;303 faccessat = 334,
304pub const SYS_ppoll = 336;304 pselect6 = 335,
305pub const SYS_unshare = 337;305 ppoll = 336,
306pub const SYS_set_robust_list = 338;306 unshare = 337,
307pub const SYS_get_robust_list = 339;307 set_robust_list = 338,
308pub const SYS_splice = 340;308 get_robust_list = 339,
309pub const SYS_sync_file_range2 = 341;309 splice = 340,
310pub const SYS_arm_sync_file_range = 341;310 sync_file_range2 = 341,
311pub const SYS_tee = 342;311 arm_sync_file_range = 341,
312pub const SYS_vmsplice = 343;312 tee = 342,
313pub const SYS_move_pages = 344;313 vmsplice = 343,
314pub const SYS_getcpu = 345;314 move_pages = 344,
315pub const SYS_epoll_pwait = 346;315 getcpu = 345,
316pub const SYS_kexec_load = 347;316 epoll_pwait = 346,
317pub const SYS_utimensat = 348;317 kexec_load = 347,
318pub const SYS_signalfd = 349;318 utimensat = 348,
319pub const SYS_timerfd_create = 350;319 signalfd = 349,
320pub const SYS_eventfd = 351;320 timerfd_create = 350,
321pub const SYS_fallocate = 352;321 eventfd = 351,
322pub const SYS_timerfd_settime = 353;322 fallocate = 352,
323pub const SYS_timerfd_gettime = 354;323 timerfd_settime = 353,
324pub const SYS_signalfd4 = 355;324 timerfd_gettime = 354,
325pub const SYS_eventfd2 = 356;325 signalfd4 = 355,
326pub const SYS_epoll_create1 = 357;326 eventfd2 = 356,
327pub const SYS_dup3 = 358;327 epoll_create1 = 357,
328pub const SYS_pipe2 = 359;328 dup3 = 358,
329pub const SYS_inotify_init1 = 360;329 pipe2 = 359,
330pub const SYS_preadv = 361;330 inotify_init1 = 360,
331pub const SYS_pwritev = 362;331 preadv = 361,
332pub const SYS_rt_tgsigqueueinfo = 363;332 pwritev = 362,
333pub const SYS_perf_event_open = 364;333 rt_tgsigqueueinfo = 363,
334pub const SYS_recvmmsg = 365;334 perf_event_open = 364,
335pub const SYS_accept4 = 366;335 recvmmsg = 365,
336pub const SYS_fanotify_init = 367;336 accept4 = 366,
337pub const SYS_fanotify_mark = 368;337 fanotify_init = 367,
338pub const SYS_prlimit64 = 369;338 fanotify_mark = 368,
339pub const SYS_name_to_handle_at = 370;339 prlimit64 = 369,
340pub const SYS_open_by_handle_at = 371;340 name_to_handle_at = 370,
341pub const SYS_clock_adjtime = 372;341 open_by_handle_at = 371,
342pub const SYS_syncfs = 373;342 clock_adjtime = 372,
343pub const SYS_sendmmsg = 374;343 syncfs = 373,
344pub const SYS_setns = 375;344 sendmmsg = 374,
345pub const SYS_process_vm_readv = 376;345 setns = 375,
346pub const SYS_process_vm_writev = 377;346 process_vm_readv = 376,
347pub const SYS_kcmp = 378;347 process_vm_writev = 377,
348pub const SYS_finit_module = 379;348 kcmp = 378,
349pub const SYS_sched_setattr = 380;349 finit_module = 379,
350pub const SYS_sched_getattr = 381;350 sched_setattr = 380,
351pub const SYS_renameat2 = 382;351 sched_getattr = 381,
352pub const SYS_seccomp = 383;352 renameat2 = 382,
353pub const SYS_getrandom = 384;353 seccomp = 383,
354pub const SYS_memfd_create = 385;354 getrandom = 384,
355pub const SYS_bpf = 386;355 memfd_create = 385,
356pub const SYS_execveat = 387;356 bpf = 386,
357pub const SYS_userfaultfd = 388;357 execveat = 387,
358pub const SYS_membarrier = 389;358 userfaultfd = 388,
359pub const SYS_mlock2 = 390;359 membarrier = 389,
360pub const SYS_copy_file_range = 391;360 mlock2 = 390,
361pub const SYS_preadv2 = 392;361 copy_file_range = 391,
362pub const SYS_pwritev2 = 393;362 preadv2 = 392,
363pub const SYS_pkey_mprotect = 394;363 pwritev2 = 393,
364pub const SYS_pkey_alloc = 395;364 pkey_mprotect = 394,
365pub const SYS_pkey_free = 396;365 pkey_alloc = 395,
366pub const SYS_statx = 397;366 pkey_free = 396,
367pub const SYS_rseq = 398;367 statx = 397,
368pub const SYS_io_pgetevents = 399;368 rseq = 398,
369pub const SYS_migrate_pages = 400;369 io_pgetevents = 399,
370pub const SYS_kexec_file_load = 401;370 migrate_pages = 400,
371pub const SYS_clock_gettime64 = 403;371 kexec_file_load = 401,
372pub const SYS_clock_settime64 = 404;372 clock_gettime64 = 403,
373pub const SYS_clock_adjtime64 = 405;373 clock_settime64 = 404,
374pub const SYS_clock_getres_time64 = 406;374 clock_adjtime64 = 405,
375pub const SYS_clock_nanosleep_time64 = 407;375 clock_getres_time64 = 406,
376pub const SYS_timer_gettime64 = 408;376 clock_nanosleep_time64 = 407,
377pub const SYS_timer_settime64 = 409;377 timer_gettime64 = 408,
378pub const SYS_timerfd_gettime64 = 410;378 timer_settime64 = 409,
379pub const SYS_timerfd_settime64 = 411;379 timerfd_gettime64 = 410,
380pub const SYS_utimensat_time64 = 412;380 timerfd_settime64 = 411,
381pub const SYS_pselect6_time64 = 413;381 utimensat_time64 = 412,
382pub const SYS_ppoll_time64 = 414;382 pselect6_time64 = 413,
383pub const SYS_io_pgetevents_time64 = 416;383 ppoll_time64 = 414,
384pub const SYS_recvmmsg_time64 = 417;384 io_pgetevents_time64 = 416,
385pub const SYS_mq_timedsend_time64 = 418;385 recvmmsg_time64 = 417,
386pub const SYS_mq_timedreceive_time64 = 419;386 mq_timedsend_time64 = 418,
387pub const SYS_semtimedop_time64 = 420;387 mq_timedreceive_time64 = 419,
388pub const SYS_rt_sigtimedwait_time64 = 421;388 semtimedop_time64 = 420,
389pub const SYS_futex_time64 = 422;389 rt_sigtimedwait_time64 = 421,
390pub const SYS_sched_rr_get_interval_time64 = 423;390 futex_time64 = 422,
391pub const SYS_pidfd_send_signal = 424;391 sched_rr_get_interval_time64 = 423,
392pub const SYS_io_uring_setup = 425;392 pidfd_send_signal = 424,
393pub const SYS_io_uring_enter = 426;393 io_uring_setup = 425,
394pub const SYS_io_uring_register = 427;394 io_uring_enter = 426,
395pub const SYS_open_tree = 428;395 io_uring_register = 427,
396pub const SYS_move_mount = 429;396 open_tree = 428,
397pub const SYS_fsopen = 430;397 move_mount = 429,
398pub const SYS_fsconfig = 431;398 fsopen = 430,
399pub const SYS_fsmount = 432;399 fsconfig = 431,
400pub const SYS_fspick = 433;400 fsmount = 432,
401pub const SYS_pidfd_open = 434;401 fspick = 433,
402pub const SYS_clone3 = 435;402 pidfd_open = 434,
403pub const SYS_openat2 = 437;403 clone3 = 435,
404pub const SYS_pidfd_getfd = 438;404 openat2 = 437,
405 pidfd_getfd = 438,
405406
406pub const SYS_breakpoint = 0x0f0001;407 breakpoint = 0x0f0001,
407pub const SYS_cacheflush = 0x0f0002;408 cacheflush = 0x0f0002,
408pub const SYS_usr26 = 0x0f0003;409 usr26 = 0x0f0003,
409pub const SYS_usr32 = 0x0f0004;410 usr32 = 0x0f0004,
410pub const SYS_set_tls = 0x0f0005;411 set_tls = 0x0f0005,
411pub const SYS_get_tls = 0x0f0006;412 get_tls = 0x0f0006,
413
414 _,
415};
412416
413pub const MMAP2_UNIT = 4096;417pub const MMAP2_UNIT = 4096;
414418
lib/std/os/bits/linux/arm64.zig+296-293
...@@ -10,300 +10,303 @@ const uid_t = linux.uid_t;...@@ -10,300 +10,303 @@ const uid_t = linux.uid_t;
10const gid_t = linux.gid_t;10const gid_t = linux.gid_t;
11const stack_t = linux.stack_t;11const stack_t = linux.stack_t;
12const sigset_t = linux.sigset_t;12const sigset_t = linux.sigset_t;
13pub const SYS = extern enum(usize) {
14 io_setup = 0,
15 io_destroy = 1,
16 io_submit = 2,
17 io_cancel = 3,
18 io_getevents = 4,
19 setxattr = 5,
20 lsetxattr = 6,
21 fsetxattr = 7,
22 getxattr = 8,
23 lgetxattr = 9,
24 fgetxattr = 10,
25 listxattr = 11,
26 llistxattr = 12,
27 flistxattr = 13,
28 removexattr = 14,
29 lremovexattr = 15,
30 fremovexattr = 16,
31 getcwd = 17,
32 lookup_dcookie = 18,
33 eventfd2 = 19,
34 epoll_create1 = 20,
35 epoll_ctl = 21,
36 epoll_pwait = 22,
37 dup = 23,
38 dup3 = 24,
39 fcntl = 25,
40 inotify_init1 = 26,
41 inotify_add_watch = 27,
42 inotify_rm_watch = 28,
43 ioctl = 29,
44 ioprio_set = 30,
45 ioprio_get = 31,
46 flock = 32,
47 mknodat = 33,
48 mkdirat = 34,
49 unlinkat = 35,
50 symlinkat = 36,
51 linkat = 37,
52 renameat = 38,
53 umount2 = 39,
54 mount = 40,
55 pivot_root = 41,
56 nfsservctl = 42,
57 statfs = 43,
58 fstatfs = 44,
59 truncate = 45,
60 ftruncate = 46,
61 fallocate = 47,
62 faccessat = 48,
63 chdir = 49,
64 fchdir = 50,
65 chroot = 51,
66 fchmod = 52,
67 fchmodat = 53,
68 fchownat = 54,
69 fchown = 55,
70 openat = 56,
71 close = 57,
72 vhangup = 58,
73 pipe2 = 59,
74 quotactl = 60,
75 getdents64 = 61,
76 lseek = 62,
77 read = 63,
78 write = 64,
79 readv = 65,
80 writev = 66,
81 pread64 = 67,
82 pwrite64 = 68,
83 preadv = 69,
84 pwritev = 70,
85 sendfile = 71,
86 pselect6 = 72,
87 ppoll = 73,
88 signalfd4 = 74,
89 vmsplice = 75,
90 splice = 76,
91 tee = 77,
92 readlinkat = 78,
93 fstatat = 79,
94 fstat = 80,
95 sync = 81,
96 fsync = 82,
97 fdatasync = 83,
98 sync_file_range2 = 84,
99 sync_file_range = 84,
100 timerfd_create = 85,
101 timerfd_settime = 86,
102 timerfd_gettime = 87,
103 utimensat = 88,
104 acct = 89,
105 capget = 90,
106 capset = 91,
107 personality = 92,
108 exit = 93,
109 exit_group = 94,
110 waitid = 95,
111 set_tid_address = 96,
112 unshare = 97,
113 futex = 98,
114 set_robust_list = 99,
115 get_robust_list = 100,
116 nanosleep = 101,
117 getitimer = 102,
118 setitimer = 103,
119 kexec_load = 104,
120 init_module = 105,
121 delete_module = 106,
122 timer_create = 107,
123 timer_gettime = 108,
124 timer_getoverrun = 109,
125 timer_settime = 110,
126 timer_delete = 111,
127 clock_settime = 112,
128 clock_gettime = 113,
129 clock_getres = 114,
130 clock_nanosleep = 115,
131 syslog = 116,
132 ptrace = 117,
133 sched_setparam = 118,
134 sched_setscheduler = 119,
135 sched_getscheduler = 120,
136 sched_getparam = 121,
137 sched_setaffinity = 122,
138 sched_getaffinity = 123,
139 sched_yield = 124,
140 sched_get_priority_max = 125,
141 sched_get_priority_min = 126,
142 sched_rr_get_interval = 127,
143 restart_syscall = 128,
144 kill = 129,
145 tkill = 130,
146 tgkill = 131,
147 sigaltstack = 132,
148 rt_sigsuspend = 133,
149 rt_sigaction = 134,
150 rt_sigprocmask = 135,
151 rt_sigpending = 136,
152 rt_sigtimedwait = 137,
153 rt_sigqueueinfo = 138,
154 rt_sigreturn = 139,
155 setpriority = 140,
156 getpriority = 141,
157 reboot = 142,
158 setregid = 143,
159 setgid = 144,
160 setreuid = 145,
161 setuid = 146,
162 setresuid = 147,
163 getresuid = 148,
164 setresgid = 149,
165 getresgid = 150,
166 setfsuid = 151,
167 setfsgid = 152,
168 times = 153,
169 setpgid = 154,
170 getpgid = 155,
171 getsid = 156,
172 setsid = 157,
173 getgroups = 158,
174 setgroups = 159,
175 uname = 160,
176 sethostname = 161,
177 setdomainname = 162,
178 getrlimit = 163,
179 setrlimit = 164,
180 getrusage = 165,
181 umask = 166,
182 prctl = 167,
183 getcpu = 168,
184 gettimeofday = 169,
185 settimeofday = 170,
186 adjtimex = 171,
187 getpid = 172,
188 getppid = 173,
189 getuid = 174,
190 geteuid = 175,
191 getgid = 176,
192 getegid = 177,
193 gettid = 178,
194 sysinfo = 179,
195 mq_open = 180,
196 mq_unlink = 181,
197 mq_timedsend = 182,
198 mq_timedreceive = 183,
199 mq_notify = 184,
200 mq_getsetattr = 185,
201 msgget = 186,
202 msgctl = 187,
203 msgrcv = 188,
204 msgsnd = 189,
205 semget = 190,
206 semctl = 191,
207 semtimedop = 192,
208 semop = 193,
209 shmget = 194,
210 shmctl = 195,
211 shmat = 196,
212 shmdt = 197,
213 socket = 198,
214 socketpair = 199,
215 bind = 200,
216 listen = 201,
217 accept = 202,
218 connect = 203,
219 getsockname = 204,
220 getpeername = 205,
221 sendto = 206,
222 recvfrom = 207,
223 setsockopt = 208,
224 getsockopt = 209,
225 shutdown = 210,
226 sendmsg = 211,
227 recvmsg = 212,
228 readahead = 213,
229 brk = 214,
230 munmap = 215,
231 mremap = 216,
232 add_key = 217,
233 request_key = 218,
234 keyctl = 219,
235 clone = 220,
236 execve = 221,
237 mmap = 222,
238 fadvise64 = 223,
239 swapon = 224,
240 swapoff = 225,
241 mprotect = 226,
242 msync = 227,
243 mlock = 228,
244 munlock = 229,
245 mlockall = 230,
246 munlockall = 231,
247 mincore = 232,
248 madvise = 233,
249 remap_file_pages = 234,
250 mbind = 235,
251 get_mempolicy = 236,
252 set_mempolicy = 237,
253 migrate_pages = 238,
254 move_pages = 239,
255 rt_tgsigqueueinfo = 240,
256 perf_event_open = 241,
257 accept4 = 242,
258 recvmmsg = 243,
259 arch_specific_syscall = 244,
260 wait4 = 260,
261 prlimit64 = 261,
262 fanotify_init = 262,
263 fanotify_mark = 263,
264 clock_adjtime = 266,
265 syncfs = 267,
266 setns = 268,
267 sendmmsg = 269,
268 process_vm_readv = 270,
269 process_vm_writev = 271,
270 kcmp = 272,
271 finit_module = 273,
272 sched_setattr = 274,
273 sched_getattr = 275,
274 renameat2 = 276,
275 seccomp = 277,
276 getrandom = 278,
277 memfd_create = 279,
278 bpf = 280,
279 execveat = 281,
280 userfaultfd = 282,
281 membarrier = 283,
282 mlock2 = 284,
283 copy_file_range = 285,
284 preadv2 = 286,
285 pwritev2 = 287,
286 pkey_mprotect = 288,
287 pkey_alloc = 289,
288 pkey_free = 290,
289 statx = 291,
290 io_pgetevents = 292,
291 rseq = 293,
292 kexec_file_load = 294,
293 pidfd_send_signal = 424,
294 io_uring_setup = 425,
295 io_uring_enter = 426,
296 io_uring_register = 427,
297 open_tree = 428,
298 move_mount = 429,
299 fsopen = 430,
300 fsconfig = 431,
301 fsmount = 432,
302 fspick = 433,
303 pidfd_open = 434,
304 clone3 = 435,
305 openat2 = 437,
306 pidfd_getfd = 438,
13307
14pub const SYS_io_setup = 0;308 _,
15pub const SYS_io_destroy = 1;309};
16pub const SYS_io_submit = 2;
17pub const SYS_io_cancel = 3;
18pub const SYS_io_getevents = 4;
19pub const SYS_setxattr = 5;
20pub const SYS_lsetxattr = 6;
21pub const SYS_fsetxattr = 7;
22pub const SYS_getxattr = 8;
23pub const SYS_lgetxattr = 9;
24pub const SYS_fgetxattr = 10;
25pub const SYS_listxattr = 11;
26pub const SYS_llistxattr = 12;
27pub const SYS_flistxattr = 13;
28pub const SYS_removexattr = 14;
29pub const SYS_lremovexattr = 15;
30pub const SYS_fremovexattr = 16;
31pub const SYS_getcwd = 17;
32pub const SYS_lookup_dcookie = 18;
33pub const SYS_eventfd2 = 19;
34pub const SYS_epoll_create1 = 20;
35pub const SYS_epoll_ctl = 21;
36pub const SYS_epoll_pwait = 22;
37pub const SYS_dup = 23;
38pub const SYS_dup3 = 24;
39pub const SYS_fcntl = 25;
40pub const SYS_inotify_init1 = 26;
41pub const SYS_inotify_add_watch = 27;
42pub const SYS_inotify_rm_watch = 28;
43pub const SYS_ioctl = 29;
44pub const SYS_ioprio_set = 30;
45pub const SYS_ioprio_get = 31;
46pub const SYS_flock = 32;
47pub const SYS_mknodat = 33;
48pub const SYS_mkdirat = 34;
49pub const SYS_unlinkat = 35;
50pub const SYS_symlinkat = 36;
51pub const SYS_linkat = 37;
52pub const SYS_renameat = 38;
53pub const SYS_umount2 = 39;
54pub const SYS_mount = 40;
55pub const SYS_pivot_root = 41;
56pub const SYS_nfsservctl = 42;
57pub const SYS_statfs = 43;
58pub const SYS_fstatfs = 44;
59pub const SYS_truncate = 45;
60pub const SYS_ftruncate = 46;
61pub const SYS_fallocate = 47;
62pub const SYS_faccessat = 48;
63pub const SYS_chdir = 49;
64pub const SYS_fchdir = 50;
65pub const SYS_chroot = 51;
66pub const SYS_fchmod = 52;
67pub const SYS_fchmodat = 53;
68pub const SYS_fchownat = 54;
69pub const SYS_fchown = 55;
70pub const SYS_openat = 56;
71pub const SYS_close = 57;
72pub const SYS_vhangup = 58;
73pub const SYS_pipe2 = 59;
74pub const SYS_quotactl = 60;
75pub const SYS_getdents64 = 61;
76pub const SYS_lseek = 62;
77pub const SYS_read = 63;
78pub const SYS_write = 64;
79pub const SYS_readv = 65;
80pub const SYS_writev = 66;
81pub const SYS_pread64 = 67;
82pub const SYS_pwrite64 = 68;
83pub const SYS_preadv = 69;
84pub const SYS_pwritev = 70;
85pub const SYS_sendfile = 71;
86pub const SYS_pselect6 = 72;
87pub const SYS_ppoll = 73;
88pub const SYS_signalfd4 = 74;
89pub const SYS_vmsplice = 75;
90pub const SYS_splice = 76;
91pub const SYS_tee = 77;
92pub const SYS_readlinkat = 78;
93pub const SYS_fstatat = 79;
94pub const SYS_fstat = 80;
95pub const SYS_sync = 81;
96pub const SYS_fsync = 82;
97pub const SYS_fdatasync = 83;
98pub const SYS_sync_file_range2 = 84;
99pub const SYS_sync_file_range = 84;
100pub const SYS_timerfd_create = 85;
101pub const SYS_timerfd_settime = 86;
102pub const SYS_timerfd_gettime = 87;
103pub const SYS_utimensat = 88;
104pub const SYS_acct = 89;
105pub const SYS_capget = 90;
106pub const SYS_capset = 91;
107pub const SYS_personality = 92;
108pub const SYS_exit = 93;
109pub const SYS_exit_group = 94;
110pub const SYS_waitid = 95;
111pub const SYS_set_tid_address = 96;
112pub const SYS_unshare = 97;
113pub const SYS_futex = 98;
114pub const SYS_set_robust_list = 99;
115pub const SYS_get_robust_list = 100;
116pub const SYS_nanosleep = 101;
117pub const SYS_getitimer = 102;
118pub const SYS_setitimer = 103;
119pub const SYS_kexec_load = 104;
120pub const SYS_init_module = 105;
121pub const SYS_delete_module = 106;
122pub const SYS_timer_create = 107;
123pub const SYS_timer_gettime = 108;
124pub const SYS_timer_getoverrun = 109;
125pub const SYS_timer_settime = 110;
126pub const SYS_timer_delete = 111;
127pub const SYS_clock_settime = 112;
128pub const SYS_clock_gettime = 113;
129pub const SYS_clock_getres = 114;
130pub const SYS_clock_nanosleep = 115;
131pub const SYS_syslog = 116;
132pub const SYS_ptrace = 117;
133pub const SYS_sched_setparam = 118;
134pub const SYS_sched_setscheduler = 119;
135pub const SYS_sched_getscheduler = 120;
136pub const SYS_sched_getparam = 121;
137pub const SYS_sched_setaffinity = 122;
138pub const SYS_sched_getaffinity = 123;
139pub const SYS_sched_yield = 124;
140pub const SYS_sched_get_priority_max = 125;
141pub const SYS_sched_get_priority_min = 126;
142pub const SYS_sched_rr_get_interval = 127;
143pub const SYS_restart_syscall = 128;
144pub const SYS_kill = 129;
145pub const SYS_tkill = 130;
146pub const SYS_tgkill = 131;
147pub const SYS_sigaltstack = 132;
148pub const SYS_rt_sigsuspend = 133;
149pub const SYS_rt_sigaction = 134;
150pub const SYS_rt_sigprocmask = 135;
151pub const SYS_rt_sigpending = 136;
152pub const SYS_rt_sigtimedwait = 137;
153pub const SYS_rt_sigqueueinfo = 138;
154pub const SYS_rt_sigreturn = 139;
155pub const SYS_setpriority = 140;
156pub const SYS_getpriority = 141;
157pub const SYS_reboot = 142;
158pub const SYS_setregid = 143;
159pub const SYS_setgid = 144;
160pub const SYS_setreuid = 145;
161pub const SYS_setuid = 146;
162pub const SYS_setresuid = 147;
163pub const SYS_getresuid = 148;
164pub const SYS_setresgid = 149;
165pub const SYS_getresgid = 150;
166pub const SYS_setfsuid = 151;
167pub const SYS_setfsgid = 152;
168pub const SYS_times = 153;
169pub const SYS_setpgid = 154;
170pub const SYS_getpgid = 155;
171pub const SYS_getsid = 156;
172pub const SYS_setsid = 157;
173pub const SYS_getgroups = 158;
174pub const SYS_setgroups = 159;
175pub const SYS_uname = 160;
176pub const SYS_sethostname = 161;
177pub const SYS_setdomainname = 162;
178pub const SYS_getrlimit = 163;
179pub const SYS_setrlimit = 164;
180pub const SYS_getrusage = 165;
181pub const SYS_umask = 166;
182pub const SYS_prctl = 167;
183pub const SYS_getcpu = 168;
184pub const SYS_gettimeofday = 169;
185pub const SYS_settimeofday = 170;
186pub const SYS_adjtimex = 171;
187pub const SYS_getpid = 172;
188pub const SYS_getppid = 173;
189pub const SYS_getuid = 174;
190pub const SYS_geteuid = 175;
191pub const SYS_getgid = 176;
192pub const SYS_getegid = 177;
193pub const SYS_gettid = 178;
194pub const SYS_sysinfo = 179;
195pub const SYS_mq_open = 180;
196pub const SYS_mq_unlink = 181;
197pub const SYS_mq_timedsend = 182;
198pub const SYS_mq_timedreceive = 183;
199pub const SYS_mq_notify = 184;
200pub const SYS_mq_getsetattr = 185;
201pub const SYS_msgget = 186;
202pub const SYS_msgctl = 187;
203pub const SYS_msgrcv = 188;
204pub const SYS_msgsnd = 189;
205pub const SYS_semget = 190;
206pub const SYS_semctl = 191;
207pub const SYS_semtimedop = 192;
208pub const SYS_semop = 193;
209pub const SYS_shmget = 194;
210pub const SYS_shmctl = 195;
211pub const SYS_shmat = 196;
212pub const SYS_shmdt = 197;
213pub const SYS_socket = 198;
214pub const SYS_socketpair = 199;
215pub const SYS_bind = 200;
216pub const SYS_listen = 201;
217pub const SYS_accept = 202;
218pub const SYS_connect = 203;
219pub const SYS_getsockname = 204;
220pub const SYS_getpeername = 205;
221pub const SYS_sendto = 206;
222pub const SYS_recvfrom = 207;
223pub const SYS_setsockopt = 208;
224pub const SYS_getsockopt = 209;
225pub const SYS_shutdown = 210;
226pub const SYS_sendmsg = 211;
227pub const SYS_recvmsg = 212;
228pub const SYS_readahead = 213;
229pub const SYS_brk = 214;
230pub const SYS_munmap = 215;
231pub const SYS_mremap = 216;
232pub const SYS_add_key = 217;
233pub const SYS_request_key = 218;
234pub const SYS_keyctl = 219;
235pub const SYS_clone = 220;
236pub const SYS_execve = 221;
237pub const SYS_mmap = 222;
238pub const SYS_fadvise64 = 223;
239pub const SYS_swapon = 224;
240pub const SYS_swapoff = 225;
241pub const SYS_mprotect = 226;
242pub const SYS_msync = 227;
243pub const SYS_mlock = 228;
244pub const SYS_munlock = 229;
245pub const SYS_mlockall = 230;
246pub const SYS_munlockall = 231;
247pub const SYS_mincore = 232;
248pub const SYS_madvise = 233;
249pub const SYS_remap_file_pages = 234;
250pub const SYS_mbind = 235;
251pub const SYS_get_mempolicy = 236;
252pub const SYS_set_mempolicy = 237;
253pub const SYS_migrate_pages = 238;
254pub const SYS_move_pages = 239;
255pub const SYS_rt_tgsigqueueinfo = 240;
256pub const SYS_perf_event_open = 241;
257pub const SYS_accept4 = 242;
258pub const SYS_recvmmsg = 243;
259pub const SYS_arch_specific_syscall = 244;
260pub const SYS_wait4 = 260;
261pub const SYS_prlimit64 = 261;
262pub const SYS_fanotify_init = 262;
263pub const SYS_fanotify_mark = 263;
264pub const SYS_clock_adjtime = 266;
265pub const SYS_syncfs = 267;
266pub const SYS_setns = 268;
267pub const SYS_sendmmsg = 269;
268pub const SYS_process_vm_readv = 270;
269pub const SYS_process_vm_writev = 271;
270pub const SYS_kcmp = 272;
271pub const SYS_finit_module = 273;
272pub const SYS_sched_setattr = 274;
273pub const SYS_sched_getattr = 275;
274pub const SYS_renameat2 = 276;
275pub const SYS_seccomp = 277;
276pub const SYS_getrandom = 278;
277pub const SYS_memfd_create = 279;
278pub const SYS_bpf = 280;
279pub const SYS_execveat = 281;
280pub const SYS_userfaultfd = 282;
281pub const SYS_membarrier = 283;
282pub const SYS_mlock2 = 284;
283pub const SYS_copy_file_range = 285;
284pub const SYS_preadv2 = 286;
285pub const SYS_pwritev2 = 287;
286pub const SYS_pkey_mprotect = 288;
287pub const SYS_pkey_alloc = 289;
288pub const SYS_pkey_free = 290;
289pub const SYS_statx = 291;
290pub const SYS_io_pgetevents = 292;
291pub const SYS_rseq = 293;
292pub const SYS_kexec_file_load = 294;
293pub const SYS_pidfd_send_signal = 424;
294pub const SYS_io_uring_setup = 425;
295pub const SYS_io_uring_enter = 426;
296pub const SYS_io_uring_register = 427;
297pub const SYS_open_tree = 428;
298pub const SYS_move_mount = 429;
299pub const SYS_fsopen = 430;
300pub const SYS_fsconfig = 431;
301pub const SYS_fsmount = 432;
302pub const SYS_fspick = 433;
303pub const SYS_pidfd_open = 434;
304pub const SYS_clone3 = 435;
305pub const SYS_openat2 = 437;
306pub const SYS_pidfd_getfd = 438;
307310
308pub const O_CREAT = 0o100;311pub const O_CREAT = 0o100;
309pub const O_EXCL = 0o200;312pub const O_EXCL = 0o200;
lib/std/os/bits/linux/i386.zig+429-425
...@@ -11,431 +11,435 @@ const gid_t = linux.gid_t;...@@ -11,431 +11,435 @@ const gid_t = linux.gid_t;
11const stack_t = linux.stack_t;11const stack_t = linux.stack_t;
12const sigset_t = linux.sigset_t;12const sigset_t = linux.sigset_t;
1313
14pub const SYS_restart_syscall = 0;14pub const SYS = extern enum(usize) {
15pub const SYS_exit = 1;15 restart_syscall = 0,
16pub const SYS_fork = 2;16 exit = 1,
17pub const SYS_read = 3;17 fork = 2,
18pub const SYS_write = 4;18 read = 3,
19pub const SYS_open = 5;19 write = 4,
20pub const SYS_close = 6;20 open = 5,
21pub const SYS_waitpid = 7;21 close = 6,
22pub const SYS_creat = 8;22 waitpid = 7,
23pub const SYS_link = 9;23 creat = 8,
24pub const SYS_unlink = 10;24 link = 9,
25pub const SYS_execve = 11;25 unlink = 10,
26pub const SYS_chdir = 12;26 execve = 11,
27pub const SYS_time = 13;27 chdir = 12,
28pub const SYS_mknod = 14;28 time = 13,
29pub const SYS_chmod = 15;29 mknod = 14,
30pub const SYS_lchown = 16;30 chmod = 15,
31pub const SYS_break = 17;31 lchown = 16,
32pub const SYS_oldstat = 18;32 @"break" = 17,
33pub const SYS_lseek = 19;33 oldstat = 18,
34pub const SYS_getpid = 20;34 lseek = 19,
35pub const SYS_mount = 21;35 getpid = 20,
36pub const SYS_umount = 22;36 mount = 21,
37pub const SYS_setuid = 23;37 umount = 22,
38pub const SYS_getuid = 24;38 setuid = 23,
39pub const SYS_stime = 25;39 getuid = 24,
40pub const SYS_ptrace = 26;40 stime = 25,
41pub const SYS_alarm = 27;41 ptrace = 26,
42pub const SYS_oldfstat = 28;42 alarm = 27,
43pub const SYS_pause = 29;43 oldfstat = 28,
44pub const SYS_utime = 30;44 pause = 29,
45pub const SYS_stty = 31;45 utime = 30,
46pub const SYS_gtty = 32;46 stty = 31,
47pub const SYS_access = 33;47 gtty = 32,
48pub const SYS_nice = 34;48 access = 33,
49pub const SYS_ftime = 35;49 nice = 34,
50pub const SYS_sync = 36;50 ftime = 35,
51pub const SYS_kill = 37;51 sync = 36,
52pub const SYS_rename = 38;52 kill = 37,
53pub const SYS_mkdir = 39;53 rename = 38,
54pub const SYS_rmdir = 40;54 mkdir = 39,
55pub const SYS_dup = 41;55 rmdir = 40,
56pub const SYS_pipe = 42;56 dup = 41,
57pub const SYS_times = 43;57 pipe = 42,
58pub const SYS_prof = 44;58 times = 43,
59pub const SYS_brk = 45;59 prof = 44,
60pub const SYS_setgid = 46;60 brk = 45,
61pub const SYS_getgid = 47;61 setgid = 46,
62pub const SYS_signal = 48;62 getgid = 47,
63pub const SYS_geteuid = 49;63 signal = 48,
64pub const SYS_getegid = 50;64 geteuid = 49,
65pub const SYS_acct = 51;65 getegid = 50,
66pub const SYS_umount2 = 52;66 acct = 51,
67pub const SYS_lock = 53;67 umount2 = 52,
68pub const SYS_ioctl = 54;68 lock = 53,
69pub const SYS_fcntl = 55;69 ioctl = 54,
70pub const SYS_mpx = 56;70 fcntl = 55,
71pub const SYS_setpgid = 57;71 mpx = 56,
72pub const SYS_ulimit = 58;72 setpgid = 57,
73pub const SYS_oldolduname = 59;73 ulimit = 58,
74pub const SYS_umask = 60;74 oldolduname = 59,
75pub const SYS_chroot = 61;75 umask = 60,
76pub const SYS_ustat = 62;76 chroot = 61,
77pub const SYS_dup2 = 63;77 ustat = 62,
78pub const SYS_getppid = 64;78 dup2 = 63,
79pub const SYS_getpgrp = 65;79 getppid = 64,
80pub const SYS_setsid = 66;80 getpgrp = 65,
81pub const SYS_sigaction = 67;81 setsid = 66,
82pub const SYS_sgetmask = 68;82 sigaction = 67,
83pub const SYS_ssetmask = 69;83 sgetmask = 68,
84pub const SYS_setreuid = 70;84 ssetmask = 69,
85pub const SYS_setregid = 71;85 setreuid = 70,
86pub const SYS_sigsuspend = 72;86 setregid = 71,
87pub const SYS_sigpending = 73;87 sigsuspend = 72,
88pub const SYS_sethostname = 74;88 sigpending = 73,
89pub const SYS_setrlimit = 75;89 sethostname = 74,
90pub const SYS_getrlimit = 76;90 setrlimit = 75,
91pub const SYS_getrusage = 77;91 getrlimit = 76,
92pub const SYS_gettimeofday = 78;92 getrusage = 77,
93pub const SYS_settimeofday = 79;93 gettimeofday = 78,
94pub const SYS_getgroups = 80;94 settimeofday = 79,
95pub const SYS_setgroups = 81;95 getgroups = 80,
96pub const SYS_select = 82;96 setgroups = 81,
97pub const SYS_symlink = 83;97 select = 82,
98pub const SYS_oldlstat = 84;98 symlink = 83,
99pub const SYS_readlink = 85;99 oldlstat = 84,
100pub const SYS_uselib = 86;100 readlink = 85,
101pub const SYS_swapon = 87;101 uselib = 86,
102pub const SYS_reboot = 88;102 swapon = 87,
103pub const SYS_readdir = 89;103 reboot = 88,
104pub const SYS_mmap = 90;104 readdir = 89,
105pub const SYS_munmap = 91;105 mmap = 90,
106pub const SYS_truncate = 92;106 munmap = 91,
107pub const SYS_ftruncate = 93;107 truncate = 92,
108pub const SYS_fchmod = 94;108 ftruncate = 93,
109pub const SYS_fchown = 95;109 fchmod = 94,
110pub const SYS_getpriority = 96;110 fchown = 95,
111pub const SYS_setpriority = 97;111 getpriority = 96,
112pub const SYS_profil = 98;112 setpriority = 97,
113pub const SYS_statfs = 99;113 profil = 98,
114pub const SYS_fstatfs = 100;114 statfs = 99,
115pub const SYS_ioperm = 101;115 fstatfs = 100,
116pub const SYS_socketcall = 102;116 ioperm = 101,
117pub const SYS_syslog = 103;117 socketcall = 102,
118pub const SYS_setitimer = 104;118 syslog = 103,
119pub const SYS_getitimer = 105;119 setitimer = 104,
120pub const SYS_stat = 106;120 getitimer = 105,
121pub const SYS_lstat = 107;121 stat = 106,
122pub const SYS_fstat = 108;122 lstat = 107,
123pub const SYS_olduname = 109;123 fstat = 108,
124pub const SYS_iopl = 110;124 olduname = 109,
125pub const SYS_vhangup = 111;125 iopl = 110,
126pub const SYS_idle = 112;126 vhangup = 111,
127pub const SYS_vm86old = 113;127 idle = 112,
128pub const SYS_wait4 = 114;128 vm86old = 113,
129pub const SYS_swapoff = 115;129 wait4 = 114,
130pub const SYS_sysinfo = 116;130 swapoff = 115,
131pub const SYS_ipc = 117;131 sysinfo = 116,
132pub const SYS_fsync = 118;132 ipc = 117,
133pub const SYS_sigreturn = 119;133 fsync = 118,
134pub const SYS_clone = 120;134 sigreturn = 119,
135pub const SYS_setdomainname = 121;135 clone = 120,
136pub const SYS_uname = 122;136 setdomainname = 121,
137pub const SYS_modify_ldt = 123;137 uname = 122,
138pub const SYS_adjtimex = 124;138 modify_ldt = 123,
139pub const SYS_mprotect = 125;139 adjtimex = 124,
140pub const SYS_sigprocmask = 126;140 mprotect = 125,
141pub const SYS_create_module = 127;141 sigprocmask = 126,
142pub const SYS_init_module = 128;142 create_module = 127,
143pub const SYS_delete_module = 129;143 init_module = 128,
144pub const SYS_get_kernel_syms = 130;144 delete_module = 129,
145pub const SYS_quotactl = 131;145 get_kernel_syms = 130,
146pub const SYS_getpgid = 132;146 quotactl = 131,
147pub const SYS_fchdir = 133;147 getpgid = 132,
148pub const SYS_bdflush = 134;148 fchdir = 133,
149pub const SYS_sysfs = 135;149 bdflush = 134,
150pub const SYS_personality = 136;150 sysfs = 135,
151pub const SYS_afs_syscall = 137;151 personality = 136,
152pub const SYS_setfsuid = 138;152 afs_syscall = 137,
153pub const SYS_setfsgid = 139;153 setfsuid = 138,
154pub const SYS__llseek = 140;154 setfsgid = 139,
155pub const SYS_getdents = 141;155 _llseek = 140,
156pub const SYS__newselect = 142;156 getdents = 141,
157pub const SYS_flock = 143;157 _newselect = 142,
158pub const SYS_msync = 144;158 flock = 143,
159pub const SYS_readv = 145;159 msync = 144,
160pub const SYS_writev = 146;160 readv = 145,
161pub const SYS_getsid = 147;161 writev = 146,
162pub const SYS_fdatasync = 148;162 getsid = 147,
163pub const SYS__sysctl = 149;163 fdatasync = 148,
164pub const SYS_mlock = 150;164 _sysctl = 149,
165pub const SYS_munlock = 151;165 mlock = 150,
166pub const SYS_mlockall = 152;166 munlock = 151,
167pub const SYS_munlockall = 153;167 mlockall = 152,
168pub const SYS_sched_setparam = 154;168 munlockall = 153,
169pub const SYS_sched_getparam = 155;169 sched_setparam = 154,
170pub const SYS_sched_setscheduler = 156;170 sched_getparam = 155,
171pub const SYS_sched_getscheduler = 157;171 sched_setscheduler = 156,
172pub const SYS_sched_yield = 158;172 sched_getscheduler = 157,
173pub const SYS_sched_get_priority_max = 159;173 sched_yield = 158,
174pub const SYS_sched_get_priority_min = 160;174 sched_get_priority_max = 159,
175pub const SYS_sched_rr_get_interval = 161;175 sched_get_priority_min = 160,
176pub const SYS_nanosleep = 162;176 sched_rr_get_interval = 161,
177pub const SYS_mremap = 163;177 nanosleep = 162,
178pub const SYS_setresuid = 164;178 mremap = 163,
179pub const SYS_getresuid = 165;179 setresuid = 164,
180pub const SYS_vm86 = 166;180 getresuid = 165,
181pub const SYS_query_module = 167;181 vm86 = 166,
182pub const SYS_poll = 168;182 query_module = 167,
183pub const SYS_nfsservctl = 169;183 poll = 168,
184pub const SYS_setresgid = 170;184 nfsservctl = 169,
185pub const SYS_getresgid = 171;185 setresgid = 170,
186pub const SYS_prctl = 172;186 getresgid = 171,
187pub const SYS_rt_sigreturn = 173;187 prctl = 172,
188pub const SYS_rt_sigaction = 174;188 rt_sigreturn = 173,
189pub const SYS_rt_sigprocmask = 175;189 rt_sigaction = 174,
190pub const SYS_rt_sigpending = 176;190 rt_sigprocmask = 175,
191pub const SYS_rt_sigtimedwait = 177;191 rt_sigpending = 176,
192pub const SYS_rt_sigqueueinfo = 178;192 rt_sigtimedwait = 177,
193pub const SYS_rt_sigsuspend = 179;193 rt_sigqueueinfo = 178,
194pub const SYS_pread64 = 180;194 rt_sigsuspend = 179,
195pub const SYS_pwrite64 = 181;195 pread64 = 180,
196pub const SYS_chown = 182;196 pwrite64 = 181,
197pub const SYS_getcwd = 183;197 chown = 182,
198pub const SYS_capget = 184;198 getcwd = 183,
199pub const SYS_capset = 185;199 capget = 184,
200pub const SYS_sigaltstack = 186;200 capset = 185,
201pub const SYS_sendfile = 187;201 sigaltstack = 186,
202pub const SYS_getpmsg = 188;202 sendfile = 187,
203pub const SYS_putpmsg = 189;203 getpmsg = 188,
204pub const SYS_vfork = 190;204 putpmsg = 189,
205pub const SYS_ugetrlimit = 191;205 vfork = 190,
206pub const SYS_mmap2 = 192;206 ugetrlimit = 191,
207pub const SYS_truncate64 = 193;207 mmap2 = 192,
208pub const SYS_ftruncate64 = 194;208 truncate64 = 193,
209pub const SYS_stat64 = 195;209 ftruncate64 = 194,
210pub const SYS_lstat64 = 196;210 stat64 = 195,
211pub const SYS_fstat64 = 197;211 lstat64 = 196,
212pub const SYS_lchown32 = 198;212 fstat64 = 197,
213pub const SYS_getuid32 = 199;213 lchown32 = 198,
214pub const SYS_getgid32 = 200;214 getuid32 = 199,
215pub const SYS_geteuid32 = 201;215 getgid32 = 200,
216pub const SYS_getegid32 = 202;216 geteuid32 = 201,
217pub const SYS_setreuid32 = 203;217 getegid32 = 202,
218pub const SYS_setregid32 = 204;218 setreuid32 = 203,
219pub const SYS_getgroups32 = 205;219 setregid32 = 204,
220pub const SYS_setgroups32 = 206;220 getgroups32 = 205,
221pub const SYS_fchown32 = 207;221 setgroups32 = 206,
222pub const SYS_setresuid32 = 208;222 fchown32 = 207,
223pub const SYS_getresuid32 = 209;223 setresuid32 = 208,
224pub const SYS_setresgid32 = 210;224 getresuid32 = 209,
225pub const SYS_getresgid32 = 211;225 setresgid32 = 210,
226pub const SYS_chown32 = 212;226 getresgid32 = 211,
227pub const SYS_setuid32 = 213;227 chown32 = 212,
228pub const SYS_setgid32 = 214;228 setuid32 = 213,
229pub const SYS_setfsuid32 = 215;229 setgid32 = 214,
230pub const SYS_setfsgid32 = 216;230 setfsuid32 = 215,
231pub const SYS_pivot_root = 217;231 setfsgid32 = 216,
232pub const SYS_mincore = 218;232 pivot_root = 217,
233pub const SYS_madvise = 219;233 mincore = 218,
234pub const SYS_getdents64 = 220;234 madvise = 219,
235pub const SYS_fcntl64 = 221;235 getdents64 = 220,
236pub const SYS_gettid = 224;236 fcntl64 = 221,
237pub const SYS_readahead = 225;237 gettid = 224,
238pub const SYS_setxattr = 226;238 readahead = 225,
239pub const SYS_lsetxattr = 227;239 setxattr = 226,
240pub const SYS_fsetxattr = 228;240 lsetxattr = 227,
241pub const SYS_getxattr = 229;241 fsetxattr = 228,
242pub const SYS_lgetxattr = 230;242 getxattr = 229,
243pub const SYS_fgetxattr = 231;243 lgetxattr = 230,
244pub const SYS_listxattr = 232;244 fgetxattr = 231,
245pub const SYS_llistxattr = 233;245 listxattr = 232,
246pub const SYS_flistxattr = 234;246 llistxattr = 233,
247pub const SYS_removexattr = 235;247 flistxattr = 234,
248pub const SYS_lremovexattr = 236;248 removexattr = 235,
249pub const SYS_fremovexattr = 237;249 lremovexattr = 236,
250pub const SYS_tkill = 238;250 fremovexattr = 237,
251pub const SYS_sendfile64 = 239;251 tkill = 238,
252pub const SYS_futex = 240;252 sendfile64 = 239,
253pub const SYS_sched_setaffinity = 241;253 futex = 240,
254pub const SYS_sched_getaffinity = 242;254 sched_setaffinity = 241,
255pub const SYS_set_thread_area = 243;255 sched_getaffinity = 242,
256pub const SYS_get_thread_area = 244;256 set_thread_area = 243,
257pub const SYS_io_setup = 245;257 get_thread_area = 244,
258pub const SYS_io_destroy = 246;258 io_setup = 245,
259pub const SYS_io_getevents = 247;259 io_destroy = 246,
260pub const SYS_io_submit = 248;260 io_getevents = 247,
261pub const SYS_io_cancel = 249;261 io_submit = 248,
262pub const SYS_fadvise64 = 250;262 io_cancel = 249,
263pub const SYS_exit_group = 252;263 fadvise64 = 250,
264pub const SYS_lookup_dcookie = 253;264 exit_group = 252,
265pub const SYS_epoll_create = 254;265 lookup_dcookie = 253,
266pub const SYS_epoll_ctl = 255;266 epoll_create = 254,
267pub const SYS_epoll_wait = 256;267 epoll_ctl = 255,
268pub const SYS_remap_file_pages = 257;268 epoll_wait = 256,
269pub const SYS_set_tid_address = 258;269 remap_file_pages = 257,
270pub const SYS_timer_create = 259;270 set_tid_address = 258,
271pub const SYS_timer_settime = SYS_timer_create + 1;271 timer_create = 259,
272pub const SYS_timer_gettime = SYS_timer_create + 2;272 timer_settime, // SYS_timer_create + 1
273pub const SYS_timer_getoverrun = SYS_timer_create + 3;273 timer_gettime, // SYS_timer_create + 2
274pub const SYS_timer_delete = SYS_timer_create + 4;274 timer_getoverrun, // SYS_timer_create + 3
275pub const SYS_clock_settime = SYS_timer_create + 5;275 timer_delete, // SYS_timer_create + 4
276pub const SYS_clock_gettime = SYS_timer_create + 6;276 clock_settime, // SYS_timer_create + 5
277pub const SYS_clock_getres = SYS_timer_create + 7;277 clock_gettime, // SYS_timer_create + 6
278pub const SYS_clock_nanosleep = SYS_timer_create + 8;278 clock_getres, // SYS_timer_create + 7
279pub const SYS_statfs64 = 268;279 clock_nanosleep, // SYS_timer_create + 8
280pub const SYS_fstatfs64 = 269;280 statfs64 = 268,
281pub const SYS_tgkill = 270;281 fstatfs64 = 269,
282pub const SYS_utimes = 271;282 tgkill = 270,
283pub const SYS_fadvise64_64 = 272;283 utimes = 271,
284pub const SYS_vserver = 273;284 fadvise64_64 = 272,
285pub const SYS_mbind = 274;285 vserver = 273,
286pub const SYS_get_mempolicy = 275;286 mbind = 274,
287pub const SYS_set_mempolicy = 276;287 get_mempolicy = 275,
288pub const SYS_mq_open = 277;288 set_mempolicy = 276,
289pub const SYS_mq_unlink = SYS_mq_open + 1;289 mq_open = 277,
290pub const SYS_mq_timedsend = SYS_mq_open + 2;290 mq_unlink, // SYS_mq_open + 1
291pub const SYS_mq_timedreceive = SYS_mq_open + 3;291 mq_timedsend, // SYS_mq_open + 2
292pub const SYS_mq_notify = SYS_mq_open + 4;292 mq_timedreceive, // SYS_mq_open + 3
293pub const SYS_mq_getsetattr = SYS_mq_open + 5;293 mq_notify, // SYS_mq_open + 4
294pub const SYS_kexec_load = 283;294 mq_getsetattr, // SYS_mq_open + 5
295pub const SYS_waitid = 284;295 kexec_load = 283,
296pub const SYS_add_key = 286;296 waitid = 284,
297pub const SYS_request_key = 287;297 add_key = 286,
298pub const SYS_keyctl = 288;298 request_key = 287,
299pub const SYS_ioprio_set = 289;299 keyctl = 288,
300pub const SYS_ioprio_get = 290;300 ioprio_set = 289,
301pub const SYS_inotify_init = 291;301 ioprio_get = 290,
302pub const SYS_inotify_add_watch = 292;302 inotify_init = 291,
303pub const SYS_inotify_rm_watch = 293;303 inotify_add_watch = 292,
304pub const SYS_migrate_pages = 294;304 inotify_rm_watch = 293,
305pub const SYS_openat = 295;305 migrate_pages = 294,
306pub const SYS_mkdirat = 296;306 openat = 295,
307pub const SYS_mknodat = 297;307 mkdirat = 296,
308pub const SYS_fchownat = 298;308 mknodat = 297,
309pub const SYS_futimesat = 299;309 fchownat = 298,
310pub const SYS_fstatat64 = 300;310 futimesat = 299,
311pub const SYS_unlinkat = 301;311 fstatat64 = 300,
312pub const SYS_renameat = 302;312 unlinkat = 301,
313pub const SYS_linkat = 303;313 renameat = 302,
314pub const SYS_symlinkat = 304;314 linkat = 303,
315pub const SYS_readlinkat = 305;315 symlinkat = 304,
316pub const SYS_fchmodat = 306;316 readlinkat = 305,
317pub const SYS_faccessat = 307;317 fchmodat = 306,
318pub const SYS_pselect6 = 308;318 faccessat = 307,
319pub const SYS_ppoll = 309;319 pselect6 = 308,
320pub const SYS_unshare = 310;320 ppoll = 309,
321pub const SYS_set_robust_list = 311;321 unshare = 310,
322pub const SYS_get_robust_list = 312;322 set_robust_list = 311,
323pub const SYS_splice = 313;323 get_robust_list = 312,
324pub const SYS_sync_file_range = 314;324 splice = 313,
325pub const SYS_tee = 315;325 sync_file_range = 314,
326pub const SYS_vmsplice = 316;326 tee = 315,
327pub const SYS_move_pages = 317;327 vmsplice = 316,
328pub const SYS_getcpu = 318;328 move_pages = 317,
329pub const SYS_epoll_pwait = 319;329 getcpu = 318,
330pub const SYS_utimensat = 320;330 epoll_pwait = 319,
331pub const SYS_signalfd = 321;331 utimensat = 320,
332pub const SYS_timerfd_create = 322;332 signalfd = 321,
333pub const SYS_eventfd = 323;333 timerfd_create = 322,
334pub const SYS_fallocate = 324;334 eventfd = 323,
335pub const SYS_timerfd_settime = 325;335 fallocate = 324,
336pub const SYS_timerfd_gettime = 326;336 timerfd_settime = 325,
337pub const SYS_signalfd4 = 327;337 timerfd_gettime = 326,
338pub const SYS_eventfd2 = 328;338 signalfd4 = 327,
339pub const SYS_epoll_create1 = 329;339 eventfd2 = 328,
340pub const SYS_dup3 = 330;340 epoll_create1 = 329,
341pub const SYS_pipe2 = 331;341 dup3 = 330,
342pub const SYS_inotify_init1 = 332;342 pipe2 = 331,
343pub const SYS_preadv = 333;343 inotify_init1 = 332,
344pub const SYS_pwritev = 334;344 preadv = 333,
345pub const SYS_rt_tgsigqueueinfo = 335;345 pwritev = 334,
346pub const SYS_perf_event_open = 336;346 rt_tgsigqueueinfo = 335,
347pub const SYS_recvmmsg = 337;347 perf_event_open = 336,
348pub const SYS_fanotify_init = 338;348 recvmmsg = 337,
349pub const SYS_fanotify_mark = 339;349 fanotify_init = 338,
350pub const SYS_prlimit64 = 340;350 fanotify_mark = 339,
351pub const SYS_name_to_handle_at = 341;351 prlimit64 = 340,
352pub const SYS_open_by_handle_at = 342;352 name_to_handle_at = 341,
353pub const SYS_clock_adjtime = 343;353 open_by_handle_at = 342,
354pub const SYS_syncfs = 344;354 clock_adjtime = 343,
355pub const SYS_sendmmsg = 345;355 syncfs = 344,
356pub const SYS_setns = 346;356 sendmmsg = 345,
357pub const SYS_process_vm_readv = 347;357 setns = 346,
358pub const SYS_process_vm_writev = 348;358 process_vm_readv = 347,
359pub const SYS_kcmp = 349;359 process_vm_writev = 348,
360pub const SYS_finit_module = 350;360 kcmp = 349,
361pub const SYS_sched_setattr = 351;361 finit_module = 350,
362pub const SYS_sched_getattr = 352;362 sched_setattr = 351,
363pub const SYS_renameat2 = 353;363 sched_getattr = 352,
364pub const SYS_seccomp = 354;364 renameat2 = 353,
365pub const SYS_getrandom = 355;365 seccomp = 354,
366pub const SYS_memfd_create = 356;366 getrandom = 355,
367pub const SYS_bpf = 357;367 memfd_create = 356,
368pub const SYS_execveat = 358;368 bpf = 357,
369pub const SYS_socket = 359;369 execveat = 358,
370pub const SYS_socketpair = 360;370 socket = 359,
371pub const SYS_bind = 361;371 socketpair = 360,
372pub const SYS_connect = 362;372 bind = 361,
373pub const SYS_listen = 363;373 connect = 362,
374pub const SYS_accept4 = 364;374 listen = 363,
375pub const SYS_getsockopt = 365;375 accept4 = 364,
376pub const SYS_setsockopt = 366;376 getsockopt = 365,
377pub const SYS_getsockname = 367;377 setsockopt = 366,
378pub const SYS_getpeername = 368;378 getsockname = 367,
379pub const SYS_sendto = 369;379 getpeername = 368,
380pub const SYS_sendmsg = 370;380 sendto = 369,
381pub const SYS_recvfrom = 371;381 sendmsg = 370,
382pub const SYS_recvmsg = 372;382 recvfrom = 371,
383pub const SYS_shutdown = 373;383 recvmsg = 372,
384pub const SYS_userfaultfd = 374;384 shutdown = 373,
385pub const SYS_membarrier = 375;385 userfaultfd = 374,
386pub const SYS_mlock2 = 376;386 membarrier = 375,
387pub const SYS_copy_file_range = 377;387 mlock2 = 376,
388pub const SYS_preadv2 = 378;388 copy_file_range = 377,
389pub const SYS_pwritev2 = 379;389 preadv2 = 378,
390pub const SYS_pkey_mprotect = 380;390 pwritev2 = 379,
391pub const SYS_pkey_alloc = 381;391 pkey_mprotect = 380,
392pub const SYS_pkey_free = 382;392 pkey_alloc = 381,
393pub const SYS_statx = 383;393 pkey_free = 382,
394pub const SYS_arch_prctl = 384;394 statx = 383,
395pub const SYS_io_pgetevents = 385;395 arch_prctl = 384,
396pub const SYS_rseq = 386;396 io_pgetevents = 385,
397pub const SYS_semget = 393;397 rseq = 386,
398pub const SYS_semctl = 394;398 semget = 393,
399pub const SYS_shmget = 395;399 semctl = 394,
400pub const SYS_shmctl = 396;400 shmget = 395,
401pub const SYS_shmat = 397;401 shmctl = 396,
402pub const SYS_shmdt = 398;402 shmat = 397,
403pub const SYS_msgget = 399;403 shmdt = 398,
404pub const SYS_msgsnd = 400;404 msgget = 399,
405pub const SYS_msgrcv = 401;405 msgsnd = 400,
406pub const SYS_msgctl = 402;406 msgrcv = 401,
407pub const SYS_clock_gettime64 = 403;407 msgctl = 402,
408pub const SYS_clock_settime64 = 404;408 clock_gettime64 = 403,
409pub const SYS_clock_adjtime64 = 405;409 clock_settime64 = 404,
410pub const SYS_clock_getres_time64 = 406;410 clock_adjtime64 = 405,
411pub const SYS_clock_nanosleep_time64 = 407;411 clock_getres_time64 = 406,
412pub const SYS_timer_gettime64 = 408;412 clock_nanosleep_time64 = 407,
413pub const SYS_timer_settime64 = 409;413 timer_gettime64 = 408,
414pub const SYS_timerfd_gettime64 = 410;414 timer_settime64 = 409,
415pub const SYS_timerfd_settime64 = 411;415 timerfd_gettime64 = 410,
416pub const SYS_utimensat_time64 = 412;416 timerfd_settime64 = 411,
417pub const SYS_pselect6_time64 = 413;417 utimensat_time64 = 412,
418pub const SYS_ppoll_time64 = 414;418 pselect6_time64 = 413,
419pub const SYS_io_pgetevents_time64 = 416;419 ppoll_time64 = 414,
420pub const SYS_recvmmsg_time64 = 417;420 io_pgetevents_time64 = 416,
421pub const SYS_mq_timedsend_time64 = 418;421 recvmmsg_time64 = 417,
422pub const SYS_mq_timedreceive_time64 = 419;422 mq_timedsend_time64 = 418,
423pub const SYS_semtimedop_time64 = 420;423 mq_timedreceive_time64 = 419,
424pub const SYS_rt_sigtimedwait_time64 = 421;424 semtimedop_time64 = 420,
425pub const SYS_futex_time64 = 422;425 rt_sigtimedwait_time64 = 421,
426pub const SYS_sched_rr_get_interval_time64 = 423;426 futex_time64 = 422,
427pub const SYS_pidfd_send_signal = 424;427 sched_rr_get_interval_time64 = 423,
428pub const SYS_io_uring_setup = 425;428 pidfd_send_signal = 424,
429pub const SYS_io_uring_enter = 426;429 io_uring_setup = 425,
430pub const SYS_io_uring_register = 427;430 io_uring_enter = 426,
431pub const SYS_open_tree = 428;431 io_uring_register = 427,
432pub const SYS_move_mount = 429;432 open_tree = 428,
433pub const SYS_fsopen = 430;433 move_mount = 429,
434pub const SYS_fsconfig = 431;434 fsopen = 430,
435pub const SYS_fsmount = 432;435 fsconfig = 431,
436pub const SYS_fspick = 433;436 fsmount = 432,
437pub const SYS_openat2 = 437;437 fspick = 433,
438pub const SYS_pidfd_getfd = 438;438 openat2 = 437,
439 pidfd_getfd = 438,
440
441 _,
442};
439443
440pub const O_CREAT = 0o100;444pub const O_CREAT = 0o100;
441pub const O_EXCL = 0o200;445pub const O_EXCL = 0o200;
lib/std/os/bits/linux/mipsel.zig+376-371
...@@ -6,377 +6,382 @@ const iovec_const = linux.iovec_const;...@@ -6,377 +6,382 @@ const iovec_const = linux.iovec_const;
6const uid_t = linux.uid_t;6const uid_t = linux.uid_t;
7const gid_t = linux.gid_t;7const gid_t = linux.gid_t;
88
9pub const SYS_Linux = 4000;9pub const SYS = extern enum(usize) {
10pub const SYS_syscall = (SYS_Linux + 0);10 pub const Linux = 4000;
11pub const SYS_exit = (SYS_Linux + 1);11
12pub const SYS_fork = (SYS_Linux + 2);12 syscall = Linux + 0,
13pub const SYS_read = (SYS_Linux + 3);13 exit = Linux + 1,
14pub const SYS_write = (SYS_Linux + 4);14 fork = Linux + 2,
15pub const SYS_open = (SYS_Linux + 5);15 read = Linux + 3,
16pub const SYS_close = (SYS_Linux + 6);16 write = Linux + 4,
17pub const SYS_waitpid = (SYS_Linux + 7);17 open = Linux + 5,
18pub const SYS_creat = (SYS_Linux + 8);18 close = Linux + 6,
19pub const SYS_link = (SYS_Linux + 9);19 waitpid = Linux + 7,
20pub const SYS_unlink = (SYS_Linux + 10);20 creat = Linux + 8,
21pub const SYS_execve = (SYS_Linux + 11);21 link = Linux + 9,
22pub const SYS_chdir = (SYS_Linux + 12);22 unlink = Linux + 10,
23pub const SYS_time = (SYS_Linux + 13);23 execve = Linux + 11,
24pub const SYS_mknod = (SYS_Linux + 14);24 chdir = Linux + 12,
25pub const SYS_chmod = (SYS_Linux + 15);25 time = Linux + 13,
26pub const SYS_lchown = (SYS_Linux + 16);26 mknod = Linux + 14,
27pub const SYS_break = (SYS_Linux + 17);27 chmod = Linux + 15,
28pub const SYS_unused18 = (SYS_Linux + 18);28 lchown = Linux + 16,
29pub const SYS_lseek = (SYS_Linux + 19);29 @"break" = Linux + 17,
30pub const SYS_getpid = (SYS_Linux + 20);30 unused18 = Linux + 18,
31pub const SYS_mount = (SYS_Linux + 21);31 lseek = Linux + 19,
32pub const SYS_umount = (SYS_Linux + 22);32 getpid = Linux + 20,
33pub const SYS_setuid = (SYS_Linux + 23);33 mount = Linux + 21,
34pub const SYS_getuid = (SYS_Linux + 24);34 umount = Linux + 22,
35pub const SYS_stime = (SYS_Linux + 25);35 setuid = Linux + 23,
36pub const SYS_ptrace = (SYS_Linux + 26);36 getuid = Linux + 24,
37pub const SYS_alarm = (SYS_Linux + 27);37 stime = Linux + 25,
38pub const SYS_unused28 = (SYS_Linux + 28);38 ptrace = Linux + 26,
39pub const SYS_pause = (SYS_Linux + 29);39 alarm = Linux + 27,
40pub const SYS_utime = (SYS_Linux + 30);40 unused28 = Linux + 28,
41pub const SYS_stty = (SYS_Linux + 31);41 pause = Linux + 29,
42pub const SYS_gtty = (SYS_Linux + 32);42 utime = Linux + 30,
43pub const SYS_access = (SYS_Linux + 33);43 stty = Linux + 31,
44pub const SYS_nice = (SYS_Linux + 34);44 gtty = Linux + 32,
45pub const SYS_ftime = (SYS_Linux + 35);45 access = Linux + 33,
46pub const SYS_sync = (SYS_Linux + 36);46 nice = Linux + 34,
47pub const SYS_kill = (SYS_Linux + 37);47 ftime = Linux + 35,
48pub const SYS_rename = (SYS_Linux + 38);48 sync = Linux + 36,
49pub const SYS_mkdir = (SYS_Linux + 39);49 kill = Linux + 37,
50pub const SYS_rmdir = (SYS_Linux + 40);50 rename = Linux + 38,
51pub const SYS_dup = (SYS_Linux + 41);51 mkdir = Linux + 39,
52pub const SYS_pipe = (SYS_Linux + 42);52 rmdir = Linux + 40,
53pub const SYS_times = (SYS_Linux + 43);53 dup = Linux + 41,
54pub const SYS_prof = (SYS_Linux + 44);54 pipe = Linux + 42,
55pub const SYS_brk = (SYS_Linux + 45);55 times = Linux + 43,
56pub const SYS_setgid = (SYS_Linux + 46);56 prof = Linux + 44,
57pub const SYS_getgid = (SYS_Linux + 47);57 brk = Linux + 45,
58pub const SYS_signal = (SYS_Linux + 48);58 setgid = Linux + 46,
59pub const SYS_geteuid = (SYS_Linux + 49);59 getgid = Linux + 47,
60pub const SYS_getegid = (SYS_Linux + 50);60 signal = Linux + 48,
61pub const SYS_acct = (SYS_Linux + 51);61 geteuid = Linux + 49,
62pub const SYS_umount2 = (SYS_Linux + 52);62 getegid = Linux + 50,
63pub const SYS_lock = (SYS_Linux + 53);63 acct = Linux + 51,
64pub const SYS_ioctl = (SYS_Linux + 54);64 umount2 = Linux + 52,
65pub const SYS_fcntl = (SYS_Linux + 55);65 lock = Linux + 53,
66pub const SYS_mpx = (SYS_Linux + 56);66 ioctl = Linux + 54,
67pub const SYS_setpgid = (SYS_Linux + 57);67 fcntl = Linux + 55,
68pub const SYS_ulimit = (SYS_Linux + 58);68 mpx = Linux + 56,
69pub const SYS_unused59 = (SYS_Linux + 59);69 setpgid = Linux + 57,
70pub const SYS_umask = (SYS_Linux + 60);70 ulimit = Linux + 58,
71pub const SYS_chroot = (SYS_Linux + 61);71 unused59 = Linux + 59,
72pub const SYS_ustat = (SYS_Linux + 62);72 umask = Linux + 60,
73pub const SYS_dup2 = (SYS_Linux + 63);73 chroot = Linux + 61,
74pub const SYS_getppid = (SYS_Linux + 64);74 ustat = Linux + 62,
75pub const SYS_getpgrp = (SYS_Linux + 65);75 dup2 = Linux + 63,
76pub const SYS_setsid = (SYS_Linux + 66);76 getppid = Linux + 64,
77pub const SYS_sigaction = (SYS_Linux + 67);77 getpgrp = Linux + 65,
78pub const SYS_sgetmask = (SYS_Linux + 68);78 setsid = Linux + 66,
79pub const SYS_ssetmask = (SYS_Linux + 69);79 sigaction = Linux + 67,
80pub const SYS_setreuid = (SYS_Linux + 70);80 sgetmask = Linux + 68,
81pub const SYS_setregid = (SYS_Linux + 71);81 ssetmask = Linux + 69,
82pub const SYS_sigsuspend = (SYS_Linux + 72);82 setreuid = Linux + 70,
83pub const SYS_sigpending = (SYS_Linux + 73);83 setregid = Linux + 71,
84pub const SYS_sethostname = (SYS_Linux + 74);84 sigsuspend = Linux + 72,
85pub const SYS_setrlimit = (SYS_Linux + 75);85 sigpending = Linux + 73,
86pub const SYS_getrlimit = (SYS_Linux + 76);86 sethostname = Linux + 74,
87pub const SYS_getrusage = (SYS_Linux + 77);87 setrlimit = Linux + 75,
88pub const SYS_gettimeofday = (SYS_Linux + 78);88 getrlimit = Linux + 76,
89pub const SYS_settimeofday = (SYS_Linux + 79);89 getrusage = Linux + 77,
90pub const SYS_getgroups = (SYS_Linux + 80);90 gettimeofday = Linux + 78,
91pub const SYS_setgroups = (SYS_Linux + 81);91 settimeofday = Linux + 79,
92pub const SYS_reserved82 = (SYS_Linux + 82);92 getgroups = Linux + 80,
93pub const SYS_symlink = (SYS_Linux + 83);93 setgroups = Linux + 81,
94pub const SYS_unused84 = (SYS_Linux + 84);94 reserved82 = Linux + 82,
95pub const SYS_readlink = (SYS_Linux + 85);95 symlink = Linux + 83,
96pub const SYS_uselib = (SYS_Linux + 86);96 unused84 = Linux + 84,
97pub const SYS_swapon = (SYS_Linux + 87);97 readlink = Linux + 85,
98pub const SYS_reboot = (SYS_Linux + 88);98 uselib = Linux + 86,
99pub const SYS_readdir = (SYS_Linux + 89);99 swapon = Linux + 87,
100pub const SYS_mmap = (SYS_Linux + 90);100 reboot = Linux + 88,
101pub const SYS_munmap = (SYS_Linux + 91);101 readdir = Linux + 89,
102pub const SYS_truncate = (SYS_Linux + 92);102 mmap = Linux + 90,
103pub const SYS_ftruncate = (SYS_Linux + 93);103 munmap = Linux + 91,
104pub const SYS_fchmod = (SYS_Linux + 94);104 truncate = Linux + 92,
105pub const SYS_fchown = (SYS_Linux + 95);105 ftruncate = Linux + 93,
106pub const SYS_getpriority = (SYS_Linux + 96);106 fchmod = Linux + 94,
107pub const SYS_setpriority = (SYS_Linux + 97);107 fchown = Linux + 95,
108pub const SYS_profil = (SYS_Linux + 98);108 getpriority = Linux + 96,
109pub const SYS_statfs = (SYS_Linux + 99);109 setpriority = Linux + 97,
110pub const SYS_fstatfs = (SYS_Linux + 100);110 profil = Linux + 98,
111pub const SYS_ioperm = (SYS_Linux + 101);111 statfs = Linux + 99,
112pub const SYS_socketcall = (SYS_Linux + 102);112 fstatfs = Linux + 100,
113pub const SYS_syslog = (SYS_Linux + 103);113 ioperm = Linux + 101,
114pub const SYS_setitimer = (SYS_Linux + 104);114 socketcall = Linux + 102,
115pub const SYS_getitimer = (SYS_Linux + 105);115 syslog = Linux + 103,
116pub const SYS_stat = (SYS_Linux + 106);116 setitimer = Linux + 104,
117pub const SYS_lstat = (SYS_Linux + 107);117 getitimer = Linux + 105,
118pub const SYS_fstat = (SYS_Linux + 108);118 stat = Linux + 106,
119pub const SYS_unused109 = (SYS_Linux + 109);119 lstat = Linux + 107,
120pub const SYS_iopl = (SYS_Linux + 110);120 fstat = Linux + 108,
121pub const SYS_vhangup = (SYS_Linux + 111);121 unused109 = Linux + 109,
122pub const SYS_idle = (SYS_Linux + 112);122 iopl = Linux + 110,
123pub const SYS_vm86 = (SYS_Linux + 113);123 vhangup = Linux + 111,
124pub const SYS_wait4 = (SYS_Linux + 114);124 idle = Linux + 112,
125pub const SYS_swapoff = (SYS_Linux + 115);125 vm86 = Linux + 113,
126pub const SYS_sysinfo = (SYS_Linux + 116);126 wait4 = Linux + 114,
127pub const SYS_ipc = (SYS_Linux + 117);127 swapoff = Linux + 115,
128pub const SYS_fsync = (SYS_Linux + 118);128 sysinfo = Linux + 116,
129pub const SYS_sigreturn = (SYS_Linux + 119);129 ipc = Linux + 117,
130pub const SYS_clone = (SYS_Linux + 120);130 fsync = Linux + 118,
131pub const SYS_setdomainname = (SYS_Linux + 121);131 sigreturn = Linux + 119,
132pub const SYS_uname = (SYS_Linux + 122);132 clone = Linux + 120,
133pub const SYS_modify_ldt = (SYS_Linux + 123);133 setdomainname = Linux + 121,
134pub const SYS_adjtimex = (SYS_Linux + 124);134 uname = Linux + 122,
135pub const SYS_mprotect = (SYS_Linux + 125);135 modify_ldt = Linux + 123,
136pub const SYS_sigprocmask = (SYS_Linux + 126);136 adjtimex = Linux + 124,
137pub const SYS_create_module = (SYS_Linux + 127);137 mprotect = Linux + 125,
138pub const SYS_init_module = (SYS_Linux + 128);138 sigprocmask = Linux + 126,
139pub const SYS_delete_module = (SYS_Linux + 129);139 create_module = Linux + 127,
140pub const SYS_get_kernel_syms = (SYS_Linux + 130);140 init_module = Linux + 128,
141pub const SYS_quotactl = (SYS_Linux + 131);141 delete_module = Linux + 129,
142pub const SYS_getpgid = (SYS_Linux + 132);142 get_kernel_syms = Linux + 130,
143pub const SYS_fchdir = (SYS_Linux + 133);143 quotactl = Linux + 131,
144pub const SYS_bdflush = (SYS_Linux + 134);144 getpgid = Linux + 132,
145pub const SYS_sysfs = (SYS_Linux + 135);145 fchdir = Linux + 133,
146pub const SYS_personality = (SYS_Linux + 136);146 bdflush = Linux + 134,
147pub const SYS_afs_syscall = (SYS_Linux + 137);147 sysfs = Linux + 135,
148pub const SYS_setfsuid = (SYS_Linux + 138);148 personality = Linux + 136,
149pub const SYS_setfsgid = (SYS_Linux + 139);149 afs_syscall = Linux + 137,
150pub const SYS__llseek = (SYS_Linux + 140);150 setfsuid = Linux + 138,
151pub const SYS_getdents = (SYS_Linux + 141);151 setfsgid = Linux + 139,
152pub const SYS__newselect = (SYS_Linux + 142);152 _llseek = Linux + 140,
153pub const SYS_flock = (SYS_Linux + 143);153 getdents = Linux + 141,
154pub const SYS_msync = (SYS_Linux + 144);154 _newselect = Linux + 142,
155pub const SYS_readv = (SYS_Linux + 145);155 flock = Linux + 143,
156pub const SYS_writev = (SYS_Linux + 146);156 msync = Linux + 144,
157pub const SYS_cacheflush = (SYS_Linux + 147);157 readv = Linux + 145,
158pub const SYS_cachectl = (SYS_Linux + 148);158 writev = Linux + 146,
159pub const SYS_sysmips = (SYS_Linux + 149);159 cacheflush = Linux + 147,
160pub const SYS_unused150 = (SYS_Linux + 150);160 cachectl = Linux + 148,
161pub const SYS_getsid = (SYS_Linux + 151);161 sysmips = Linux + 149,
162pub const SYS_fdatasync = (SYS_Linux + 152);162 unused150 = Linux + 150,
163pub const SYS__sysctl = (SYS_Linux + 153);163 getsid = Linux + 151,
164pub const SYS_mlock = (SYS_Linux + 154);164 fdatasync = Linux + 152,
165pub const SYS_munlock = (SYS_Linux + 155);165 _sysctl = Linux + 153,
166pub const SYS_mlockall = (SYS_Linux + 156);166 mlock = Linux + 154,
167pub const SYS_munlockall = (SYS_Linux + 157);167 munlock = Linux + 155,
168pub const SYS_sched_setparam = (SYS_Linux + 158);168 mlockall = Linux + 156,
169pub const SYS_sched_getparam = (SYS_Linux + 159);169 munlockall = Linux + 157,
170pub const SYS_sched_setscheduler = (SYS_Linux + 160);170 sched_setparam = Linux + 158,
171pub const SYS_sched_getscheduler = (SYS_Linux + 161);171 sched_getparam = Linux + 159,
172pub const SYS_sched_yield = (SYS_Linux + 162);172 sched_setscheduler = Linux + 160,
173pub const SYS_sched_get_priority_max = (SYS_Linux + 163);173 sched_getscheduler = Linux + 161,
174pub const SYS_sched_get_priority_min = (SYS_Linux + 164);174 sched_yield = Linux + 162,
175pub const SYS_sched_rr_get_interval = (SYS_Linux + 165);175 sched_get_priority_max = Linux + 163,
176pub const SYS_nanosleep = (SYS_Linux + 166);176 sched_get_priority_min = Linux + 164,
177pub const SYS_mremap = (SYS_Linux + 167);177 sched_rr_get_interval = Linux + 165,
178pub const SYS_accept = (SYS_Linux + 168);178 nanosleep = Linux + 166,
179pub const SYS_bind = (SYS_Linux + 169);179 mremap = Linux + 167,
180pub const SYS_connect = (SYS_Linux + 170);180 accept = Linux + 168,
181pub const SYS_getpeername = (SYS_Linux + 171);181 bind = Linux + 169,
182pub const SYS_getsockname = (SYS_Linux + 172);182 connect = Linux + 170,
183pub const SYS_getsockopt = (SYS_Linux + 173);183 getpeername = Linux + 171,
184pub const SYS_listen = (SYS_Linux + 174);184 getsockname = Linux + 172,
185pub const SYS_recv = (SYS_Linux + 175);185 getsockopt = Linux + 173,
186pub const SYS_recvfrom = (SYS_Linux + 176);186 listen = Linux + 174,
187pub const SYS_recvmsg = (SYS_Linux + 177);187 recv = Linux + 175,
188pub const SYS_send = (SYS_Linux + 178);188 recvfrom = Linux + 176,
189pub const SYS_sendmsg = (SYS_Linux + 179);189 recvmsg = Linux + 177,
190pub const SYS_sendto = (SYS_Linux + 180);190 send = Linux + 178,
191pub const SYS_setsockopt = (SYS_Linux + 181);191 sendmsg = Linux + 179,
192pub const SYS_shutdown = (SYS_Linux + 182);192 sendto = Linux + 180,
193pub const SYS_socket = (SYS_Linux + 183);193 setsockopt = Linux + 181,
194pub const SYS_socketpair = (SYS_Linux + 184);194 shutdown = Linux + 182,
195pub const SYS_setresuid = (SYS_Linux + 185);195 socket = Linux + 183,
196pub const SYS_getresuid = (SYS_Linux + 186);196 socketpair = Linux + 184,
197pub const SYS_query_module = (SYS_Linux + 187);197 setresuid = Linux + 185,
198pub const SYS_poll = (SYS_Linux + 188);198 getresuid = Linux + 186,
199pub const SYS_nfsservctl = (SYS_Linux + 189);199 query_module = Linux + 187,
200pub const SYS_setresgid = (SYS_Linux + 190);200 poll = Linux + 188,
201pub const SYS_getresgid = (SYS_Linux + 191);201 nfsservctl = Linux + 189,
202pub const SYS_prctl = (SYS_Linux + 192);202 setresgid = Linux + 190,
203pub const SYS_rt_sigreturn = (SYS_Linux + 193);203 getresgid = Linux + 191,
204pub const SYS_rt_sigaction = (SYS_Linux + 194);204 prctl = Linux + 192,
205pub const SYS_rt_sigprocmask = (SYS_Linux + 195);205 rt_sigreturn = Linux + 193,
206pub const SYS_rt_sigpending = (SYS_Linux + 196);206 rt_sigaction = Linux + 194,
207pub const SYS_rt_sigtimedwait = (SYS_Linux + 197);207 rt_sigprocmask = Linux + 195,
208pub const SYS_rt_sigqueueinfo = (SYS_Linux + 198);208 rt_sigpending = Linux + 196,
209pub const SYS_rt_sigsuspend = (SYS_Linux + 199);209 rt_sigtimedwait = Linux + 197,
210pub const SYS_pread64 = (SYS_Linux + 200);210 rt_sigqueueinfo = Linux + 198,
211pub const SYS_pwrite64 = (SYS_Linux + 201);211 rt_sigsuspend = Linux + 199,
212pub const SYS_chown = (SYS_Linux + 202);212 pread64 = Linux + 200,
213pub const SYS_getcwd = (SYS_Linux + 203);213 pwrite64 = Linux + 201,
214pub const SYS_capget = (SYS_Linux + 204);214 chown = Linux + 202,
215pub const SYS_capset = (SYS_Linux + 205);215 getcwd = Linux + 203,
216pub const SYS_sigaltstack = (SYS_Linux + 206);216 capget = Linux + 204,
217pub const SYS_sendfile = (SYS_Linux + 207);217 capset = Linux + 205,
218pub const SYS_getpmsg = (SYS_Linux + 208);218 sigaltstack = Linux + 206,
219pub const SYS_putpmsg = (SYS_Linux + 209);219 sendfile = Linux + 207,
220pub const SYS_mmap2 = (SYS_Linux + 210);220 getpmsg = Linux + 208,
221pub const SYS_truncate64 = (SYS_Linux + 211);221 putpmsg = Linux + 209,
222pub const SYS_ftruncate64 = (SYS_Linux + 212);222 mmap2 = Linux + 210,
223pub const SYS_stat64 = (SYS_Linux + 213);223 truncate64 = Linux + 211,
224pub const SYS_lstat64 = (SYS_Linux + 214);224 ftruncate64 = Linux + 212,
225pub const SYS_fstat64 = (SYS_Linux + 215);225 stat64 = Linux + 213,
226pub const SYS_pivot_root = (SYS_Linux + 216);226 lstat64 = Linux + 214,
227pub const SYS_mincore = (SYS_Linux + 217);227 fstat64 = Linux + 215,
228pub const SYS_madvise = (SYS_Linux + 218);228 pivot_root = Linux + 216,
229pub const SYS_getdents64 = (SYS_Linux + 219);229 mincore = Linux + 217,
230pub const SYS_fcntl64 = (SYS_Linux + 220);230 madvise = Linux + 218,
231pub const SYS_reserved221 = (SYS_Linux + 221);231 getdents64 = Linux + 219,
232pub const SYS_gettid = (SYS_Linux + 222);232 fcntl64 = Linux + 220,
233pub const SYS_readahead = (SYS_Linux + 223);233 reserved221 = Linux + 221,
234pub const SYS_setxattr = (SYS_Linux + 224);234 gettid = Linux + 222,
235pub const SYS_lsetxattr = (SYS_Linux + 225);235 readahead = Linux + 223,
236pub const SYS_fsetxattr = (SYS_Linux + 226);236 setxattr = Linux + 224,
237pub const SYS_getxattr = (SYS_Linux + 227);237 lsetxattr = Linux + 225,
238pub const SYS_lgetxattr = (SYS_Linux + 228);238 fsetxattr = Linux + 226,
239pub const SYS_fgetxattr = (SYS_Linux + 229);239 getxattr = Linux + 227,
240pub const SYS_listxattr = (SYS_Linux + 230);240 lgetxattr = Linux + 228,
241pub const SYS_llistxattr = (SYS_Linux + 231);241 fgetxattr = Linux + 229,
242pub const SYS_flistxattr = (SYS_Linux + 232);242 listxattr = Linux + 230,
243pub const SYS_removexattr = (SYS_Linux + 233);243 llistxattr = Linux + 231,
244pub const SYS_lremovexattr = (SYS_Linux + 234);244 flistxattr = Linux + 232,
245pub const SYS_fremovexattr = (SYS_Linux + 235);245 removexattr = Linux + 233,
246pub const SYS_tkill = (SYS_Linux + 236);246 lremovexattr = Linux + 234,
247pub const SYS_sendfile64 = (SYS_Linux + 237);247 fremovexattr = Linux + 235,
248pub const SYS_futex = (SYS_Linux + 238);248 tkill = Linux + 236,
249pub const SYS_sched_setaffinity = (SYS_Linux + 239);249 sendfile64 = Linux + 237,
250pub const SYS_sched_getaffinity = (SYS_Linux + 240);250 futex = Linux + 238,
251pub const SYS_io_setup = (SYS_Linux + 241);251 sched_setaffinity = Linux + 239,
252pub const SYS_io_destroy = (SYS_Linux + 242);252 sched_getaffinity = Linux + 240,
253pub const SYS_io_getevents = (SYS_Linux + 243);253 io_setup = Linux + 241,
254pub const SYS_io_submit = (SYS_Linux + 244);254 io_destroy = Linux + 242,
255pub const SYS_io_cancel = (SYS_Linux + 245);255 io_getevents = Linux + 243,
256pub const SYS_exit_group = (SYS_Linux + 246);256 io_submit = Linux + 244,
257pub const SYS_lookup_dcookie = (SYS_Linux + 247);257 io_cancel = Linux + 245,
258pub const SYS_epoll_create = (SYS_Linux + 248);258 exit_group = Linux + 246,
259pub const SYS_epoll_ctl = (SYS_Linux + 249);259 lookup_dcookie = Linux + 247,
260pub const SYS_epoll_wait = (SYS_Linux + 250);260 epoll_create = Linux + 248,
261pub const SYS_remap_file_pages = (SYS_Linux + 251);261 epoll_ctl = Linux + 249,
262pub const SYS_set_tid_address = (SYS_Linux + 252);262 epoll_wait = Linux + 250,
263pub const SYS_restart_syscall = (SYS_Linux + 253);263 remap_file_pages = Linux + 251,
264pub const SYS_fadvise64 = (SYS_Linux + 254);264 set_tid_address = Linux + 252,
265pub const SYS_statfs64 = (SYS_Linux + 255);265 restart_syscall = Linux + 253,
266pub const SYS_fstatfs64 = (SYS_Linux + 256);266 fadvise64 = Linux + 254,
267pub const SYS_timer_create = (SYS_Linux + 257);267 statfs64 = Linux + 255,
268pub const SYS_timer_settime = (SYS_Linux + 258);268 fstatfs64 = Linux + 256,
269pub const SYS_timer_gettime = (SYS_Linux + 259);269 timer_create = Linux + 257,
270pub const SYS_timer_getoverrun = (SYS_Linux + 260);270 timer_settime = Linux + 258,
271pub const SYS_timer_delete = (SYS_Linux + 261);271 timer_gettime = Linux + 259,
272pub const SYS_clock_settime = (SYS_Linux + 262);272 timer_getoverrun = Linux + 260,
273pub const SYS_clock_gettime = (SYS_Linux + 263);273 timer_delete = Linux + 261,
274pub const SYS_clock_getres = (SYS_Linux + 264);274 clock_settime = Linux + 262,
275pub const SYS_clock_nanosleep = (SYS_Linux + 265);275 clock_gettime = Linux + 263,
276pub const SYS_tgkill = (SYS_Linux + 266);276 clock_getres = Linux + 264,
277pub const SYS_utimes = (SYS_Linux + 267);277 clock_nanosleep = Linux + 265,
278pub const SYS_mbind = (SYS_Linux + 268);278 tgkill = Linux + 266,
279pub const SYS_get_mempolicy = (SYS_Linux + 269);279 utimes = Linux + 267,
280pub const SYS_set_mempolicy = (SYS_Linux + 270);280 mbind = Linux + 268,
281pub const SYS_mq_open = (SYS_Linux + 271);281 get_mempolicy = Linux + 269,
282pub const SYS_mq_unlink = (SYS_Linux + 272);282 set_mempolicy = Linux + 270,
283pub const SYS_mq_timedsend = (SYS_Linux + 273);283 mq_open = Linux + 271,
284pub const SYS_mq_timedreceive = (SYS_Linux + 274);284 mq_unlink = Linux + 272,
285pub const SYS_mq_notify = (SYS_Linux + 275);285 mq_timedsend = Linux + 273,
286pub const SYS_mq_getsetattr = (SYS_Linux + 276);286 mq_timedreceive = Linux + 274,
287pub const SYS_vserver = (SYS_Linux + 277);287 mq_notify = Linux + 275,
288pub const SYS_waitid = (SYS_Linux + 278);288 mq_getsetattr = Linux + 276,
289pub const SYS_add_key = (SYS_Linux + 280);289 vserver = Linux + 277,
290pub const SYS_request_key = (SYS_Linux + 281);290 waitid = Linux + 278,
291pub const SYS_keyctl = (SYS_Linux + 282);291 add_key = Linux + 280,
292pub const SYS_set_thread_area = (SYS_Linux + 283);292 request_key = Linux + 281,
293pub const SYS_inotify_init = (SYS_Linux + 284);293 keyctl = Linux + 282,
294pub const SYS_inotify_add_watch = (SYS_Linux + 285);294 set_thread_area = Linux + 283,
295pub const SYS_inotify_rm_watch = (SYS_Linux + 286);295 inotify_init = Linux + 284,
296pub const SYS_migrate_pages = (SYS_Linux + 287);296 inotify_add_watch = Linux + 285,
297pub const SYS_openat = (SYS_Linux + 288);297 inotify_rm_watch = Linux + 286,
298pub const SYS_mkdirat = (SYS_Linux + 289);298 migrate_pages = Linux + 287,
299pub const SYS_mknodat = (SYS_Linux + 290);299 openat = Linux + 288,
300pub const SYS_fchownat = (SYS_Linux + 291);300 mkdirat = Linux + 289,
301pub const SYS_futimesat = (SYS_Linux + 292);301 mknodat = Linux + 290,
302pub const SYS_fstatat64 = (SYS_Linux + 293);302 fchownat = Linux + 291,
303pub const SYS_unlinkat = (SYS_Linux + 294);303 futimesat = Linux + 292,
304pub const SYS_renameat = (SYS_Linux + 295);304 fstatat64 = Linux + 293,
305pub const SYS_linkat = (SYS_Linux + 296);305 unlinkat = Linux + 294,
306pub const SYS_symlinkat = (SYS_Linux + 297);306 renameat = Linux + 295,
307pub const SYS_readlinkat = (SYS_Linux + 298);307 linkat = Linux + 296,
308pub const SYS_fchmodat = (SYS_Linux + 299);308 symlinkat = Linux + 297,
309pub const SYS_faccessat = (SYS_Linux + 300);309 readlinkat = Linux + 298,
310pub const SYS_pselect6 = (SYS_Linux + 301);310 fchmodat = Linux + 299,
311pub const SYS_ppoll = (SYS_Linux + 302);311 faccessat = Linux + 300,
312pub const SYS_unshare = (SYS_Linux + 303);312 pselect6 = Linux + 301,
313pub const SYS_splice = (SYS_Linux + 304);313 ppoll = Linux + 302,
314pub const SYS_sync_file_range = (SYS_Linux + 305);314 unshare = Linux + 303,
315pub const SYS_tee = (SYS_Linux + 306);315 splice = Linux + 304,
316pub const SYS_vmsplice = (SYS_Linux + 307);316 sync_file_range = Linux + 305,
317pub const SYS_move_pages = (SYS_Linux + 308);317 tee = Linux + 306,
318pub const SYS_set_robust_list = (SYS_Linux + 309);318 vmsplice = Linux + 307,
319pub const SYS_get_robust_list = (SYS_Linux + 310);319 move_pages = Linux + 308,
320pub const SYS_kexec_load = (SYS_Linux + 311);320 set_robust_list = Linux + 309,
321pub const SYS_getcpu = (SYS_Linux + 312);321 get_robust_list = Linux + 310,
322pub const SYS_epoll_pwait = (SYS_Linux + 313);322 kexec_load = Linux + 311,
323pub const SYS_ioprio_set = (SYS_Linux + 314);323 getcpu = Linux + 312,
324pub const SYS_ioprio_get = (SYS_Linux + 315);324 epoll_pwait = Linux + 313,
325pub const SYS_utimensat = (SYS_Linux + 316);325 ioprio_set = Linux + 314,
326pub const SYS_signalfd = (SYS_Linux + 317);326 ioprio_get = Linux + 315,
327pub const SYS_timerfd = (SYS_Linux + 318);327 utimensat = Linux + 316,
328pub const SYS_eventfd = (SYS_Linux + 319);328 signalfd = Linux + 317,
329pub const SYS_fallocate = (SYS_Linux + 320);329 timerfd = Linux + 318,
330pub const SYS_timerfd_create = (SYS_Linux + 321);330 eventfd = Linux + 319,
331pub const SYS_timerfd_gettime = (SYS_Linux + 322);331 fallocate = Linux + 320,
332pub const SYS_timerfd_settime = (SYS_Linux + 323);332 timerfd_create = Linux + 321,
333pub const SYS_signalfd4 = (SYS_Linux + 324);333 timerfd_gettime = Linux + 322,
334pub const SYS_eventfd2 = (SYS_Linux + 325);334 timerfd_settime = Linux + 323,
335pub const SYS_epoll_create1 = (SYS_Linux + 326);335 signalfd4 = Linux + 324,
336pub const SYS_dup3 = (SYS_Linux + 327);336 eventfd2 = Linux + 325,
337pub const SYS_pipe2 = (SYS_Linux + 328);337 epoll_create1 = Linux + 326,
338pub const SYS_inotify_init1 = (SYS_Linux + 329);338 dup3 = Linux + 327,
339pub const SYS_preadv = (SYS_Linux + 330);339 pipe2 = Linux + 328,
340pub const SYS_pwritev = (SYS_Linux + 331);340 inotify_init1 = Linux + 329,
341pub const SYS_rt_tgsigqueueinfo = (SYS_Linux + 332);341 preadv = Linux + 330,
342pub const SYS_perf_event_open = (SYS_Linux + 333);342 pwritev = Linux + 331,
343pub const SYS_accept4 = (SYS_Linux + 334);343 rt_tgsigqueueinfo = Linux + 332,
344pub const SYS_recvmmsg = (SYS_Linux + 335);344 perf_event_open = Linux + 333,
345pub const SYS_fanotify_init = (SYS_Linux + 336);345 accept4 = Linux + 334,
346pub const SYS_fanotify_mark = (SYS_Linux + 337);346 recvmmsg = Linux + 335,
347pub const SYS_prlimit64 = (SYS_Linux + 338);347 fanotify_init = Linux + 336,
348pub const SYS_name_to_handle_at = (SYS_Linux + 339);348 fanotify_mark = Linux + 337,
349pub const SYS_open_by_handle_at = (SYS_Linux + 340);349 prlimit64 = Linux + 338,
350pub const SYS_clock_adjtime = (SYS_Linux + 341);350 name_to_handle_at = Linux + 339,
351pub const SYS_syncfs = (SYS_Linux + 342);351 open_by_handle_at = Linux + 340,
352pub const SYS_sendmmsg = (SYS_Linux + 343);352 clock_adjtime = Linux + 341,
353pub const SYS_setns = (SYS_Linux + 344);353 syncfs = Linux + 342,
354pub const SYS_process_vm_readv = (SYS_Linux + 345);354 sendmmsg = Linux + 343,
355pub const SYS_process_vm_writev = (SYS_Linux + 346);355 setns = Linux + 344,
356pub const SYS_kcmp = (SYS_Linux + 347);356 process_vm_readv = Linux + 345,
357pub const SYS_finit_module = (SYS_Linux + 348);357 process_vm_writev = Linux + 346,
358pub const SYS_sched_setattr = (SYS_Linux + 349);358 kcmp = Linux + 347,
359pub const SYS_sched_getattr = (SYS_Linux + 350);359 finit_module = Linux + 348,
360pub const SYS_renameat2 = (SYS_Linux + 351);360 sched_setattr = Linux + 349,
361pub const SYS_seccomp = (SYS_Linux + 352);361 sched_getattr = Linux + 350,
362pub const SYS_getrandom = (SYS_Linux + 353);362 renameat2 = Linux + 351,
363pub const SYS_memfd_create = (SYS_Linux + 354);363 seccomp = Linux + 352,
364pub const SYS_bpf = (SYS_Linux + 355);364 getrandom = Linux + 353,
365pub const SYS_execveat = (SYS_Linux + 356);365 memfd_create = Linux + 354,
366pub const SYS_userfaultfd = (SYS_Linux + 357);366 bpf = Linux + 355,
367pub const SYS_membarrier = (SYS_Linux + 358);367 execveat = Linux + 356,
368pub const SYS_mlock2 = (SYS_Linux + 359);368 userfaultfd = Linux + 357,
369pub const SYS_copy_file_range = (SYS_Linux + 360);369 membarrier = Linux + 358,
370pub const SYS_preadv2 = (SYS_Linux + 361);370 mlock2 = Linux + 359,
371pub const SYS_pwritev2 = (SYS_Linux + 362);371 copy_file_range = Linux + 360,
372pub const SYS_pkey_mprotect = (SYS_Linux + 363);372 preadv2 = Linux + 361,
373pub const SYS_pkey_alloc = (SYS_Linux + 364);373 pwritev2 = Linux + 362,
374pub const SYS_pkey_free = (SYS_Linux + 365);374 pkey_mprotect = Linux + 363,
375pub const SYS_statx = (SYS_Linux + 366);375 pkey_alloc = Linux + 364,
376pub const SYS_rseq = (SYS_Linux + 367);376 pkey_free = Linux + 365,
377pub const SYS_io_pgetevents = (SYS_Linux + 368);377 statx = Linux + 366,
378pub const SYS_openat2 = (SYS_Linux + 437);378 rseq = Linux + 367,
379pub const SYS_pidfd_getfd = (SYS_Linux + 438);379 io_pgetevents = Linux + 368,
380 openat2 = Linux + 437,
381 pidfd_getfd = Linux + 438,
382
383 _,
384};
380385
381pub const O_CREAT = 0o0400;386pub const O_CREAT = 0o0400;
382pub const O_EXCL = 0o02000;387pub const O_EXCL = 0o02000;
lib/std/os/bits/linux/riscv64.zig+298-294
...@@ -3,302 +3,306 @@ const std = @import("../../../std.zig");...@@ -3,302 +3,306 @@ const std = @import("../../../std.zig");
3const uid_t = std.os.linux.uid_t;3const uid_t = std.os.linux.uid_t;
4const gid_t = std.os.linux.gid_t;4const gid_t = std.os.linux.gid_t;
55
6pub const SYS_io_setup = 0;6pub const SYS = extern enum(usize) {
7pub const SYS_io_destroy = 1;7 io_setup = 0,
8pub const SYS_io_submit = 2;8 io_destroy = 1,
9pub const SYS_io_cancel = 3;9 io_submit = 2,
10pub const SYS_io_getevents = 4;10 io_cancel = 3,
11pub const SYS_setxattr = 5;11 io_getevents = 4,
12pub const SYS_lsetxattr = 6;12 setxattr = 5,
13pub const SYS_fsetxattr = 7;13 lsetxattr = 6,
14pub const SYS_getxattr = 8;14 fsetxattr = 7,
15pub const SYS_lgetxattr = 9;15 getxattr = 8,
16pub const SYS_fgetxattr = 10;16 lgetxattr = 9,
17pub const SYS_listxattr = 11;17 fgetxattr = 10,
18pub const SYS_llistxattr = 12;18 listxattr = 11,
19pub const SYS_flistxattr = 13;19 llistxattr = 12,
20pub const SYS_removexattr = 14;20 flistxattr = 13,
21pub const SYS_lremovexattr = 15;21 removexattr = 14,
22pub const SYS_fremovexattr = 16;22 lremovexattr = 15,
23pub const SYS_getcwd = 17;23 fremovexattr = 16,
24pub const SYS_lookup_dcookie = 18;24 getcwd = 17,
25pub const SYS_eventfd2 = 19;25 lookup_dcookie = 18,
26pub const SYS_epoll_create1 = 20;26 eventfd2 = 19,
27pub const SYS_epoll_ctl = 21;27 epoll_create1 = 20,
28pub const SYS_epoll_pwait = 22;28 epoll_ctl = 21,
29pub const SYS_dup = 23;29 epoll_pwait = 22,
30pub const SYS_dup3 = 24;30 dup = 23,
31pub const SYS_fcntl = 25;31 dup3 = 24,
32pub const SYS_inotify_init1 = 26;32 fcntl = 25,
33pub const SYS_inotify_add_watch = 27;33 inotify_init1 = 26,
34pub const SYS_inotify_rm_watch = 28;34 inotify_add_watch = 27,
35pub const SYS_ioctl = 29;35 inotify_rm_watch = 28,
36pub const SYS_ioprio_set = 30;36 ioctl = 29,
37pub const SYS_ioprio_get = 31;37 ioprio_set = 30,
38pub const SYS_flock = 32;38 ioprio_get = 31,
39pub const SYS_mknodat = 33;39 flock = 32,
40pub const SYS_mkdirat = 34;40 mknodat = 33,
41pub const SYS_unlinkat = 35;41 mkdirat = 34,
42pub const SYS_symlinkat = 36;42 unlinkat = 35,
43pub const SYS_linkat = 37;43 symlinkat = 36,
44pub const SYS_umount2 = 39;44 linkat = 37,
45pub const SYS_mount = 40;45 umount2 = 39,
46pub const SYS_pivot_root = 41;46 mount = 40,
47pub const SYS_nfsservctl = 42;47 pivot_root = 41,
48pub const SYS_statfs = 43;48 nfsservctl = 42,
49pub const SYS_fstatfs = 44;49 statfs = 43,
50pub const SYS_truncate = 45;50 fstatfs = 44,
51pub const SYS_ftruncate = 46;51 truncate = 45,
52pub const SYS_fallocate = 47;52 ftruncate = 46,
53pub const SYS_faccessat = 48;53 fallocate = 47,
54pub const SYS_chdir = 49;54 faccessat = 48,
55pub const SYS_fchdir = 50;55 chdir = 49,
56pub const SYS_chroot = 51;56 fchdir = 50,
57pub const SYS_fchmod = 52;57 chroot = 51,
58pub const SYS_fchmodat = 53;58 fchmod = 52,
59pub const SYS_fchownat = 54;59 fchmodat = 53,
60pub const SYS_fchown = 55;60 fchownat = 54,
61pub const SYS_openat = 56;61 fchown = 55,
62pub const SYS_close = 57;62 openat = 56,
63pub const SYS_vhangup = 58;63 close = 57,
64pub const SYS_pipe2 = 59;64 vhangup = 58,
65pub const SYS_quotactl = 60;65 pipe2 = 59,
66pub const SYS_getdents64 = 61;66 quotactl = 60,
67pub const SYS_lseek = 62;67 getdents64 = 61,
68pub const SYS_read = 63;68 lseek = 62,
69pub const SYS_write = 64;69 read = 63,
70pub const SYS_readv = 65;70 write = 64,
71pub const SYS_writev = 66;71 readv = 65,
72pub const SYS_pread64 = 67;72 writev = 66,
73pub const SYS_pwrite64 = 68;73 pread64 = 67,
74pub const SYS_preadv = 69;74 pwrite64 = 68,
75pub const SYS_pwritev = 70;75 preadv = 69,
76pub const SYS_sendfile = 71;76 pwritev = 70,
77pub const SYS_pselect6 = 72;77 sendfile = 71,
78pub const SYS_ppoll = 73;78 pselect6 = 72,
79pub const SYS_signalfd4 = 74;79 ppoll = 73,
80pub const SYS_vmsplice = 75;80 signalfd4 = 74,
81pub const SYS_splice = 76;81 vmsplice = 75,
82pub const SYS_tee = 77;82 splice = 76,
83pub const SYS_readlinkat = 78;83 tee = 77,
84pub const SYS_fstatat = 79;84 readlinkat = 78,
85pub const SYS_fstat = 80;85 fstatat = 79,
86pub const SYS_sync = 81;86 fstat = 80,
87pub const SYS_fsync = 82;87 sync = 81,
88pub const SYS_fdatasync = 83;88 fsync = 82,
89pub const SYS_sync_file_range = 84;89 fdatasync = 83,
90pub const SYS_timerfd_create = 85;90 sync_file_range = 84,
91pub const SYS_timerfd_settime = 86;91 timerfd_create = 85,
92pub const SYS_timerfd_gettime = 87;92 timerfd_settime = 86,
93pub const SYS_utimensat = 88;93 timerfd_gettime = 87,
94pub const SYS_acct = 89;94 utimensat = 88,
95pub const SYS_capget = 90;95 acct = 89,
96pub const SYS_capset = 91;96 capget = 90,
97pub const SYS_personality = 92;97 capset = 91,
98pub const SYS_exit = 93;98 personality = 92,
99pub const SYS_exit_group = 94;99 exit = 93,
100pub const SYS_waitid = 95;100 exit_group = 94,
101pub const SYS_set_tid_address = 96;101 waitid = 95,
102pub const SYS_unshare = 97;102 set_tid_address = 96,
103pub const SYS_futex = 98;103 unshare = 97,
104pub const SYS_set_robust_list = 99;104 futex = 98,
105pub const SYS_get_robust_list = 100;105 set_robust_list = 99,
106pub const SYS_nanosleep = 101;106 get_robust_list = 100,
107pub const SYS_getitimer = 102;107 nanosleep = 101,
108pub const SYS_setitimer = 103;108 getitimer = 102,
109pub const SYS_kexec_load = 104;109 setitimer = 103,
110pub const SYS_init_module = 105;110 kexec_load = 104,
111pub const SYS_delete_module = 106;111 init_module = 105,
112pub const SYS_timer_create = 107;112 delete_module = 106,
113pub const SYS_timer_gettime = 108;113 timer_create = 107,
114pub const SYS_timer_getoverrun = 109;114 timer_gettime = 108,
115pub const SYS_timer_settime = 110;115 timer_getoverrun = 109,
116pub const SYS_timer_delete = 111;116 timer_settime = 110,
117pub const SYS_clock_settime = 112;117 timer_delete = 111,
118pub const SYS_clock_gettime = 113;118 clock_settime = 112,
119pub const SYS_clock_getres = 114;119 clock_gettime = 113,
120pub const SYS_clock_nanosleep = 115;120 clock_getres = 114,
121pub const SYS_syslog = 116;121 clock_nanosleep = 115,
122pub const SYS_ptrace = 117;122 syslog = 116,
123pub const SYS_sched_setparam = 118;123 ptrace = 117,
124pub const SYS_sched_setscheduler = 119;124 sched_setparam = 118,
125pub const SYS_sched_getscheduler = 120;125 sched_setscheduler = 119,
126pub const SYS_sched_getparam = 121;126 sched_getscheduler = 120,
127pub const SYS_sched_setaffinity = 122;127 sched_getparam = 121,
128pub const SYS_sched_getaffinity = 123;128 sched_setaffinity = 122,
129pub const SYS_sched_yield = 124;129 sched_getaffinity = 123,
130pub const SYS_sched_get_priority_max = 125;130 sched_yield = 124,
131pub const SYS_sched_get_priority_min = 126;131 sched_get_priority_max = 125,
132pub const SYS_sched_rr_get_interval = 127;132 sched_get_priority_min = 126,
133pub const SYS_restart_syscall = 128;133 sched_rr_get_interval = 127,
134pub const SYS_kill = 129;134 restart_syscall = 128,
135pub const SYS_tkill = 130;135 kill = 129,
136pub const SYS_tgkill = 131;136 tkill = 130,
137pub const SYS_sigaltstack = 132;137 tgkill = 131,
138pub const SYS_rt_sigsuspend = 133;138 sigaltstack = 132,
139pub const SYS_rt_sigaction = 134;139 rt_sigsuspend = 133,
140pub const SYS_rt_sigprocmask = 135;140 rt_sigaction = 134,
141pub const SYS_rt_sigpending = 136;141 rt_sigprocmask = 135,
142pub const SYS_rt_sigtimedwait = 137;142 rt_sigpending = 136,
143pub const SYS_rt_sigqueueinfo = 138;143 rt_sigtimedwait = 137,
144pub const SYS_rt_sigreturn = 139;144 rt_sigqueueinfo = 138,
145pub const SYS_setpriority = 140;145 rt_sigreturn = 139,
146pub const SYS_getpriority = 141;146 setpriority = 140,
147pub const SYS_reboot = 142;147 getpriority = 141,
148pub const SYS_setregid = 143;148 reboot = 142,
149pub const SYS_setgid = 144;149 setregid = 143,
150pub const SYS_setreuid = 145;150 setgid = 144,
151pub const SYS_setuid = 146;151 setreuid = 145,
152pub const SYS_setresuid = 147;152 setuid = 146,
153pub const SYS_getresuid = 148;153 setresuid = 147,
154pub const SYS_setresgid = 149;154 getresuid = 148,
155pub const SYS_getresgid = 150;155 setresgid = 149,
156pub const SYS_setfsuid = 151;156 getresgid = 150,
157pub const SYS_setfsgid = 152;157 setfsuid = 151,
158pub const SYS_times = 153;158 setfsgid = 152,
159pub const SYS_setpgid = 154;159 times = 153,
160pub const SYS_getpgid = 155;160 setpgid = 154,
161pub const SYS_getsid = 156;161 getpgid = 155,
162pub const SYS_setsid = 157;162 getsid = 156,
163pub const SYS_getgroups = 158;163 setsid = 157,
164pub const SYS_setgroups = 159;164 getgroups = 158,
165pub const SYS_uname = 160;165 setgroups = 159,
166pub const SYS_sethostname = 161;166 uname = 160,
167pub const SYS_setdomainname = 162;167 sethostname = 161,
168pub const SYS_getrlimit = 163;168 setdomainname = 162,
169pub const SYS_setrlimit = 164;169 getrlimit = 163,
170pub const SYS_getrusage = 165;170 setrlimit = 164,
171pub const SYS_umask = 166;171 getrusage = 165,
172pub const SYS_prctl = 167;172 umask = 166,
173pub const SYS_getcpu = 168;173 prctl = 167,
174pub const SYS_gettimeofday = 169;174 getcpu = 168,
175pub const SYS_settimeofday = 170;175 gettimeofday = 169,
176pub const SYS_adjtimex = 171;176 settimeofday = 170,
177pub const SYS_getpid = 172;177 adjtimex = 171,
178pub const SYS_getppid = 173;178 getpid = 172,
179pub const SYS_getuid = 174;179 getppid = 173,
180pub const SYS_geteuid = 175;180 getuid = 174,
181pub const SYS_getgid = 176;181 geteuid = 175,
182pub const SYS_getegid = 177;182 getgid = 176,
183pub const SYS_gettid = 178;183 getegid = 177,
184pub const SYS_sysinfo = 179;184 gettid = 178,
185pub const SYS_mq_open = 180;185 sysinfo = 179,
186pub const SYS_mq_unlink = 181;186 mq_open = 180,
187pub const SYS_mq_timedsend = 182;187 mq_unlink = 181,
188pub const SYS_mq_timedreceive = 183;188 mq_timedsend = 182,
189pub const SYS_mq_notify = 184;189 mq_timedreceive = 183,
190pub const SYS_mq_getsetattr = 185;190 mq_notify = 184,
191pub const SYS_msgget = 186;191 mq_getsetattr = 185,
192pub const SYS_msgctl = 187;192 msgget = 186,
193pub const SYS_msgrcv = 188;193 msgctl = 187,
194pub const SYS_msgsnd = 189;194 msgrcv = 188,
195pub const SYS_semget = 190;195 msgsnd = 189,
196pub const SYS_semctl = 191;196 semget = 190,
197pub const SYS_semtimedop = 192;197 semctl = 191,
198pub const SYS_semop = 193;198 semtimedop = 192,
199pub const SYS_shmget = 194;199 semop = 193,
200pub const SYS_shmctl = 195;200 shmget = 194,
201pub const SYS_shmat = 196;201 shmctl = 195,
202pub const SYS_shmdt = 197;202 shmat = 196,
203pub const SYS_socket = 198;203 shmdt = 197,
204pub const SYS_socketpair = 199;204 socket = 198,
205pub const SYS_bind = 200;205 socketpair = 199,
206pub const SYS_listen = 201;206 bind = 200,
207pub const SYS_accept = 202;207 listen = 201,
208pub const SYS_connect = 203;208 accept = 202,
209pub const SYS_getsockname = 204;209 connect = 203,
210pub const SYS_getpeername = 205;210 getsockname = 204,
211pub const SYS_sendto = 206;211 getpeername = 205,
212pub const SYS_recvfrom = 207;212 sendto = 206,
213pub const SYS_setsockopt = 208;213 recvfrom = 207,
214pub const SYS_getsockopt = 209;214 setsockopt = 208,
215pub const SYS_shutdown = 210;215 getsockopt = 209,
216pub const SYS_sendmsg = 211;216 shutdown = 210,
217pub const SYS_recvmsg = 212;217 sendmsg = 211,
218pub const SYS_readahead = 213;218 recvmsg = 212,
219pub const SYS_brk = 214;219 readahead = 213,
220pub const SYS_munmap = 215;220 brk = 214,
221pub const SYS_mremap = 216;221 munmap = 215,
222pub const SYS_add_key = 217;222 mremap = 216,
223pub const SYS_request_key = 218;223 add_key = 217,
224pub const SYS_keyctl = 219;224 request_key = 218,
225pub const SYS_clone = 220;225 keyctl = 219,
226pub const SYS_execve = 221;226 clone = 220,
227pub const SYS_mmap = 222;227 execve = 221,
228pub const SYS_fadvise64 = 223;228 mmap = 222,
229pub const SYS_swapon = 224;229 fadvise64 = 223,
230pub const SYS_swapoff = 225;230 swapon = 224,
231pub const SYS_mprotect = 226;231 swapoff = 225,
232pub const SYS_msync = 227;232 mprotect = 226,
233pub const SYS_mlock = 228;233 msync = 227,
234pub const SYS_munlock = 229;234 mlock = 228,
235pub const SYS_mlockall = 230;235 munlock = 229,
236pub const SYS_munlockall = 231;236 mlockall = 230,
237pub const SYS_mincore = 232;237 munlockall = 231,
238pub const SYS_madvise = 233;238 mincore = 232,
239pub const SYS_remap_file_pages = 234;239 madvise = 233,
240pub const SYS_mbind = 235;240 remap_file_pages = 234,
241pub const SYS_get_mempolicy = 236;241 mbind = 235,
242pub const SYS_set_mempolicy = 237;242 get_mempolicy = 236,
243pub const SYS_migrate_pages = 238;243 set_mempolicy = 237,
244pub const SYS_move_pages = 239;244 migrate_pages = 238,
245pub const SYS_rt_tgsigqueueinfo = 240;245 move_pages = 239,
246pub const SYS_perf_event_open = 241;246 rt_tgsigqueueinfo = 240,
247pub const SYS_accept4 = 242;247 perf_event_open = 241,
248pub const SYS_recvmmsg = 243;248 accept4 = 242,
249 recvmmsg = 243,
249250
250pub const SYS_arch_specific_syscall = 244;251 pub const arch_specific_syscall = 244;
251pub const SYS_riscv_flush_icache = SYS_arch_specific_syscall + 15;252 riscv_flush_icache = arch_specific_syscall + 15,
252253
253pub const SYS_wait4 = 260;254 wait4 = 260,
254pub const SYS_prlimit64 = 261;255 prlimit64 = 261,
255pub const SYS_fanotify_init = 262;256 fanotify_init = 262,
256pub const SYS_fanotify_mark = 263;257 fanotify_mark = 263,
257pub const SYS_name_to_handle_at = 264;258 name_to_handle_at = 264,
258pub const SYS_open_by_handle_at = 265;259 open_by_handle_at = 265,
259pub const SYS_clock_adjtime = 266;260 clock_adjtime = 266,
260pub const SYS_syncfs = 267;261 syncfs = 267,
261pub const SYS_setns = 268;262 setns = 268,
262pub const SYS_sendmmsg = 269;263 sendmmsg = 269,
263pub const SYS_process_vm_readv = 270;264 process_vm_readv = 270,
264pub const SYS_process_vm_writev = 271;265 process_vm_writev = 271,
265pub const SYS_kcmp = 272;266 kcmp = 272,
266pub const SYS_finit_module = 273;267 finit_module = 273,
267pub const SYS_sched_setattr = 274;268 sched_setattr = 274,
268pub const SYS_sched_getattr = 275;269 sched_getattr = 275,
269pub const SYS_renameat2 = 276;270 renameat2 = 276,
270pub const SYS_seccomp = 277;271 seccomp = 277,
271pub const SYS_getrandom = 278;272 getrandom = 278,
272pub const SYS_memfd_create = 279;273 memfd_create = 279,
273pub const SYS_bpf = 280;274 bpf = 280,
274pub const SYS_execveat = 281;275 execveat = 281,
275pub const SYS_userfaultfd = 282;276 userfaultfd = 282,
276pub const SYS_membarrier = 283;277 membarrier = 283,
277pub const SYS_mlock2 = 284;278 mlock2 = 284,
278pub const SYS_copy_file_range = 285;279 copy_file_range = 285,
279pub const SYS_preadv2 = 286;280 preadv2 = 286,
280pub const SYS_pwritev2 = 287;281 pwritev2 = 287,
281pub const SYS_pkey_mprotect = 288;282 pkey_mprotect = 288,
282pub const SYS_pkey_alloc = 289;283 pkey_alloc = 289,
283pub const SYS_pkey_free = 290;284 pkey_free = 290,
284pub const SYS_statx = 291;285 statx = 291,
285pub const SYS_io_pgetevents = 292;286 io_pgetevents = 292,
286pub const SYS_rseq = 293;287 rseq = 293,
287pub const SYS_kexec_file_load = 294;288 kexec_file_load = 294,
288pub const SYS_pidfd_send_signal = 424;289 pidfd_send_signal = 424,
289pub const SYS_io_uring_setup = 425;290 io_uring_setup = 425,
290pub const SYS_io_uring_enter = 426;291 io_uring_enter = 426,
291pub const SYS_io_uring_register = 427;292 io_uring_register = 427,
292pub const SYS_open_tree = 428;293 open_tree = 428,
293pub const SYS_move_mount = 429;294 move_mount = 429,
294pub const SYS_fsopen = 430;295 fsopen = 430,
295pub const SYS_fsconfig = 431;296 fsconfig = 431,
296pub const SYS_fsmount = 432;297 fsmount = 432,
297pub const SYS_fspick = 433;298 fspick = 433,
298pub const SYS_pidfd_open = 434;299 pidfd_open = 434,
299pub const SYS_clone3 = 435;300 clone3 = 435,
300pub const SYS_openat2 = 437;301 openat2 = 437,
301pub const SYS_pidfd_getfd = 438;302 pidfd_getfd = 438,
303
304 _,
305};
302306
303pub const O_CREAT = 0o100;307pub const O_CREAT = 0o100;
304pub const O_EXCL = 0o200;308pub const O_EXCL = 0o200;
lib/std/os/bits/linux/x86_64.zig+354-350
...@@ -14,356 +14,360 @@ const iovec_const = linux.iovec_const;...@@ -14,356 +14,360 @@ const iovec_const = linux.iovec_const;
1414
15pub const mode_t = usize;15pub const mode_t = usize;
1616
17pub const SYS_read = 0;17pub const SYS = extern enum(usize) {
18pub const SYS_write = 1;18 read = 0,
19pub const SYS_open = 2;19 write = 1,
20pub const SYS_close = 3;20 open = 2,
21pub const SYS_stat = 4;21 close = 3,
22pub const SYS_fstat = 5;22 stat = 4,
23pub const SYS_lstat = 6;23 fstat = 5,
24pub const SYS_poll = 7;24 lstat = 6,
25pub const SYS_lseek = 8;25 poll = 7,
26pub const SYS_mmap = 9;26 lseek = 8,
27pub const SYS_mprotect = 10;27 mmap = 9,
28pub const SYS_munmap = 11;28 mprotect = 10,
29pub const SYS_brk = 12;29 munmap = 11,
30pub const SYS_rt_sigaction = 13;30 brk = 12,
31pub const SYS_rt_sigprocmask = 14;31 rt_sigaction = 13,
32pub const SYS_rt_sigreturn = 15;32 rt_sigprocmask = 14,
33pub const SYS_ioctl = 16;33 rt_sigreturn = 15,
34pub const SYS_pread = 17;34 ioctl = 16,
35pub const SYS_pwrite = 18;35 pread = 17,
36pub const SYS_readv = 19;36 pwrite = 18,
37pub const SYS_writev = 20;37 readv = 19,
38pub const SYS_access = 21;38 writev = 20,
39pub const SYS_pipe = 22;39 access = 21,
40pub const SYS_select = 23;40 pipe = 22,
41pub const SYS_sched_yield = 24;41 select = 23,
42pub const SYS_mremap = 25;42 sched_yield = 24,
43pub const SYS_msync = 26;43 mremap = 25,
44pub const SYS_mincore = 27;44 msync = 26,
45pub const SYS_madvise = 28;45 mincore = 27,
46pub const SYS_shmget = 29;46 madvise = 28,
47pub const SYS_shmat = 30;47 shmget = 29,
48pub const SYS_shmctl = 31;48 shmat = 30,
49pub const SYS_dup = 32;49 shmctl = 31,
50pub const SYS_dup2 = 33;50 dup = 32,
51pub const SYS_pause = 34;51 dup2 = 33,
52pub const SYS_nanosleep = 35;52 pause = 34,
53pub const SYS_getitimer = 36;53 nanosleep = 35,
54pub const SYS_alarm = 37;54 getitimer = 36,
55pub const SYS_setitimer = 38;55 alarm = 37,
56pub const SYS_getpid = 39;56 setitimer = 38,
57pub const SYS_sendfile = 40;57 getpid = 39,
58pub const SYS_socket = 41;58 sendfile = 40,
59pub const SYS_connect = 42;59 socket = 41,
60pub const SYS_accept = 43;60 connect = 42,
61pub const SYS_sendto = 44;61 accept = 43,
62pub const SYS_recvfrom = 45;62 sendto = 44,
63pub const SYS_sendmsg = 46;63 recvfrom = 45,
64pub const SYS_recvmsg = 47;64 sendmsg = 46,
65pub const SYS_shutdown = 48;65 recvmsg = 47,
66pub const SYS_bind = 49;66 shutdown = 48,
67pub const SYS_listen = 50;67 bind = 49,
68pub const SYS_getsockname = 51;68 listen = 50,
69pub const SYS_getpeername = 52;69 getsockname = 51,
70pub const SYS_socketpair = 53;70 getpeername = 52,
71pub const SYS_setsockopt = 54;71 socketpair = 53,
72pub const SYS_getsockopt = 55;72 setsockopt = 54,
73pub const SYS_clone = 56;73 getsockopt = 55,
74pub const SYS_fork = 57;74 clone = 56,
75pub const SYS_vfork = 58;75 fork = 57,
76pub const SYS_execve = 59;76 vfork = 58,
77pub const SYS_exit = 60;77 execve = 59,
78pub const SYS_wait4 = 61;78 exit = 60,
79pub const SYS_kill = 62;79 wait4 = 61,
80pub const SYS_uname = 63;80 kill = 62,
81pub const SYS_semget = 64;81 uname = 63,
82pub const SYS_semop = 65;82 semget = 64,
83pub const SYS_semctl = 66;83 semop = 65,
84pub const SYS_shmdt = 67;84 semctl = 66,
85pub const SYS_msgget = 68;85 shmdt = 67,
86pub const SYS_msgsnd = 69;86 msgget = 68,
87pub const SYS_msgrcv = 70;87 msgsnd = 69,
88pub const SYS_msgctl = 71;88 msgrcv = 70,
89pub const SYS_fcntl = 72;89 msgctl = 71,
90pub const SYS_flock = 73;90 fcntl = 72,
91pub const SYS_fsync = 74;91 flock = 73,
92pub const SYS_fdatasync = 75;92 fsync = 74,
93pub const SYS_truncate = 76;93 fdatasync = 75,
94pub const SYS_ftruncate = 77;94 truncate = 76,
95pub const SYS_getdents = 78;95 ftruncate = 77,
96pub const SYS_getcwd = 79;96 getdents = 78,
97pub const SYS_chdir = 80;97 getcwd = 79,
98pub const SYS_fchdir = 81;98 chdir = 80,
99pub const SYS_rename = 82;99 fchdir = 81,
100pub const SYS_mkdir = 83;100 rename = 82,
101pub const SYS_rmdir = 84;101 mkdir = 83,
102pub const SYS_creat = 85;102 rmdir = 84,
103pub const SYS_link = 86;103 creat = 85,
104pub const SYS_unlink = 87;104 link = 86,
105pub const SYS_symlink = 88;105 unlink = 87,
106pub const SYS_readlink = 89;106 symlink = 88,
107pub const SYS_chmod = 90;107 readlink = 89,
108pub const SYS_fchmod = 91;108 chmod = 90,
109pub const SYS_chown = 92;109 fchmod = 91,
110pub const SYS_fchown = 93;110 chown = 92,
111pub const SYS_lchown = 94;111 fchown = 93,
112pub const SYS_umask = 95;112 lchown = 94,
113pub const SYS_gettimeofday = 96;113 umask = 95,
114pub const SYS_getrlimit = 97;114 gettimeofday = 96,
115pub const SYS_getrusage = 98;115 getrlimit = 97,
116pub const SYS_sysinfo = 99;116 getrusage = 98,
117pub const SYS_times = 100;117 sysinfo = 99,
118pub const SYS_ptrace = 101;118 times = 100,
119pub const SYS_getuid = 102;119 ptrace = 101,
120pub const SYS_syslog = 103;120 getuid = 102,
121pub const SYS_getgid = 104;121 syslog = 103,
122pub const SYS_setuid = 105;122 getgid = 104,
123pub const SYS_setgid = 106;123 setuid = 105,
124pub const SYS_geteuid = 107;124 setgid = 106,
125pub const SYS_getegid = 108;125 geteuid = 107,
126pub const SYS_setpgid = 109;126 getegid = 108,
127pub const SYS_getppid = 110;127 setpgid = 109,
128pub const SYS_getpgrp = 111;128 getppid = 110,
129pub const SYS_setsid = 112;129 getpgrp = 111,
130pub const SYS_setreuid = 113;130 setsid = 112,
131pub const SYS_setregid = 114;131 setreuid = 113,
132pub const SYS_getgroups = 115;132 setregid = 114,
133pub const SYS_setgroups = 116;133 getgroups = 115,
134pub const SYS_setresuid = 117;134 setgroups = 116,
135pub const SYS_getresuid = 118;135 setresuid = 117,
136pub const SYS_setresgid = 119;136 getresuid = 118,
137pub const SYS_getresgid = 120;137 setresgid = 119,
138pub const SYS_getpgid = 121;138 getresgid = 120,
139pub const SYS_setfsuid = 122;139 getpgid = 121,
140pub const SYS_setfsgid = 123;140 setfsuid = 122,
141pub const SYS_getsid = 124;141 setfsgid = 123,
142pub const SYS_capget = 125;142 getsid = 124,
143pub const SYS_capset = 126;143 capget = 125,
144pub const SYS_rt_sigpending = 127;144 capset = 126,
145pub const SYS_rt_sigtimedwait = 128;145 rt_sigpending = 127,
146pub const SYS_rt_sigqueueinfo = 129;146 rt_sigtimedwait = 128,
147pub const SYS_rt_sigsuspend = 130;147 rt_sigqueueinfo = 129,
148pub const SYS_sigaltstack = 131;148 rt_sigsuspend = 130,
149pub const SYS_utime = 132;149 sigaltstack = 131,
150pub const SYS_mknod = 133;150 utime = 132,
151pub const SYS_uselib = 134;151 mknod = 133,
152pub const SYS_personality = 135;152 uselib = 134,
153pub const SYS_ustat = 136;153 personality = 135,
154pub const SYS_statfs = 137;154 ustat = 136,
155pub const SYS_fstatfs = 138;155 statfs = 137,
156pub const SYS_sysfs = 139;156 fstatfs = 138,
157pub const SYS_getpriority = 140;157 sysfs = 139,
158pub const SYS_setpriority = 141;158 getpriority = 140,
159pub const SYS_sched_setparam = 142;159 setpriority = 141,
160pub const SYS_sched_getparam = 143;160 sched_setparam = 142,
161pub const SYS_sched_setscheduler = 144;161 sched_getparam = 143,
162pub const SYS_sched_getscheduler = 145;162 sched_setscheduler = 144,
163pub const SYS_sched_get_priority_max = 146;163 sched_getscheduler = 145,
164pub const SYS_sched_get_priority_min = 147;164 sched_get_priority_max = 146,
165pub const SYS_sched_rr_get_interval = 148;165 sched_get_priority_min = 147,
166pub const SYS_mlock = 149;166 sched_rr_get_interval = 148,
167pub const SYS_munlock = 150;167 mlock = 149,
168pub const SYS_mlockall = 151;168 munlock = 150,
169pub const SYS_munlockall = 152;169 mlockall = 151,
170pub const SYS_vhangup = 153;170 munlockall = 152,
171pub const SYS_modify_ldt = 154;171 vhangup = 153,
172pub const SYS_pivot_root = 155;172 modify_ldt = 154,
173pub const SYS__sysctl = 156;173 pivot_root = 155,
174pub const SYS_prctl = 157;174 _sysctl = 156,
175pub const SYS_arch_prctl = 158;175 prctl = 157,
176pub const SYS_adjtimex = 159;176 arch_prctl = 158,
177pub const SYS_setrlimit = 160;177 adjtimex = 159,
178pub const SYS_chroot = 161;178 setrlimit = 160,
179pub const SYS_sync = 162;179 chroot = 161,
180pub const SYS_acct = 163;180 sync = 162,
181pub const SYS_settimeofday = 164;181 acct = 163,
182pub const SYS_mount = 165;182 settimeofday = 164,
183pub const SYS_umount2 = 166;183 mount = 165,
184pub const SYS_swapon = 167;184 umount2 = 166,
185pub const SYS_swapoff = 168;185 swapon = 167,
186pub const SYS_reboot = 169;186 swapoff = 168,
187pub const SYS_sethostname = 170;187 reboot = 169,
188pub const SYS_setdomainname = 171;188 sethostname = 170,
189pub const SYS_iopl = 172;189 setdomainname = 171,
190pub const SYS_ioperm = 173;190 iopl = 172,
191pub const SYS_create_module = 174;191 ioperm = 173,
192pub const SYS_init_module = 175;192 create_module = 174,
193pub const SYS_delete_module = 176;193 init_module = 175,
194pub const SYS_get_kernel_syms = 177;194 delete_module = 176,
195pub const SYS_query_module = 178;195 get_kernel_syms = 177,
196pub const SYS_quotactl = 179;196 query_module = 178,
197pub const SYS_nfsservctl = 180;197 quotactl = 179,
198pub const SYS_getpmsg = 181;198 nfsservctl = 180,
199pub const SYS_putpmsg = 182;199 getpmsg = 181,
200pub const SYS_afs_syscall = 183;200 putpmsg = 182,
201pub const SYS_tuxcall = 184;201 afs_syscall = 183,
202pub const SYS_security = 185;202 tuxcall = 184,
203pub const SYS_gettid = 186;203 security = 185,
204pub const SYS_readahead = 187;204 gettid = 186,
205pub const SYS_setxattr = 188;205 readahead = 187,
206pub const SYS_lsetxattr = 189;206 setxattr = 188,
207pub const SYS_fsetxattr = 190;207 lsetxattr = 189,
208pub const SYS_getxattr = 191;208 fsetxattr = 190,
209pub const SYS_lgetxattr = 192;209 getxattr = 191,
210pub const SYS_fgetxattr = 193;210 lgetxattr = 192,
211pub const SYS_listxattr = 194;211 fgetxattr = 193,
212pub const SYS_llistxattr = 195;212 listxattr = 194,
213pub const SYS_flistxattr = 196;213 llistxattr = 195,
214pub const SYS_removexattr = 197;214 flistxattr = 196,
215pub const SYS_lremovexattr = 198;215 removexattr = 197,
216pub const SYS_fremovexattr = 199;216 lremovexattr = 198,
217pub const SYS_tkill = 200;217 fremovexattr = 199,
218pub const SYS_time = 201;218 tkill = 200,
219pub const SYS_futex = 202;219 time = 201,
220pub const SYS_sched_setaffinity = 203;220 futex = 202,
221pub const SYS_sched_getaffinity = 204;221 sched_setaffinity = 203,
222pub const SYS_set_thread_area = 205;222 sched_getaffinity = 204,
223pub const SYS_io_setup = 206;223 set_thread_area = 205,
224pub const SYS_io_destroy = 207;224 io_setup = 206,
225pub const SYS_io_getevents = 208;225 io_destroy = 207,
226pub const SYS_io_submit = 209;226 io_getevents = 208,
227pub const SYS_io_cancel = 210;227 io_submit = 209,
228pub const SYS_get_thread_area = 211;228 io_cancel = 210,
229pub const SYS_lookup_dcookie = 212;229 get_thread_area = 211,
230pub const SYS_epoll_create = 213;230 lookup_dcookie = 212,
231pub const SYS_epoll_ctl_old = 214;231 epoll_create = 213,
232pub const SYS_epoll_wait_old = 215;232 epoll_ctl_old = 214,
233pub const SYS_remap_file_pages = 216;233 epoll_wait_old = 215,
234pub const SYS_getdents64 = 217;234 remap_file_pages = 216,
235pub const SYS_set_tid_address = 218;235 getdents64 = 217,
236pub const SYS_restart_syscall = 219;236 set_tid_address = 218,
237pub const SYS_semtimedop = 220;237 restart_syscall = 219,
238pub const SYS_fadvise64 = 221;238 semtimedop = 220,
239pub const SYS_timer_create = 222;239 fadvise64 = 221,
240pub const SYS_timer_settime = 223;240 timer_create = 222,
241pub const SYS_timer_gettime = 224;241 timer_settime = 223,
242pub const SYS_timer_getoverrun = 225;242 timer_gettime = 224,
243pub const SYS_timer_delete = 226;243 timer_getoverrun = 225,
244pub const SYS_clock_settime = 227;244 timer_delete = 226,
245pub const SYS_clock_gettime = 228;245 clock_settime = 227,
246pub const SYS_clock_getres = 229;246 clock_gettime = 228,
247pub const SYS_clock_nanosleep = 230;247 clock_getres = 229,
248pub const SYS_exit_group = 231;248 clock_nanosleep = 230,
249pub const SYS_epoll_wait = 232;249 exit_group = 231,
250pub const SYS_epoll_ctl = 233;250 epoll_wait = 232,
251pub const SYS_tgkill = 234;251 epoll_ctl = 233,
252pub const SYS_utimes = 235;252 tgkill = 234,
253pub const SYS_vserver = 236;253 utimes = 235,
254pub const SYS_mbind = 237;254 vserver = 236,
255pub const SYS_set_mempolicy = 238;255 mbind = 237,
256pub const SYS_get_mempolicy = 239;256 set_mempolicy = 238,
257pub const SYS_mq_open = 240;257 get_mempolicy = 239,
258pub const SYS_mq_unlink = 241;258 mq_open = 240,
259pub const SYS_mq_timedsend = 242;259 mq_unlink = 241,
260pub const SYS_mq_timedreceive = 243;260 mq_timedsend = 242,
261pub const SYS_mq_notify = 244;261 mq_timedreceive = 243,
262pub const SYS_mq_getsetattr = 245;262 mq_notify = 244,
263pub const SYS_kexec_load = 246;263 mq_getsetattr = 245,
264pub const SYS_waitid = 247;264 kexec_load = 246,
265pub const SYS_add_key = 248;265 waitid = 247,
266pub const SYS_request_key = 249;266 add_key = 248,
267pub const SYS_keyctl = 250;267 request_key = 249,
268pub const SYS_ioprio_set = 251;268 keyctl = 250,
269pub const SYS_ioprio_get = 252;269 ioprio_set = 251,
270pub const SYS_inotify_init = 253;270 ioprio_get = 252,
271pub const SYS_inotify_add_watch = 254;271 inotify_init = 253,
272pub const SYS_inotify_rm_watch = 255;272 inotify_add_watch = 254,
273pub const SYS_migrate_pages = 256;273 inotify_rm_watch = 255,
274pub const SYS_openat = 257;274 migrate_pages = 256,
275pub const SYS_mkdirat = 258;275 openat = 257,
276pub const SYS_mknodat = 259;276 mkdirat = 258,
277pub const SYS_fchownat = 260;277 mknodat = 259,
278pub const SYS_futimesat = 261;278 fchownat = 260,
279pub const SYS_newfstatat = 262;279 futimesat = 261,
280pub const SYS_fstatat = 262;280 newfstatat = 262,
281pub const SYS_unlinkat = 263;281 fstatat = 262,
282pub const SYS_renameat = 264;282 unlinkat = 263,
283pub const SYS_linkat = 265;283 renameat = 264,
284pub const SYS_symlinkat = 266;284 linkat = 265,
285pub const SYS_readlinkat = 267;285 symlinkat = 266,
286pub const SYS_fchmodat = 268;286 readlinkat = 267,
287pub const SYS_faccessat = 269;287 fchmodat = 268,
288pub const SYS_pselect6 = 270;288 faccessat = 269,
289pub const SYS_ppoll = 271;289 pselect6 = 270,
290pub const SYS_unshare = 272;290 ppoll = 271,
291pub const SYS_set_robust_list = 273;291 unshare = 272,
292pub const SYS_get_robust_list = 274;292 set_robust_list = 273,
293pub const SYS_splice = 275;293 get_robust_list = 274,
294pub const SYS_tee = 276;294 splice = 275,
295pub const SYS_sync_file_range = 277;295 tee = 276,
296pub const SYS_vmsplice = 278;296 sync_file_range = 277,
297pub const SYS_move_pages = 279;297 vmsplice = 278,
298pub const SYS_utimensat = 280;298 move_pages = 279,
299pub const SYS_epoll_pwait = 281;299 utimensat = 280,
300pub const SYS_signalfd = 282;300 epoll_pwait = 281,
301pub const SYS_timerfd_create = 283;301 signalfd = 282,
302pub const SYS_eventfd = 284;302 timerfd_create = 283,
303pub const SYS_fallocate = 285;303 eventfd = 284,
304pub const SYS_timerfd_settime = 286;304 fallocate = 285,
305pub const SYS_timerfd_gettime = 287;305 timerfd_settime = 286,
306pub const SYS_accept4 = 288;306 timerfd_gettime = 287,
307pub const SYS_signalfd4 = 289;307 accept4 = 288,
308pub const SYS_eventfd2 = 290;308 signalfd4 = 289,
309pub const SYS_epoll_create1 = 291;309 eventfd2 = 290,
310pub const SYS_dup3 = 292;310 epoll_create1 = 291,
311pub const SYS_pipe2 = 293;311 dup3 = 292,
312pub const SYS_inotify_init1 = 294;312 pipe2 = 293,
313pub const SYS_preadv = 295;313 inotify_init1 = 294,
314pub const SYS_pwritev = 296;314 preadv = 295,
315pub const SYS_rt_tgsigqueueinfo = 297;315 pwritev = 296,
316pub const SYS_perf_event_open = 298;316 rt_tgsigqueueinfo = 297,
317pub const SYS_recvmmsg = 299;317 perf_event_open = 298,
318pub const SYS_fanotify_init = 300;318 recvmmsg = 299,
319pub const SYS_fanotify_mark = 301;319 fanotify_init = 300,
320pub const SYS_prlimit64 = 302;320 fanotify_mark = 301,
321pub const SYS_name_to_handle_at = 303;321 prlimit64 = 302,
322pub const SYS_open_by_handle_at = 304;322 name_to_handle_at = 303,
323pub const SYS_clock_adjtime = 305;323 open_by_handle_at = 304,
324pub const SYS_syncfs = 306;324 clock_adjtime = 305,
325pub const SYS_sendmmsg = 307;325 syncfs = 306,
326pub const SYS_setns = 308;326 sendmmsg = 307,
327pub const SYS_getcpu = 309;327 setns = 308,
328pub const SYS_process_vm_readv = 310;328 getcpu = 309,
329pub const SYS_process_vm_writev = 311;329 process_vm_readv = 310,
330pub const SYS_kcmp = 312;330 process_vm_writev = 311,
331pub const SYS_finit_module = 313;331 kcmp = 312,
332pub const SYS_sched_setattr = 314;332 finit_module = 313,
333pub const SYS_sched_getattr = 315;333 sched_setattr = 314,
334pub const SYS_renameat2 = 316;334 sched_getattr = 315,
335pub const SYS_seccomp = 317;335 renameat2 = 316,
336pub const SYS_getrandom = 318;336 seccomp = 317,
337pub const SYS_memfd_create = 319;337 getrandom = 318,
338pub const SYS_kexec_file_load = 320;338 memfd_create = 319,
339pub const SYS_bpf = 321;339 kexec_file_load = 320,
340pub const SYS_execveat = 322;340 bpf = 321,
341pub const SYS_userfaultfd = 323;341 execveat = 322,
342pub const SYS_membarrier = 324;342 userfaultfd = 323,
343pub const SYS_mlock2 = 325;343 membarrier = 324,
344pub const SYS_copy_file_range = 326;344 mlock2 = 325,
345pub const SYS_preadv2 = 327;345 copy_file_range = 326,
346pub const SYS_pwritev2 = 328;346 preadv2 = 327,
347pub const SYS_pkey_mprotect = 329;347 pwritev2 = 328,
348pub const SYS_pkey_alloc = 330;348 pkey_mprotect = 329,
349pub const SYS_pkey_free = 331;349 pkey_alloc = 330,
350pub const SYS_statx = 332;350 pkey_free = 331,
351pub const SYS_io_pgetevents = 333;351 statx = 332,
352pub const SYS_rseq = 334;352 io_pgetevents = 333,
353pub const SYS_pidfd_send_signal = 424;353 rseq = 334,
354pub const SYS_io_uring_setup = 425;354 pidfd_send_signal = 424,
355pub const SYS_io_uring_enter = 426;355 io_uring_setup = 425,
356pub const SYS_io_uring_register = 427;356 io_uring_enter = 426,
357pub const SYS_open_tree = 428;357 io_uring_register = 427,
358pub const SYS_move_mount = 429;358 open_tree = 428,
359pub const SYS_fsopen = 430;359 move_mount = 429,
360pub const SYS_fsconfig = 431;360 fsopen = 430,
361pub const SYS_fsmount = 432;361 fsconfig = 431,
362pub const SYS_fspick = 433;362 fsmount = 432,
363pub const SYS_pidfd_open = 434;363 fspick = 433,
364pub const SYS_clone3 = 435;364 pidfd_open = 434,
365pub const SYS_openat2 = 437;365 clone3 = 435,
366pub const SYS_pidfd_getfd = 438;366 openat2 = 437,
367 pidfd_getfd = 438,
368
369 _,
370};
367371
368pub const O_CREAT = 0o100;372pub const O_CREAT = 0o100;
369pub const O_EXCL = 0o200;373pub const O_EXCL = 0o200;
lib/std/os/linux.zig+227-227
...@@ -53,46 +53,46 @@ pub fn getErrno(r: usize) u12 {...@@ -53,46 +53,46 @@ pub fn getErrno(r: usize) u12 {
53}53}
5454
55pub fn dup2(old: i32, new: i32) usize {55pub fn dup2(old: i32, new: i32) usize {
56 if (@hasDecl(@This(), "SYS_dup2")) {56 if (@hasField(SYS, "dup2")) {
57 return syscall2(SYS_dup2, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)));57 return syscall2(.dup2, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)));
58 } else {58 } else {
59 if (old == new) {59 if (old == new) {
60 if (std.debug.runtime_safety) {60 if (std.debug.runtime_safety) {
61 const rc = syscall2(SYS_fcntl, @bitCast(usize, @as(isize, old)), F_GETFD);61 const rc = syscall2(.fcntl, @bitCast(usize, @as(isize, old)), F_GETFD);
62 if (@bitCast(isize, rc) < 0) return rc;62 if (@bitCast(isize, rc) < 0) return rc;
63 }63 }
64 return @intCast(usize, old);64 return @intCast(usize, old);
65 } else {65 } else {
66 return syscall3(SYS_dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), 0);66 return syscall3(.dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), 0);
67 }67 }
68 }68 }
69}69}
7070
71pub fn dup3(old: i32, new: i32, flags: u32) usize {71pub fn dup3(old: i32, new: i32, flags: u32) usize {
72 return syscall3(SYS_dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), flags);72 return syscall3(.dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), flags);
73}73}
7474
75pub fn chdir(path: [*:0]const u8) usize {75pub fn chdir(path: [*:0]const u8) usize {
76 return syscall1(SYS_chdir, @ptrToInt(path));76 return syscall1(.chdir, @ptrToInt(path));
77}77}
7878
79pub fn fchdir(fd: fd_t) usize {79pub fn fchdir(fd: fd_t) usize {
80 return syscall1(SYS_fchdir, @bitCast(usize, @as(isize, fd)));80 return syscall1(.fchdir, @bitCast(usize, @as(isize, fd)));
81}81}
8282
83pub fn chroot(path: [*:0]const u8) usize {83pub fn chroot(path: [*:0]const u8) usize {
84 return syscall1(SYS_chroot, @ptrToInt(path));84 return syscall1(.chroot, @ptrToInt(path));
85}85}
8686
87pub fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) usize {87pub fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) usize {
88 return syscall3(SYS_execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp));88 return syscall3(.execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp));
89}89}
9090
91pub fn fork() usize {91pub fn fork() usize {
92 if (@hasDecl(@This(), "SYS_fork")) {92 if (@hasField(SYS, "fork")) {
93 return syscall0(SYS_fork);93 return syscall0(.fork);
94 } else {94 } else {
95 return syscall2(SYS_clone, SIGCHLD, 0);95 return syscall2(.clone, SIGCHLD, 0);
96 }96 }
97}97}
9898
...@@ -102,7 +102,7 @@ pub fn fork() usize {...@@ -102,7 +102,7 @@ pub fn fork() usize {
102/// the compiler is not aware of how vfork affects control flow and you may102/// the compiler is not aware of how vfork affects control flow and you may
103/// see different results in optimized builds.103/// see different results in optimized builds.
104pub inline fn vfork() usize {104pub inline fn vfork() usize {
105 return @call(.{ .modifier = .always_inline }, syscall0, .{SYS_vfork});105 return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});
106}106}
107107
108pub fn futimens(fd: i32, times: *const [2]timespec) usize {108pub fn futimens(fd: i32, times: *const [2]timespec) usize {
...@@ -110,24 +110,24 @@ pub fn futimens(fd: i32, times: *const [2]timespec) usize {...@@ -110,24 +110,24 @@ pub fn futimens(fd: i32, times: *const [2]timespec) usize {
110}110}
111111
112pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, flags: u32) usize {112pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, flags: u32) usize {
113 return syscall4(SYS_utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags);113 return syscall4(.utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags);
114}114}
115115
116pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize {116pub fn futex_wait(uaddr: *const i32, futex_op: u32, val: i32, timeout: ?*timespec) usize {
117 return syscall4(SYS_futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val), @ptrToInt(timeout));117 return syscall4(.futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val), @ptrToInt(timeout));
118}118}
119119
120pub fn futex_wake(uaddr: *const i32, futex_op: u32, val: i32) usize {120pub fn futex_wake(uaddr: *const i32, futex_op: u32, val: i32) usize {
121 return syscall3(SYS_futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val));121 return syscall3(.futex, @ptrToInt(uaddr), futex_op, @bitCast(u32, val));
122}122}
123123
124pub fn getcwd(buf: [*]u8, size: usize) usize {124pub fn getcwd(buf: [*]u8, size: usize) usize {
125 return syscall2(SYS_getcwd, @ptrToInt(buf), size);125 return syscall2(.getcwd, @ptrToInt(buf), size);
126}126}
127127
128pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize {128pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize {
129 return syscall3(129 return syscall3(
130 SYS_getdents,130 .getdents,
131 @bitCast(usize, @as(isize, fd)),131 @bitCast(usize, @as(isize, fd)),
132 @ptrToInt(dirp),132 @ptrToInt(dirp),
133 std.math.min(len, maxInt(c_int)),133 std.math.min(len, maxInt(c_int)),
...@@ -136,7 +136,7 @@ pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize {...@@ -136,7 +136,7 @@ pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize {
136136
137pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize {137pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize {
138 return syscall3(138 return syscall3(
139 SYS_getdents64,139 .getdents64,
140 @bitCast(usize, @as(isize, fd)),140 @bitCast(usize, @as(isize, fd)),
141 @ptrToInt(dirp),141 @ptrToInt(dirp),
142 std.math.min(len, maxInt(c_int)),142 std.math.min(len, maxInt(c_int)),
...@@ -144,61 +144,61 @@ pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize {...@@ -144,61 +144,61 @@ pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize {
144}144}
145145
146pub fn inotify_init1(flags: u32) usize {146pub fn inotify_init1(flags: u32) usize {
147 return syscall1(SYS_inotify_init1, flags);147 return syscall1(.inotify_init1, flags);
148}148}
149149
150pub fn inotify_add_watch(fd: i32, pathname: [*:0]const u8, mask: u32) usize {150pub fn inotify_add_watch(fd: i32, pathname: [*:0]const u8, mask: u32) usize {
151 return syscall3(SYS_inotify_add_watch, @bitCast(usize, @as(isize, fd)), @ptrToInt(pathname), mask);151 return syscall3(.inotify_add_watch, @bitCast(usize, @as(isize, fd)), @ptrToInt(pathname), mask);
152}152}
153153
154pub fn inotify_rm_watch(fd: i32, wd: i32) usize {154pub fn inotify_rm_watch(fd: i32, wd: i32) usize {
155 return syscall2(SYS_inotify_rm_watch, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, wd)));155 return syscall2(.inotify_rm_watch, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, wd)));
156}156}
157157
158pub fn readlink(noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize {158pub fn readlink(noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize {
159 if (@hasDecl(@This(), "SYS_readlink")) {159 if (@hasField(SYS, "readlink")) {
160 return syscall3(SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);160 return syscall3(.readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
161 } else {161 } else {
162 return syscall4(SYS_readlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);162 return syscall4(.readlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
163 }163 }
164}164}
165165
166pub fn readlinkat(dirfd: i32, noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize {166pub fn readlinkat(dirfd: i32, noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize {
167 return syscall4(SYS_readlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);167 return syscall4(.readlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
168}168}
169169
170pub fn mkdir(path: [*:0]const u8, mode: u32) usize {170pub fn mkdir(path: [*:0]const u8, mode: u32) usize {
171 if (@hasDecl(@This(), "SYS_mkdir")) {171 if (@hasField(SYS, "mkdir")) {
172 return syscall2(SYS_mkdir, @ptrToInt(path), mode);172 return syscall2(.mkdir, @ptrToInt(path), mode);
173 } else {173 } else {
174 return syscall3(SYS_mkdirat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode);174 return syscall3(.mkdirat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode);
175 }175 }
176}176}
177177
178pub fn mkdirat(dirfd: i32, path: [*:0]const u8, mode: u32) usize {178pub fn mkdirat(dirfd: i32, path: [*:0]const u8, mode: u32) usize {
179 return syscall3(SYS_mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode);179 return syscall3(.mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode);
180}180}
181181
182pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize {182pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize {
183 return syscall5(SYS_mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data);183 return syscall5(.mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data);
184}184}
185185
186pub fn umount(special: [*:0]const u8) usize {186pub fn umount(special: [*:0]const u8) usize {
187 return syscall2(SYS_umount2, @ptrToInt(special), 0);187 return syscall2(.umount2, @ptrToInt(special), 0);
188}188}
189189
190pub fn umount2(special: [*:0]const u8, flags: u32) usize {190pub fn umount2(special: [*:0]const u8, flags: u32) usize {
191 return syscall2(SYS_umount2, @ptrToInt(special), flags);191 return syscall2(.umount2, @ptrToInt(special), flags);
192}192}
193193
194pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: u64) usize {194pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, offset: u64) usize {
195 if (@hasDecl(@This(), "SYS_mmap2")) {195 if (@hasField(SYS, "mmap2")) {
196 // Make sure the offset is also specified in multiples of page size196 // Make sure the offset is also specified in multiples of page size
197 if ((offset & (MMAP2_UNIT - 1)) != 0)197 if ((offset & (MMAP2_UNIT - 1)) != 0)
198 return @bitCast(usize, @as(isize, -EINVAL));198 return @bitCast(usize, @as(isize, -EINVAL));
199199
200 return syscall6(200 return syscall6(
201 SYS_mmap2,201 .mmap2,
202 @ptrToInt(address),202 @ptrToInt(address),
203 length,203 length,
204 prot,204 prot,
...@@ -208,7 +208,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of...@@ -208,7 +208,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of
208 );208 );
209 } else {209 } else {
210 return syscall6(210 return syscall6(
211 SYS_mmap,211 .mmap,
212 @ptrToInt(address),212 @ptrToInt(address),
213 length,213 length,
214 prot,214 prot,
...@@ -220,19 +220,19 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of...@@ -220,19 +220,19 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of
220}220}
221221
222pub fn mprotect(address: [*]const u8, length: usize, protection: usize) usize {222pub fn mprotect(address: [*]const u8, length: usize, protection: usize) usize {
223 return syscall3(SYS_mprotect, @ptrToInt(address), length, protection);223 return syscall3(.mprotect, @ptrToInt(address), length, protection);
224}224}
225225
226pub fn munmap(address: [*]const u8, length: usize) usize {226pub fn munmap(address: [*]const u8, length: usize) usize {
227 return syscall2(SYS_munmap, @ptrToInt(address), length);227 return syscall2(.munmap, @ptrToInt(address), length);
228}228}
229229
230pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {230pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {
231 if (@hasDecl(@This(), "SYS_poll")) {231 if (@hasField(SYS, "poll")) {
232 return syscall3(SYS_poll, @ptrToInt(fds), n, @bitCast(u32, timeout));232 return syscall3(.poll, @ptrToInt(fds), n, @bitCast(u32, timeout));
233 } else {233 } else {
234 return syscall6(234 return syscall6(
235 SYS_ppoll,235 .ppoll,
236 @ptrToInt(fds),236 @ptrToInt(fds),
237 n,237 n,
238 @ptrToInt(if (timeout >= 0)238 @ptrToInt(if (timeout >= 0)
...@@ -250,12 +250,12 @@ pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {...@@ -250,12 +250,12 @@ pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {
250}250}
251251
252pub fn read(fd: i32, buf: [*]u8, count: usize) usize {252pub fn read(fd: i32, buf: [*]u8, count: usize) usize {
253 return syscall3(SYS_read, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count);253 return syscall3(.read, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count);
254}254}
255255
256pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize {256pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize {
257 return syscall5(257 return syscall5(
258 SYS_preadv,258 .preadv,
259 @bitCast(usize, @as(isize, fd)),259 @bitCast(usize, @as(isize, fd)),
260 @ptrToInt(iov),260 @ptrToInt(iov),
261 count,261 count,
...@@ -266,7 +266,7 @@ pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize {...@@ -266,7 +266,7 @@ pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize {
266266
267pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: kernel_rwf) usize {267pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: kernel_rwf) usize {
268 return syscall6(268 return syscall6(
269 SYS_preadv2,269 .preadv2,
270 @bitCast(usize, @as(isize, fd)),270 @bitCast(usize, @as(isize, fd)),
271 @ptrToInt(iov),271 @ptrToInt(iov),
272 count,272 count,
...@@ -277,16 +277,16 @@ pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: k...@@ -277,16 +277,16 @@ pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: k
277}277}
278278
279pub fn readv(fd: i32, iov: [*]const iovec, count: usize) usize {279pub fn readv(fd: i32, iov: [*]const iovec, count: usize) usize {
280 return syscall3(SYS_readv, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count);280 return syscall3(.readv, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count);
281}281}
282282
283pub fn writev(fd: i32, iov: [*]const iovec_const, count: usize) usize {283pub fn writev(fd: i32, iov: [*]const iovec_const, count: usize) usize {
284 return syscall3(SYS_writev, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count);284 return syscall3(.writev, @bitCast(usize, @as(isize, fd)), @ptrToInt(iov), count);
285}285}
286286
287pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) usize {287pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) usize {
288 return syscall5(288 return syscall5(
289 SYS_pwritev,289 .pwritev,
290 @bitCast(usize, @as(isize, fd)),290 @bitCast(usize, @as(isize, fd)),
291 @ptrToInt(iov),291 @ptrToInt(iov),
292 count,292 count,
...@@ -297,7 +297,7 @@ pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) us...@@ -297,7 +297,7 @@ pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) us
297297
298pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, flags: kernel_rwf) usize {298pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, flags: kernel_rwf) usize {
299 return syscall6(299 return syscall6(
300 SYS_pwritev2,300 .pwritev2,
301 @bitCast(usize, @as(isize, fd)),301 @bitCast(usize, @as(isize, fd)),
302 @ptrToInt(iov),302 @ptrToInt(iov),
303 count,303 count,
...@@ -308,30 +308,30 @@ pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, f...@@ -308,30 +308,30 @@ pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, f
308}308}
309309
310pub fn rmdir(path: [*:0]const u8) usize {310pub fn rmdir(path: [*:0]const u8) usize {
311 if (@hasDecl(@This(), "SYS_rmdir")) {311 if (@hasField(SYS, "rmdir")) {
312 return syscall1(SYS_rmdir, @ptrToInt(path));312 return syscall1(.rmdir, @ptrToInt(path));
313 } else {313 } else {
314 return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), AT_REMOVEDIR);314 return syscall3(.unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), AT_REMOVEDIR);
315 }315 }
316}316}
317317
318pub fn symlink(existing: [*:0]const u8, new: [*:0]const u8) usize {318pub fn symlink(existing: [*:0]const u8, new: [*:0]const u8) usize {
319 if (@hasDecl(@This(), "SYS_symlink")) {319 if (@hasField(SYS, "symlink")) {
320 return syscall2(SYS_symlink, @ptrToInt(existing), @ptrToInt(new));320 return syscall2(.symlink, @ptrToInt(existing), @ptrToInt(new));
321 } else {321 } else {
322 return syscall3(SYS_symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new));322 return syscall3(.symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new));
323 }323 }
324}324}
325325
326pub fn symlinkat(existing: [*:0]const u8, newfd: i32, newpath: [*:0]const u8) usize {326pub fn symlinkat(existing: [*:0]const u8, newfd: i32, newpath: [*:0]const u8) usize {
327 return syscall3(SYS_symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, newfd)), @ptrToInt(newpath));327 return syscall3(.symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, newfd)), @ptrToInt(newpath));
328}328}
329329
330pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {330pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
331 if (@hasDecl(@This(), "SYS_pread64")) {331 if (@hasField(SYS, "pread64")) {
332 if (require_aligned_register_pair) {332 if (require_aligned_register_pair) {
333 return syscall6(333 return syscall6(
334 SYS_pread64,334 .pread64,
335 @bitCast(usize, @as(isize, fd)),335 @bitCast(usize, @as(isize, fd)),
336 @ptrToInt(buf),336 @ptrToInt(buf),
337 count,337 count,
...@@ -341,7 +341,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {...@@ -341,7 +341,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
341 );341 );
342 } else {342 } else {
343 return syscall5(343 return syscall5(
344 SYS_pread64,344 .pread64,
345 @bitCast(usize, @as(isize, fd)),345 @bitCast(usize, @as(isize, fd)),
346 @ptrToInt(buf),346 @ptrToInt(buf),
347 count,347 count,
...@@ -351,7 +351,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {...@@ -351,7 +351,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
351 }351 }
352 } else {352 } else {
353 return syscall4(353 return syscall4(
354 SYS_pread,354 .pread,
355 @bitCast(usize, @as(isize, fd)),355 @bitCast(usize, @as(isize, fd)),
356 @ptrToInt(buf),356 @ptrToInt(buf),
357 count,357 count,
...@@ -361,40 +361,40 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {...@@ -361,40 +361,40 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
361}361}
362362
363pub fn access(path: [*:0]const u8, mode: u32) usize {363pub fn access(path: [*:0]const u8, mode: u32) usize {
364 if (@hasDecl(@This(), "SYS_access")) {364 if (@hasField(SYS, "access")) {
365 return syscall2(SYS_access, @ptrToInt(path), mode);365 return syscall2(.access, @ptrToInt(path), mode);
366 } else {366 } else {
367 return syscall4(SYS_faccessat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode, 0);367 return syscall4(.faccessat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), mode, 0);
368 }368 }
369}369}
370370
371pub fn faccessat(dirfd: i32, path: [*:0]const u8, mode: u32, flags: u32) usize {371pub fn faccessat(dirfd: i32, path: [*:0]const u8, mode: u32, flags: u32) usize {
372 return syscall4(SYS_faccessat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, flags);372 return syscall4(.faccessat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, flags);
373}373}
374374
375pub fn pipe(fd: *[2]i32) usize {375pub fn pipe(fd: *[2]i32) usize {
376 if (comptime builtin.arch.isMIPS()) {376 if (comptime builtin.arch.isMIPS()) {
377 return syscall_pipe(fd);377 return syscall_pipe(fd);
378 } else if (@hasDecl(@This(), "SYS_pipe")) {378 } else if (@hasField(SYS, "pipe")) {
379 return syscall1(SYS_pipe, @ptrToInt(fd));379 return syscall1(.pipe, @ptrToInt(fd));
380 } else {380 } else {
381 return syscall2(SYS_pipe2, @ptrToInt(fd), 0);381 return syscall2(.pipe2, @ptrToInt(fd), 0);
382 }382 }
383}383}
384384
385pub fn pipe2(fd: *[2]i32, flags: u32) usize {385pub fn pipe2(fd: *[2]i32, flags: u32) usize {
386 return syscall2(SYS_pipe2, @ptrToInt(fd), flags);386 return syscall2(.pipe2, @ptrToInt(fd), flags);
387}387}
388388
389pub fn write(fd: i32, buf: [*]const u8, count: usize) usize {389pub fn write(fd: i32, buf: [*]const u8, count: usize) usize {
390 return syscall3(SYS_write, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count);390 return syscall3(.write, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count);
391}391}
392392
393pub fn ftruncate(fd: i32, length: u64) usize {393pub fn ftruncate(fd: i32, length: u64) usize {
394 if (@hasDecl(@This(), "SYS_ftruncate64")) {394 if (@hasField(SYS, "ftruncate64")) {
395 if (require_aligned_register_pair) {395 if (require_aligned_register_pair) {
396 return syscall4(396 return syscall4(
397 SYS_ftruncate64,397 .ftruncate64,
398 @bitCast(usize, @as(isize, fd)),398 @bitCast(usize, @as(isize, fd)),
399 0,399 0,
400 @truncate(usize, length),400 @truncate(usize, length),
...@@ -402,7 +402,7 @@ pub fn ftruncate(fd: i32, length: u64) usize {...@@ -402,7 +402,7 @@ pub fn ftruncate(fd: i32, length: u64) usize {
402 );402 );
403 } else {403 } else {
404 return syscall3(404 return syscall3(
405 SYS_ftruncate64,405 .ftruncate64,
406 @bitCast(usize, @as(isize, fd)),406 @bitCast(usize, @as(isize, fd)),
407 @truncate(usize, length),407 @truncate(usize, length),
408 @truncate(usize, length >> 32),408 @truncate(usize, length >> 32),
...@@ -410,7 +410,7 @@ pub fn ftruncate(fd: i32, length: u64) usize {...@@ -410,7 +410,7 @@ pub fn ftruncate(fd: i32, length: u64) usize {
410 }410 }
411 } else {411 } else {
412 return syscall2(412 return syscall2(
413 SYS_ftruncate,413 .ftruncate,
414 @bitCast(usize, @as(isize, fd)),414 @bitCast(usize, @as(isize, fd)),
415 @truncate(usize, length),415 @truncate(usize, length),
416 );416 );
...@@ -418,10 +418,10 @@ pub fn ftruncate(fd: i32, length: u64) usize {...@@ -418,10 +418,10 @@ pub fn ftruncate(fd: i32, length: u64) usize {
418}418}
419419
420pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {420pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
421 if (@hasDecl(@This(), "SYS_pwrite64")) {421 if (@hasField(SYS, "pwrite64")) {
422 if (require_aligned_register_pair) {422 if (require_aligned_register_pair) {
423 return syscall6(423 return syscall6(
424 SYS_pwrite64,424 .pwrite64,
425 @bitCast(usize, @as(isize, fd)),425 @bitCast(usize, @as(isize, fd)),
426 @ptrToInt(buf),426 @ptrToInt(buf),
427 count,427 count,
...@@ -431,7 +431,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {...@@ -431,7 +431,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
431 );431 );
432 } else {432 } else {
433 return syscall5(433 return syscall5(
434 SYS_pwrite64,434 .pwrite64,
435 @bitCast(usize, @as(isize, fd)),435 @bitCast(usize, @as(isize, fd)),
436 @ptrToInt(buf),436 @ptrToInt(buf),
437 count,437 count,
...@@ -441,7 +441,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {...@@ -441,7 +441,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
441 }441 }
442 } else {442 } else {
443 return syscall4(443 return syscall4(
444 SYS_pwrite,444 .pwrite,
445 @bitCast(usize, @as(isize, fd)),445 @bitCast(usize, @as(isize, fd)),
446 @ptrToInt(buf),446 @ptrToInt(buf),
447 count,447 count,
...@@ -451,19 +451,19 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {...@@ -451,19 +451,19 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
451}451}
452452
453pub fn rename(old: [*:0]const u8, new: [*:0]const u8) usize {453pub fn rename(old: [*:0]const u8, new: [*:0]const u8) usize {
454 if (@hasDecl(@This(), "SYS_rename")) {454 if (@hasField(SYS, "rename")) {
455 return syscall2(SYS_rename, @ptrToInt(old), @ptrToInt(new));455 return syscall2(.rename, @ptrToInt(old), @ptrToInt(new));
456 } else if (@hasDecl(@This(), "SYS_renameat")) {456 } else if (@hasField(SYS, "renameat")) {
457 return syscall4(SYS_renameat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new));457 return syscall4(.renameat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new));
458 } else {458 } else {
459 return syscall5(SYS_renameat2, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new), 0);459 return syscall5(.renameat2, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new), 0);
460 }460 }
461}461}
462462
463pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const u8) usize {463pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const u8) usize {
464 if (@hasDecl(@This(), "SYS_renameat")) {464 if (@hasField(SYS, "renameat")) {
465 return syscall4(465 return syscall4(
466 SYS_renameat,466 .renameat,
467 @bitCast(usize, @as(isize, oldfd)),467 @bitCast(usize, @as(isize, oldfd)),
468 @ptrToInt(oldpath),468 @ptrToInt(oldpath),
469 @bitCast(usize, @as(isize, newfd)),469 @bitCast(usize, @as(isize, newfd)),
...@@ -471,7 +471,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const...@@ -471,7 +471,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const
471 );471 );
472 } else {472 } else {
473 return syscall5(473 return syscall5(
474 SYS_renameat2,474 .renameat2,
475 @bitCast(usize, @as(isize, oldfd)),475 @bitCast(usize, @as(isize, oldfd)),
476 @ptrToInt(oldpath),476 @ptrToInt(oldpath),
477 @bitCast(usize, @as(isize, newfd)),477 @bitCast(usize, @as(isize, newfd)),
...@@ -483,7 +483,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const...@@ -483,7 +483,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const
483483
484pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]const u8, flags: u32) usize {484pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]const u8, flags: u32) usize {
485 return syscall5(485 return syscall5(
486 SYS_renameat2,486 .renameat2,
487 @bitCast(usize, @as(isize, oldfd)),487 @bitCast(usize, @as(isize, oldfd)),
488 @ptrToInt(oldpath),488 @ptrToInt(oldpath),
489 @bitCast(usize, @as(isize, newfd)),489 @bitCast(usize, @as(isize, newfd)),
...@@ -493,11 +493,11 @@ pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]c...@@ -493,11 +493,11 @@ pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]c
493}493}
494494
495pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize {495pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize {
496 if (@hasDecl(@This(), "SYS_open")) {496 if (@hasField(SYS, "open")) {
497 return syscall3(SYS_open, @ptrToInt(path), flags, perm);497 return syscall3(.open, @ptrToInt(path), flags, perm);
498 } else {498 } else {
499 return syscall4(499 return syscall4(
500 SYS_openat,500 .openat,
501 @bitCast(usize, @as(isize, AT_FDCWD)),501 @bitCast(usize, @as(isize, AT_FDCWD)),
502 @ptrToInt(path),502 @ptrToInt(path),
503 flags,503 flags,
...@@ -507,32 +507,32 @@ pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize {...@@ -507,32 +507,32 @@ pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize {
507}507}
508508
509pub fn create(path: [*:0]const u8, perm: usize) usize {509pub fn create(path: [*:0]const u8, perm: usize) usize {
510 return syscall2(SYS_creat, @ptrToInt(path), perm);510 return syscall2(.creat, @ptrToInt(path), perm);
511}511}
512512
513pub fn openat(dirfd: i32, path: [*:0]const u8, flags: u32, mode: usize) usize {513pub fn openat(dirfd: i32, path: [*:0]const u8, flags: u32, mode: usize) usize {
514 // dirfd could be negative, for example AT_FDCWD is -100514 // dirfd could be negative, for example AT_FDCWD is -100
515 return syscall4(SYS_openat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, mode);515 return syscall4(.openat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, mode);
516}516}
517517
518/// See also `clone` (from the arch-specific include)518/// See also `clone` (from the arch-specific include)
519pub fn clone5(flags: usize, child_stack_ptr: usize, parent_tid: *i32, child_tid: *i32, newtls: usize) usize {519pub fn clone5(flags: usize, child_stack_ptr: usize, parent_tid: *i32, child_tid: *i32, newtls: usize) usize {
520 return syscall5(SYS_clone, flags, child_stack_ptr, @ptrToInt(parent_tid), @ptrToInt(child_tid), newtls);520 return syscall5(.clone, flags, child_stack_ptr, @ptrToInt(parent_tid), @ptrToInt(child_tid), newtls);
521}521}
522522
523/// See also `clone` (from the arch-specific include)523/// See also `clone` (from the arch-specific include)
524pub fn clone2(flags: u32, child_stack_ptr: usize) usize {524pub fn clone2(flags: u32, child_stack_ptr: usize) usize {
525 return syscall2(SYS_clone, flags, child_stack_ptr);525 return syscall2(.clone, flags, child_stack_ptr);
526}526}
527527
528pub fn close(fd: i32) usize {528pub fn close(fd: i32) usize {
529 return syscall1(SYS_close, @bitCast(usize, @as(isize, fd)));529 return syscall1(.close, @bitCast(usize, @as(isize, fd)));
530}530}
531531
532/// Can only be called on 32 bit systems. For 64 bit see `lseek`.532/// Can only be called on 32 bit systems. For 64 bit see `lseek`.
533pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize {533pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize {
534 return syscall5(534 return syscall5(
535 SYS__llseek,535 ._llseek,
536 @bitCast(usize, @as(isize, fd)),536 @bitCast(usize, @as(isize, fd)),
537 @truncate(usize, offset >> 32),537 @truncate(usize, offset >> 32),
538 @truncate(usize, offset),538 @truncate(usize, offset),
...@@ -543,53 +543,53 @@ pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize {...@@ -543,53 +543,53 @@ pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize {
543543
544/// Can only be called on 64 bit systems. For 32 bit see `llseek`.544/// Can only be called on 64 bit systems. For 32 bit see `llseek`.
545pub fn lseek(fd: i32, offset: i64, whence: usize) usize {545pub fn lseek(fd: i32, offset: i64, whence: usize) usize {
546 return syscall3(SYS_lseek, @bitCast(usize, @as(isize, fd)), @bitCast(usize, offset), whence);546 return syscall3(.lseek, @bitCast(usize, @as(isize, fd)), @bitCast(usize, offset), whence);
547}547}
548548
549pub fn exit(status: i32) noreturn {549pub fn exit(status: i32) noreturn {
550 _ = syscall1(SYS_exit, @bitCast(usize, @as(isize, status)));550 _ = syscall1(.exit, @bitCast(usize, @as(isize, status)));
551 unreachable;551 unreachable;
552}552}
553553
554pub fn exit_group(status: i32) noreturn {554pub fn exit_group(status: i32) noreturn {
555 _ = syscall1(SYS_exit_group, @bitCast(usize, @as(isize, status)));555 _ = syscall1(.exit_group, @bitCast(usize, @as(isize, status)));
556 unreachable;556 unreachable;
557}557}
558558
559pub fn getrandom(buf: [*]u8, count: usize, flags: u32) usize {559pub fn getrandom(buf: [*]u8, count: usize, flags: u32) usize {
560 return syscall3(SYS_getrandom, @ptrToInt(buf), count, flags);560 return syscall3(.getrandom, @ptrToInt(buf), count, flags);
561}561}
562562
563pub fn kill(pid: pid_t, sig: i32) usize {563pub fn kill(pid: pid_t, sig: i32) usize {
564 return syscall2(SYS_kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig)));564 return syscall2(.kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig)));
565}565}
566566
567pub fn tkill(tid: pid_t, sig: i32) usize {567pub fn tkill(tid: pid_t, sig: i32) usize {
568 return syscall2(SYS_tkill, @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig)));568 return syscall2(.tkill, @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig)));
569}569}
570570
571pub fn tgkill(tgid: pid_t, tid: pid_t, sig: i32) usize {571pub fn tgkill(tgid: pid_t, tid: pid_t, sig: i32) usize {
572 return syscall2(SYS_tgkill, @bitCast(usize, @as(isize, tgid)), @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig)));572 return syscall2(.tgkill, @bitCast(usize, @as(isize, tgid)), @bitCast(usize, @as(isize, tid)), @bitCast(usize, @as(isize, sig)));
573}573}
574574
575pub fn unlink(path: [*:0]const u8) usize {575pub fn unlink(path: [*:0]const u8) usize {
576 if (@hasDecl(@This(), "SYS_unlink")) {576 if (@hasField(SYS, "unlink")) {
577 return syscall1(SYS_unlink, @ptrToInt(path));577 return syscall1(.unlink, @ptrToInt(path));
578 } else {578 } else {
579 return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), 0);579 return syscall3(.unlinkat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(path), 0);
580 }580 }
581}581}
582582
583pub fn unlinkat(dirfd: i32, path: [*:0]const u8, flags: u32) usize {583pub fn unlinkat(dirfd: i32, path: [*:0]const u8, flags: u32) usize {
584 return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags);584 return syscall3(.unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags);
585}585}
586586
587pub fn waitpid(pid: pid_t, status: *u32, flags: u32) usize {587pub fn waitpid(pid: pid_t, status: *u32, flags: u32) usize {
588 return syscall4(SYS_wait4, @bitCast(usize, @as(isize, pid)), @ptrToInt(status), flags, 0);588 return syscall4(.wait4, @bitCast(usize, @as(isize, pid)), @ptrToInt(status), flags, 0);
589}589}
590590
591pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize {591pub fn fcntl(fd: fd_t, cmd: i32, arg: usize) usize {
592 return syscall3(SYS_fcntl, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, cmd)), arg);592 return syscall3(.fcntl, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, cmd)), arg);
593}593}
594594
595var vdso_clock_gettime = @ptrCast(?*const c_void, init_vdso_clock_gettime);595var vdso_clock_gettime = @ptrCast(?*const c_void, init_vdso_clock_gettime);
...@@ -609,7 +609,7 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize {...@@ -609,7 +609,7 @@ pub fn clock_gettime(clk_id: i32, tp: *timespec) usize {
609 }609 }
610 }610 }
611 }611 }
612 return syscall2(SYS_clock_gettime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp));612 return syscall2(.clock_gettime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp));
613}613}
614614
615fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize {615fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize {
...@@ -626,86 +626,86 @@ fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize {...@@ -626,86 +626,86 @@ fn init_vdso_clock_gettime(clk: i32, ts: *timespec) callconv(.C) usize {
626}626}
627627
628pub fn clock_getres(clk_id: i32, tp: *timespec) usize {628pub fn clock_getres(clk_id: i32, tp: *timespec) usize {
629 return syscall2(SYS_clock_getres, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp));629 return syscall2(.clock_getres, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp));
630}630}
631631
632pub fn clock_settime(clk_id: i32, tp: *const timespec) usize {632pub fn clock_settime(clk_id: i32, tp: *const timespec) usize {
633 return syscall2(SYS_clock_settime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp));633 return syscall2(.clock_settime, @bitCast(usize, @as(isize, clk_id)), @ptrToInt(tp));
634}634}
635635
636pub fn gettimeofday(tv: *timeval, tz: *timezone) usize {636pub fn gettimeofday(tv: *timeval, tz: *timezone) usize {
637 return syscall2(SYS_gettimeofday, @ptrToInt(tv), @ptrToInt(tz));637 return syscall2(.gettimeofday, @ptrToInt(tv), @ptrToInt(tz));
638}638}
639639
640pub fn settimeofday(tv: *const timeval, tz: *const timezone) usize {640pub fn settimeofday(tv: *const timeval, tz: *const timezone) usize {
641 return syscall2(SYS_settimeofday, @ptrToInt(tv), @ptrToInt(tz));641 return syscall2(.settimeofday, @ptrToInt(tv), @ptrToInt(tz));
642}642}
643643
644pub fn nanosleep(req: *const timespec, rem: ?*timespec) usize {644pub fn nanosleep(req: *const timespec, rem: ?*timespec) usize {
645 return syscall2(SYS_nanosleep, @ptrToInt(req), @ptrToInt(rem));645 return syscall2(.nanosleep, @ptrToInt(req), @ptrToInt(rem));
646}646}
647647
648pub fn setuid(uid: u32) usize {648pub fn setuid(uid: u32) usize {
649 if (@hasDecl(@This(), "SYS_setuid32")) {649 if (@hasField(SYS, "setuid32")) {
650 return syscall1(SYS_setuid32, uid);650 return syscall1(.setuid32, uid);
651 } else {651 } else {
652 return syscall1(SYS_setuid, uid);652 return syscall1(.setuid, uid);
653 }653 }
654}654}
655655
656pub fn setgid(gid: u32) usize {656pub fn setgid(gid: u32) usize {
657 if (@hasDecl(@This(), "SYS_setgid32")) {657 if (@hasField(SYS, "setgid32")) {
658 return syscall1(SYS_setgid32, gid);658 return syscall1(.setgid32, gid);
659 } else {659 } else {
660 return syscall1(SYS_setgid, gid);660 return syscall1(.setgid, gid);
661 }661 }
662}662}
663663
664pub fn setreuid(ruid: u32, euid: u32) usize {664pub fn setreuid(ruid: u32, euid: u32) usize {
665 if (@hasDecl(@This(), "SYS_setreuid32")) {665 if (@hasField(SYS, "setreuid32")) {
666 return syscall2(SYS_setreuid32, ruid, euid);666 return syscall2(.setreuid32, ruid, euid);
667 } else {667 } else {
668 return syscall2(SYS_setreuid, ruid, euid);668 return syscall2(.setreuid, ruid, euid);
669 }669 }
670}670}
671671
672pub fn setregid(rgid: u32, egid: u32) usize {672pub fn setregid(rgid: u32, egid: u32) usize {
673 if (@hasDecl(@This(), "SYS_setregid32")) {673 if (@hasField(SYS, "setregid32")) {
674 return syscall2(SYS_setregid32, rgid, egid);674 return syscall2(.setregid32, rgid, egid);
675 } else {675 } else {
676 return syscall2(SYS_setregid, rgid, egid);676 return syscall2(.setregid, rgid, egid);
677 }677 }
678}678}
679679
680pub fn getuid() u32 {680pub fn getuid() u32 {
681 if (@hasDecl(@This(), "SYS_getuid32")) {681 if (@hasField(SYS, "getuid32")) {
682 return @as(u32, syscall0(SYS_getuid32));682 return @as(u32, syscall0(.getuid32));
683 } else {683 } else {
684 return @as(u32, syscall0(SYS_getuid));684 return @as(u32, syscall0(.getuid));
685 }685 }
686}686}
687687
688pub fn getgid() u32 {688pub fn getgid() u32 {
689 if (@hasDecl(@This(), "SYS_getgid32")) {689 if (@hasField(SYS, "getgid32")) {
690 return @as(u32, syscall0(SYS_getgid32));690 return @as(u32, syscall0(.getgid32));
691 } else {691 } else {
692 return @as(u32, syscall0(SYS_getgid));692 return @as(u32, syscall0(.getgid));
693 }693 }
694}694}
695695
696pub fn geteuid() u32 {696pub fn geteuid() u32 {
697 if (@hasDecl(@This(), "SYS_geteuid32")) {697 if (@hasField(SYS, "geteuid32")) {
698 return @as(u32, syscall0(SYS_geteuid32));698 return @as(u32, syscall0(.geteuid32));
699 } else {699 } else {
700 return @as(u32, syscall0(SYS_geteuid));700 return @as(u32, syscall0(.geteuid));
701 }701 }
702}702}
703703
704pub fn getegid() u32 {704pub fn getegid() u32 {
705 if (@hasDecl(@This(), "SYS_getegid32")) {705 if (@hasField(SYS, "getegid32")) {
706 return @as(u32, syscall0(SYS_getegid32));706 return @as(u32, syscall0(.getegid32));
707 } else {707 } else {
708 return @as(u32, syscall0(SYS_getegid));708 return @as(u32, syscall0(.getegid));
709 }709 }
710}710}
711711
...@@ -718,63 +718,63 @@ pub fn setegid(egid: u32) usize {...@@ -718,63 +718,63 @@ pub fn setegid(egid: u32) usize {
718}718}
719719
720pub fn getresuid(ruid: *u32, euid: *u32, suid: *u32) usize {720pub fn getresuid(ruid: *u32, euid: *u32, suid: *u32) usize {
721 if (@hasDecl(@This(), "SYS_getresuid32")) {721 if (@hasField(SYS, "getresuid32")) {
722 return syscall3(SYS_getresuid32, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));722 return syscall3(.getresuid32, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));
723 } else {723 } else {
724 return syscall3(SYS_getresuid, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));724 return syscall3(.getresuid, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));
725 }725 }
726}726}
727727
728pub fn getresgid(rgid: *u32, egid: *u32, sgid: *u32) usize {728pub fn getresgid(rgid: *u32, egid: *u32, sgid: *u32) usize {
729 if (@hasDecl(@This(), "SYS_getresgid32")) {729 if (@hasField(SYS, "getresgid32")) {
730 return syscall3(SYS_getresgid32, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));730 return syscall3(.getresgid32, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));
731 } else {731 } else {
732 return syscall3(SYS_getresgid, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));732 return syscall3(.getresgid, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));
733 }733 }
734}734}
735735
736pub fn setresuid(ruid: u32, euid: u32, suid: u32) usize {736pub fn setresuid(ruid: u32, euid: u32, suid: u32) usize {
737 if (@hasDecl(@This(), "SYS_setresuid32")) {737 if (@hasField(SYS, "setresuid32")) {
738 return syscall3(SYS_setresuid32, ruid, euid, suid);738 return syscall3(.setresuid32, ruid, euid, suid);
739 } else {739 } else {
740 return syscall3(SYS_setresuid, ruid, euid, suid);740 return syscall3(.setresuid, ruid, euid, suid);
741 }741 }
742}742}
743743
744pub fn setresgid(rgid: u32, egid: u32, sgid: u32) usize {744pub fn setresgid(rgid: u32, egid: u32, sgid: u32) usize {
745 if (@hasDecl(@This(), "SYS_setresgid32")) {745 if (@hasField(SYS, "setresgid32")) {
746 return syscall3(SYS_setresgid32, rgid, egid, sgid);746 return syscall3(.setresgid32, rgid, egid, sgid);
747 } else {747 } else {
748 return syscall3(SYS_setresgid, rgid, egid, sgid);748 return syscall3(.setresgid, rgid, egid, sgid);
749 }749 }
750}750}
751751
752pub fn getgroups(size: usize, list: *u32) usize {752pub fn getgroups(size: usize, list: *u32) usize {
753 if (@hasDecl(@This(), "SYS_getgroups32")) {753 if (@hasField(SYS, "getgroups32")) {
754 return syscall2(SYS_getgroups32, size, @ptrToInt(list));754 return syscall2(.getgroups32, size, @ptrToInt(list));
755 } else {755 } else {
756 return syscall2(SYS_getgroups, size, @ptrToInt(list));756 return syscall2(.getgroups, size, @ptrToInt(list));
757 }757 }
758}758}
759759
760pub fn setgroups(size: usize, list: *const u32) usize {760pub fn setgroups(size: usize, list: *const u32) usize {
761 if (@hasDecl(@This(), "SYS_setgroups32")) {761 if (@hasField(SYS, "setgroups32")) {
762 return syscall2(SYS_setgroups32, size, @ptrToInt(list));762 return syscall2(.setgroups32, size, @ptrToInt(list));
763 } else {763 } else {
764 return syscall2(SYS_setgroups, size, @ptrToInt(list));764 return syscall2(.setgroups, size, @ptrToInt(list));
765 }765 }
766}766}
767767
768pub fn getpid() pid_t {768pub fn getpid() pid_t {
769 return @bitCast(pid_t, @truncate(u32, syscall0(SYS_getpid)));769 return @bitCast(pid_t, @truncate(u32, syscall0(.getpid)));
770}770}
771771
772pub fn gettid() pid_t {772pub fn gettid() pid_t {
773 return @bitCast(pid_t, @truncate(u32, syscall0(SYS_gettid)));773 return @bitCast(pid_t, @truncate(u32, syscall0(.gettid)));
774}774}
775775
776pub fn sigprocmask(flags: u32, noalias set: ?*const sigset_t, noalias oldset: ?*sigset_t) usize {776pub fn sigprocmask(flags: u32, noalias set: ?*const sigset_t, noalias oldset: ?*sigset_t) usize {
777 return syscall4(SYS_rt_sigprocmask, flags, @ptrToInt(set), @ptrToInt(oldset), NSIG / 8);777 return syscall4(.rt_sigprocmask, flags, @ptrToInt(set), @ptrToInt(oldset), NSIG / 8);
778}778}
779779
780pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigaction) usize {780pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigaction) usize {
...@@ -792,7 +792,7 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti...@@ -792,7 +792,7 @@ pub fn sigaction(sig: u6, noalias act: *const Sigaction, noalias oact: ?*Sigacti
792 var ksa_old: k_sigaction = undefined;792 var ksa_old: k_sigaction = undefined;
793 const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask));793 const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask));
794 @memcpy(@ptrCast([*]u8, &ksa.mask), @ptrCast([*]const u8, &act.mask), ksa_mask_size);794 @memcpy(@ptrCast([*]u8, &ksa.mask), @ptrCast([*]const u8, &act.mask), ksa_mask_size);
795 const result = syscall4(SYS_rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size);795 const result = syscall4(.rt_sigaction, sig, @ptrToInt(&ksa), @ptrToInt(&ksa_old), ksa_mask_size);
796 const err = getErrno(result);796 const err = getErrno(result);
797 if (err != 0) {797 if (err != 0) {
798 return result;798 return result;
...@@ -819,42 +819,42 @@ pub fn getsockname(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) us...@@ -819,42 +819,42 @@ pub fn getsockname(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) us
819 if (builtin.arch == .i386) {819 if (builtin.arch == .i386) {
820 return socketcall(SC_getsockname, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });820 return socketcall(SC_getsockname, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });
821 }821 }
822 return syscall3(SYS_getsockname, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));822 return syscall3(.getsockname, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));
823}823}
824824
825pub fn getpeername(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {825pub fn getpeername(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {
826 if (builtin.arch == .i386) {826 if (builtin.arch == .i386) {
827 return socketcall(SC_getpeername, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });827 return socketcall(SC_getpeername, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });
828 }828 }
829 return syscall3(SYS_getpeername, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));829 return syscall3(.getpeername, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len));
830}830}
831831
832pub fn socket(domain: u32, socket_type: u32, protocol: u32) usize {832pub fn socket(domain: u32, socket_type: u32, protocol: u32) usize {
833 if (builtin.arch == .i386) {833 if (builtin.arch == .i386) {
834 return socketcall(SC_socket, &[3]usize{ domain, socket_type, protocol });834 return socketcall(SC_socket, &[3]usize{ domain, socket_type, protocol });
835 }835 }
836 return syscall3(SYS_socket, domain, socket_type, protocol);836 return syscall3(.socket, domain, socket_type, protocol);
837}837}
838838
839pub fn setsockopt(fd: i32, level: u32, optname: u32, optval: [*]const u8, optlen: socklen_t) usize {839pub fn setsockopt(fd: i32, level: u32, optname: u32, optval: [*]const u8, optlen: socklen_t) usize {
840 if (builtin.arch == .i386) {840 if (builtin.arch == .i386) {
841 return socketcall(SC_setsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen) });841 return socketcall(SC_setsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen) });
842 }842 }
843 return syscall5(SYS_setsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen));843 return syscall5(.setsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen));
844}844}
845845
846pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noalias optlen: *socklen_t) usize {846pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noalias optlen: *socklen_t) usize {
847 if (builtin.arch == .i386) {847 if (builtin.arch == .i386) {
848 return socketcall(SC_getsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen) });848 return socketcall(SC_getsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen) });
849 }849 }
850 return syscall5(SYS_getsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen));850 return syscall5(.getsockopt, @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen));
851}851}
852852
853pub fn sendmsg(fd: i32, msg: *msghdr_const, flags: u32) usize {853pub fn sendmsg(fd: i32, msg: *msghdr_const, flags: u32) usize {
854 if (builtin.arch == .i386) {854 if (builtin.arch == .i386) {
855 return socketcall(SC_sendmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags });855 return socketcall(SC_sendmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags });
856 }856 }
857 return syscall3(SYS_sendmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags);857 return syscall3(.sendmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags);
858}858}
859859
860pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize {860pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize {
...@@ -872,7 +872,7 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize...@@ -872,7 +872,7 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize
872 // batch-send all messages up to the current message872 // batch-send all messages up to the current message
873 if (next_unsent < i) {873 if (next_unsent < i) {
874 const batch_size = i - next_unsent;874 const batch_size = i - next_unsent;
875 const r = syscall4(SYS_sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags);875 const r = syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags);
876 if (getErrno(r) != 0) return next_unsent;876 if (getErrno(r) != 0) return next_unsent;
877 if (r < batch_size) return next_unsent + r;877 if (r < batch_size) return next_unsent + r;
878 }878 }
...@@ -888,68 +888,68 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize...@@ -888,68 +888,68 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize
888 }888 }
889 if (next_unsent < kvlen or next_unsent == 0) { // want to make sure at least one syscall occurs (e.g. to trigger MSG_EOR)889 if (next_unsent < kvlen or next_unsent == 0) { // want to make sure at least one syscall occurs (e.g. to trigger MSG_EOR)
890 const batch_size = kvlen - next_unsent;890 const batch_size = kvlen - next_unsent;
891 const r = syscall4(SYS_sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags);891 const r = syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(&msgvec[next_unsent]), batch_size, flags);
892 if (getErrno(r) != 0) return r;892 if (getErrno(r) != 0) return r;
893 return next_unsent + r;893 return next_unsent + r;
894 }894 }
895 return kvlen;895 return kvlen;
896 }896 }
897 return syscall4(SYS_sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msgvec), vlen, flags);897 return syscall4(.sendmmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msgvec), vlen, flags);
898}898}
899899
900pub fn connect(fd: i32, addr: *const c_void, len: socklen_t) usize {900pub fn connect(fd: i32, addr: *const c_void, len: socklen_t) usize {
901 if (builtin.arch == .i386) {901 if (builtin.arch == .i386) {
902 return socketcall(SC_connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len });902 return socketcall(SC_connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len });
903 }903 }
904 return syscall3(SYS_connect, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len);904 return syscall3(.connect, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len);
905}905}
906906
907pub fn recvmsg(fd: i32, msg: *msghdr, flags: u32) usize {907pub fn recvmsg(fd: i32, msg: *msghdr, flags: u32) usize {
908 if (builtin.arch == .i386) {908 if (builtin.arch == .i386) {
909 return socketcall(SC_recvmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags });909 return socketcall(SC_recvmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags });
910 }910 }
911 return syscall3(SYS_recvmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags);911 return syscall3(.recvmsg, @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags);
912}912}
913913
914pub fn recvfrom(fd: i32, noalias buf: [*]u8, len: usize, flags: u32, noalias addr: ?*sockaddr, noalias alen: ?*socklen_t) usize {914pub fn recvfrom(fd: i32, noalias buf: [*]u8, len: usize, flags: u32, noalias addr: ?*sockaddr, noalias alen: ?*socklen_t) usize {
915 if (builtin.arch == .i386) {915 if (builtin.arch == .i386) {
916 return socketcall(SC_recvfrom, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen) });916 return socketcall(SC_recvfrom, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen) });
917 }917 }
918 return syscall6(SYS_recvfrom, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen));918 return syscall6(.recvfrom, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen));
919}919}
920920
921pub fn shutdown(fd: i32, how: i32) usize {921pub fn shutdown(fd: i32, how: i32) usize {
922 if (builtin.arch == .i386) {922 if (builtin.arch == .i386) {
923 return socketcall(SC_shutdown, &[2]usize{ @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)) });923 return socketcall(SC_shutdown, &[2]usize{ @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)) });
924 }924 }
925 return syscall2(SYS_shutdown, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)));925 return syscall2(.shutdown, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)));
926}926}
927927
928pub fn bind(fd: i32, addr: *const sockaddr, len: socklen_t) usize {928pub fn bind(fd: i32, addr: *const sockaddr, len: socklen_t) usize {
929 if (builtin.arch == .i386) {929 if (builtin.arch == .i386) {
930 return socketcall(SC_bind, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len) });930 return socketcall(SC_bind, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len) });
931 }931 }
932 return syscall3(SYS_bind, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len));932 return syscall3(.bind, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len));
933}933}
934934
935pub fn listen(fd: i32, backlog: u32) usize {935pub fn listen(fd: i32, backlog: u32) usize {
936 if (builtin.arch == .i386) {936 if (builtin.arch == .i386) {
937 return socketcall(SC_listen, &[2]usize{ @bitCast(usize, @as(isize, fd)), backlog });937 return socketcall(SC_listen, &[2]usize{ @bitCast(usize, @as(isize, fd)), backlog });
938 }938 }
939 return syscall2(SYS_listen, @bitCast(usize, @as(isize, fd)), backlog);939 return syscall2(.listen, @bitCast(usize, @as(isize, fd)), backlog);
940}940}
941941
942pub fn sendto(fd: i32, buf: [*]const u8, len: usize, flags: u32, addr: ?*const sockaddr, alen: socklen_t) usize {942pub fn sendto(fd: i32, buf: [*]const u8, len: usize, flags: u32, addr: ?*const sockaddr, alen: socklen_t) usize {
943 if (builtin.arch == .i386) {943 if (builtin.arch == .i386) {
944 return socketcall(SC_sendto, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen) });944 return socketcall(SC_sendto, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen) });
945 }945 }
946 return syscall6(SYS_sendto, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen));946 return syscall6(.sendto, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen));
947}947}
948948
949pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {949pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {
950 if (@hasDecl(@This(), "SYS_sendfile64")) {950 if (@hasField(SYS, "sendfile64")) {
951 return syscall4(951 return syscall4(
952 SYS_sendfile64,952 .sendfile64,
953 @bitCast(usize, @as(isize, outfd)),953 @bitCast(usize, @as(isize, outfd)),
954 @bitCast(usize, @as(isize, infd)),954 @bitCast(usize, @as(isize, infd)),
955 @ptrToInt(offset),955 @ptrToInt(offset),
...@@ -957,7 +957,7 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {...@@ -957,7 +957,7 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {
957 );957 );
958 } else {958 } else {
959 return syscall4(959 return syscall4(
960 SYS_sendfile,960 .sendfile,
961 @bitCast(usize, @as(isize, outfd)),961 @bitCast(usize, @as(isize, outfd)),
962 @bitCast(usize, @as(isize, infd)),962 @bitCast(usize, @as(isize, infd)),
963 @ptrToInt(offset),963 @ptrToInt(offset),
...@@ -970,7 +970,7 @@ pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: [2]i32) usiz...@@ -970,7 +970,7 @@ pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: [2]i32) usiz
970 if (builtin.arch == .i386) {970 if (builtin.arch == .i386) {
971 return socketcall(SC_socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]) });971 return socketcall(SC_socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]) });
972 }972 }
973 return syscall4(SYS_socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]));973 return syscall4(.socketpair, @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]));
974}974}
975975
976pub fn accept(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {976pub fn accept(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {
...@@ -984,45 +984,45 @@ pub fn accept4(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t, flags:...@@ -984,45 +984,45 @@ pub fn accept4(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t, flags:
984 if (builtin.arch == .i386) {984 if (builtin.arch == .i386) {
985 return socketcall(SC_accept4, &[4]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags });985 return socketcall(SC_accept4, &[4]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags });
986 }986 }
987 return syscall4(SYS_accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags);987 return syscall4(.accept4, @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags);
988}988}
989989
990pub fn fstat(fd: i32, stat_buf: *Stat) usize {990pub fn fstat(fd: i32, stat_buf: *Stat) usize {
991 if (@hasDecl(@This(), "SYS_fstat64")) {991 if (@hasField(SYS, "fstat64")) {
992 return syscall2(SYS_fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));992 return syscall2(.fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));
993 } else {993 } else {
994 return syscall2(SYS_fstat, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));994 return syscall2(.fstat, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));
995 }995 }
996}996}
997997
998pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize {998pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize {
999 if (@hasDecl(@This(), "SYS_stat64")) {999 if (@hasField(SYS, "stat64")) {
1000 return syscall2(SYS_stat64, @ptrToInt(pathname), @ptrToInt(statbuf));1000 return syscall2(.stat64, @ptrToInt(pathname), @ptrToInt(statbuf));
1001 } else {1001 } else {
1002 return syscall2(SYS_stat, @ptrToInt(pathname), @ptrToInt(statbuf));1002 return syscall2(.stat, @ptrToInt(pathname), @ptrToInt(statbuf));
1003 }1003 }
1004}1004}
10051005
1006pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize {1006pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize {
1007 if (@hasDecl(@This(), "SYS_lstat64")) {1007 if (@hasField(SYS, "lstat64")) {
1008 return syscall2(SYS_lstat64, @ptrToInt(pathname), @ptrToInt(statbuf));1008 return syscall2(.lstat64, @ptrToInt(pathname), @ptrToInt(statbuf));
1009 } else {1009 } else {
1010 return syscall2(SYS_lstat, @ptrToInt(pathname), @ptrToInt(statbuf));1010 return syscall2(.lstat, @ptrToInt(pathname), @ptrToInt(statbuf));
1011 }1011 }
1012}1012}
10131013
1014pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usize {1014pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usize {
1015 if (@hasDecl(@This(), "SYS_fstatat64")) {1015 if (@hasField(SYS, "fstatat64")) {
1016 return syscall4(SYS_fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);1016 return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
1017 } else {1017 } else {
1018 return syscall4(SYS_fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);1018 return syscall4(.fstatat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
1019 }1019 }
1020}1020}
10211021
1022pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *Statx) usize {1022pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *Statx) usize {
1023 if (@hasDecl(@This(), "SYS_statx")) {1023 if (@hasField(SYS, "statx")) {
1024 return syscall5(1024 return syscall5(
1025 SYS_statx,1025 .statx,
1026 @bitCast(usize, @as(isize, dirfd)),1026 @bitCast(usize, @as(isize, dirfd)),
1027 @ptrToInt(path),1027 @ptrToInt(path),
1028 flags,1028 flags,
...@@ -1034,59 +1034,59 @@ pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *S...@@ -1034,59 +1034,59 @@ pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *S
1034}1034}
10351035
1036pub fn listxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize {1036pub fn listxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize {
1037 return syscall3(SYS_listxattr, @ptrToInt(path), @ptrToInt(list), size);1037 return syscall3(.listxattr, @ptrToInt(path), @ptrToInt(list), size);
1038}1038}
10391039
1040pub fn llistxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize {1040pub fn llistxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize {
1041 return syscall3(SYS_llistxattr, @ptrToInt(path), @ptrToInt(list), size);1041 return syscall3(.llistxattr, @ptrToInt(path), @ptrToInt(list), size);
1042}1042}
10431043
1044pub fn flistxattr(fd: usize, list: [*]u8, size: usize) usize {1044pub fn flistxattr(fd: usize, list: [*]u8, size: usize) usize {
1045 return syscall3(SYS_flistxattr, fd, @ptrToInt(list), size);1045 return syscall3(.flistxattr, fd, @ptrToInt(list), size);
1046}1046}
10471047
1048pub fn getxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize {1048pub fn getxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize {
1049 return syscall4(SYS_getxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size);1049 return syscall4(.getxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size);
1050}1050}
10511051
1052pub fn lgetxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize {1052pub fn lgetxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize {
1053 return syscall4(SYS_lgetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size);1053 return syscall4(.lgetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size);
1054}1054}
10551055
1056pub fn fgetxattr(fd: usize, name: [*:0]const u8, value: [*]u8, size: usize) usize {1056pub fn fgetxattr(fd: usize, name: [*:0]const u8, value: [*]u8, size: usize) usize {
1057 return syscall4(SYS_lgetxattr, fd, @ptrToInt(name), @ptrToInt(value), size);1057 return syscall4(.lgetxattr, fd, @ptrToInt(name), @ptrToInt(value), size);
1058}1058}
10591059
1060pub fn setxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize {1060pub fn setxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize {
1061 return syscall5(SYS_setxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags);1061 return syscall5(.setxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags);
1062}1062}
10631063
1064pub fn lsetxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize {1064pub fn lsetxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize {
1065 return syscall5(SYS_lsetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags);1065 return syscall5(.lsetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags);
1066}1066}
10671067
1068pub fn fsetxattr(fd: usize, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize {1068pub fn fsetxattr(fd: usize, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize {
1069 return syscall5(SYS_fsetxattr, fd, @ptrToInt(name), @ptrToInt(value), size, flags);1069 return syscall5(.fsetxattr, fd, @ptrToInt(name), @ptrToInt(value), size, flags);
1070}1070}
10711071
1072pub fn removexattr(path: [*:0]const u8, name: [*:0]const u8) usize {1072pub fn removexattr(path: [*:0]const u8, name: [*:0]const u8) usize {
1073 return syscall2(SYS_removexattr, @ptrToInt(path), @ptrToInt(name));1073 return syscall2(.removexattr, @ptrToInt(path), @ptrToInt(name));
1074}1074}
10751075
1076pub fn lremovexattr(path: [*:0]const u8, name: [*:0]const u8) usize {1076pub fn lremovexattr(path: [*:0]const u8, name: [*:0]const u8) usize {
1077 return syscall2(SYS_lremovexattr, @ptrToInt(path), @ptrToInt(name));1077 return syscall2(.lremovexattr, @ptrToInt(path), @ptrToInt(name));
1078}1078}
10791079
1080pub fn fremovexattr(fd: usize, name: [*:0]const u8) usize {1080pub fn fremovexattr(fd: usize, name: [*:0]const u8) usize {
1081 return syscall2(SYS_fremovexattr, fd, @ptrToInt(name));1081 return syscall2(.fremovexattr, fd, @ptrToInt(name));
1082}1082}
10831083
1084pub fn sched_yield() usize {1084pub fn sched_yield() usize {
1085 return syscall0(SYS_sched_yield);1085 return syscall0(.sched_yield);
1086}1086}
10871087
1088pub fn sched_getaffinity(pid: pid_t, size: usize, set: *cpu_set_t) usize {1088pub fn sched_getaffinity(pid: pid_t, size: usize, set: *cpu_set_t) usize {
1089 const rc = syscall3(SYS_sched_getaffinity, @bitCast(usize, @as(isize, pid)), size, @ptrToInt(set));1089 const rc = syscall3(.sched_getaffinity, @bitCast(usize, @as(isize, pid)), size, @ptrToInt(set));
1090 if (@bitCast(isize, rc) < 0) return rc;1090 if (@bitCast(isize, rc) < 0) return rc;
1091 if (rc < size) @memset(@ptrCast([*]u8, set) + rc, 0, size - rc);1091 if (rc < size) @memset(@ptrCast([*]u8, set) + rc, 0, size - rc);
1092 return 0;1092 return 0;
...@@ -1097,11 +1097,11 @@ pub fn epoll_create() usize {...@@ -1097,11 +1097,11 @@ pub fn epoll_create() usize {
1097}1097}
10981098
1099pub fn epoll_create1(flags: usize) usize {1099pub fn epoll_create1(flags: usize) usize {
1100 return syscall1(SYS_epoll_create1, flags);1100 return syscall1(.epoll_create1, flags);
1101}1101}
11021102
1103pub fn epoll_ctl(epoll_fd: i32, op: u32, fd: i32, ev: ?*epoll_event) usize {1103pub fn epoll_ctl(epoll_fd: i32, op: u32, fd: i32, ev: ?*epoll_event) usize {
1104 return syscall4(SYS_epoll_ctl, @bitCast(usize, @as(isize, epoll_fd)), @intCast(usize, op), @bitCast(usize, @as(isize, fd)), @ptrToInt(ev));1104 return syscall4(.epoll_ctl, @bitCast(usize, @as(isize, epoll_fd)), @intCast(usize, op), @bitCast(usize, @as(isize, fd)), @ptrToInt(ev));
1105}1105}
11061106
1107pub fn epoll_wait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32) usize {1107pub fn epoll_wait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32) usize {
...@@ -1110,7 +1110,7 @@ pub fn epoll_wait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout...@@ -1110,7 +1110,7 @@ pub fn epoll_wait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout
11101110
1111pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32, sigmask: ?*sigset_t) usize {1111pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32, sigmask: ?*sigset_t) usize {
1112 return syscall6(1112 return syscall6(
1113 SYS_epoll_pwait,1113 .epoll_pwait,
1114 @bitCast(usize, @as(isize, epoll_fd)),1114 @bitCast(usize, @as(isize, epoll_fd)),
1115 @ptrToInt(events),1115 @ptrToInt(events),
1116 @intCast(usize, maxevents),1116 @intCast(usize, maxevents),
...@@ -1121,11 +1121,11 @@ pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeou...@@ -1121,11 +1121,11 @@ pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeou
1121}1121}
11221122
1123pub fn eventfd(count: u32, flags: u32) usize {1123pub fn eventfd(count: u32, flags: u32) usize {
1124 return syscall2(SYS_eventfd2, count, flags);1124 return syscall2(.eventfd2, count, flags);
1125}1125}
11261126
1127pub fn timerfd_create(clockid: i32, flags: u32) usize {1127pub fn timerfd_create(clockid: i32, flags: u32) usize {
1128 return syscall2(SYS_timerfd_create, @bitCast(usize, @as(isize, clockid)), flags);1128 return syscall2(.timerfd_create, @bitCast(usize, @as(isize, clockid)), flags);
1129}1129}
11301130
1131pub const itimerspec = extern struct {1131pub const itimerspec = extern struct {
...@@ -1134,59 +1134,59 @@ pub const itimerspec = extern struct {...@@ -1134,59 +1134,59 @@ pub const itimerspec = extern struct {
1134};1134};
11351135
1136pub fn timerfd_gettime(fd: i32, curr_value: *itimerspec) usize {1136pub fn timerfd_gettime(fd: i32, curr_value: *itimerspec) usize {
1137 return syscall2(SYS_timerfd_gettime, @bitCast(usize, @as(isize, fd)), @ptrToInt(curr_value));1137 return syscall2(.timerfd_gettime, @bitCast(usize, @as(isize, fd)), @ptrToInt(curr_value));
1138}1138}
11391139
1140pub fn timerfd_settime(fd: i32, flags: u32, new_value: *const itimerspec, old_value: ?*itimerspec) usize {1140pub fn timerfd_settime(fd: i32, flags: u32, new_value: *const itimerspec, old_value: ?*itimerspec) usize {
1141 return syscall4(SYS_timerfd_settime, @bitCast(usize, @as(isize, fd)), flags, @ptrToInt(new_value), @ptrToInt(old_value));1141 return syscall4(.timerfd_settime, @bitCast(usize, @as(isize, fd)), flags, @ptrToInt(new_value), @ptrToInt(old_value));
1142}1142}
11431143
1144pub fn unshare(flags: usize) usize {1144pub fn unshare(flags: usize) usize {
1145 return syscall1(SYS_unshare, flags);1145 return syscall1(.unshare, flags);
1146}1146}
11471147
1148pub fn capget(hdrp: *cap_user_header_t, datap: *cap_user_data_t) usize {1148pub fn capget(hdrp: *cap_user_header_t, datap: *cap_user_data_t) usize {
1149 return syscall2(SYS_capget, @ptrToInt(hdrp), @ptrToInt(datap));1149 return syscall2(.capget, @ptrToInt(hdrp), @ptrToInt(datap));
1150}1150}
11511151
1152pub fn capset(hdrp: *cap_user_header_t, datap: *const cap_user_data_t) usize {1152pub fn capset(hdrp: *cap_user_header_t, datap: *const cap_user_data_t) usize {
1153 return syscall2(SYS_capset, @ptrToInt(hdrp), @ptrToInt(datap));1153 return syscall2(.capset, @ptrToInt(hdrp), @ptrToInt(datap));
1154}1154}
11551155
1156pub fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) usize {1156pub fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) usize {
1157 return syscall2(SYS_sigaltstack, @ptrToInt(ss), @ptrToInt(old_ss));1157 return syscall2(.sigaltstack, @ptrToInt(ss), @ptrToInt(old_ss));
1158}1158}
11591159
1160pub fn uname(uts: *utsname) usize {1160pub fn uname(uts: *utsname) usize {
1161 return syscall1(SYS_uname, @ptrToInt(uts));1161 return syscall1(.uname, @ptrToInt(uts));
1162}1162}
11631163
1164pub fn io_uring_setup(entries: u32, p: *io_uring_params) usize {1164pub fn io_uring_setup(entries: u32, p: *io_uring_params) usize {
1165 return syscall2(SYS_io_uring_setup, entries, @ptrToInt(p));1165 return syscall2(.io_uring_setup, entries, @ptrToInt(p));
1166}1166}
11671167
1168pub fn io_uring_enter(fd: i32, to_submit: u32, min_complete: u32, flags: u32, sig: ?*sigset_t) usize {1168pub fn io_uring_enter(fd: i32, to_submit: u32, min_complete: u32, flags: u32, sig: ?*sigset_t) usize {
1169 return syscall6(SYS_io_uring_enter, @bitCast(usize, @as(isize, fd)), to_submit, min_complete, flags, @ptrToInt(sig), NSIG / 8);1169 return syscall6(.io_uring_enter, @bitCast(usize, @as(isize, fd)), to_submit, min_complete, flags, @ptrToInt(sig), NSIG / 8);
1170}1170}
11711171
1172pub fn io_uring_register(fd: i32, opcode: IORING_REGISTER, arg: ?*const c_void, nr_args: u32) usize {1172pub fn io_uring_register(fd: i32, opcode: IORING_REGISTER, arg: ?*const c_void, nr_args: u32) usize {
1173 return syscall4(SYS_io_uring_register, @bitCast(usize, @as(isize, fd)), @enumToInt(opcode), @ptrToInt(arg), nr_args);1173 return syscall4(.io_uring_register, @bitCast(usize, @as(isize, fd)), @enumToInt(opcode), @ptrToInt(arg), nr_args);
1174}1174}
11751175
1176pub fn memfd_create(name: [*:0]const u8, flags: u32) usize {1176pub fn memfd_create(name: [*:0]const u8, flags: u32) usize {
1177 return syscall2(SYS_memfd_create, @ptrToInt(name), flags);1177 return syscall2(.memfd_create, @ptrToInt(name), flags);
1178}1178}
11791179
1180pub fn getrusage(who: i32, usage: *rusage) usize {1180pub fn getrusage(who: i32, usage: *rusage) usize {
1181 return syscall2(SYS_getrusage, @bitCast(usize, @as(isize, who)), @ptrToInt(usage));1181 return syscall2(.getrusage, @bitCast(usize, @as(isize, who)), @ptrToInt(usage));
1182}1182}
11831183
1184pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize {1184pub fn tcgetattr(fd: fd_t, termios_p: *termios) usize {
1185 return syscall3(SYS_ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p));1185 return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCGETS, @ptrToInt(termios_p));
1186}1186}
11871187
1188pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize {1188pub fn tcsetattr(fd: fd_t, optional_action: TCSA, termios_p: *const termios) usize {
1189 return syscall3(SYS_ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p));1189 return syscall3(.ioctl, @bitCast(usize, @as(isize, fd)), TCSETS + @enumToInt(optional_action), @ptrToInt(termios_p));
1190}1190}
11911191
1192test "" {1192test "" {
lib/std/os/linux/arm-eabi.zig+16-16
...@@ -1,36 +1,36 @@...@@ -1,36 +1,36 @@
1usingnamespace @import("../bits.zig");1usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {3pub fn syscall0(number: SYS) usize {
4 return asm volatile ("svc #0"4 return asm volatile ("svc #0"
5 : [ret] "={r0}" (-> usize)5 : [ret] "={r0}" (-> usize)
6 : [number] "{r7}" (number)6 : [number] "{r7}" (@enumToInt(number))
7 : "memory"7 : "memory"
8 );8 );
9}9}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {11pub fn syscall1(number: SYS, arg1: usize) usize {
12 return asm volatile ("svc #0"12 return asm volatile ("svc #0"
13 : [ret] "={r0}" (-> usize)13 : [ret] "={r0}" (-> usize)
14 : [number] "{r7}" (number),14 : [number] "{r7}" (@enumToInt(number)),
15 [arg1] "{r0}" (arg1)15 [arg1] "{r0}" (arg1)
16 : "memory"16 : "memory"
17 );17 );
18}18}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
21 return asm volatile ("svc #0"21 return asm volatile ("svc #0"
22 : [ret] "={r0}" (-> usize)22 : [ret] "={r0}" (-> usize)
23 : [number] "{r7}" (number),23 : [number] "{r7}" (@enumToInt(number)),
24 [arg1] "{r0}" (arg1),24 [arg1] "{r0}" (arg1),
25 [arg2] "{r1}" (arg2)25 [arg2] "{r1}" (arg2)
26 : "memory"26 : "memory"
27 );27 );
28}28}
2929
30pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {30pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
31 return asm volatile ("svc #0"31 return asm volatile ("svc #0"
32 : [ret] "={r0}" (-> usize)32 : [ret] "={r0}" (-> usize)
33 : [number] "{r7}" (number),33 : [number] "{r7}" (@enumToInt(number)),
34 [arg1] "{r0}" (arg1),34 [arg1] "{r0}" (arg1),
35 [arg2] "{r1}" (arg2),35 [arg2] "{r1}" (arg2),
36 [arg3] "{r2}" (arg3)36 [arg3] "{r2}" (arg3)
...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
38 );38 );
39}39}
4040
41pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {41pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
42 return asm volatile ("svc #0"42 return asm volatile ("svc #0"
43 : [ret] "={r0}" (-> usize)43 : [ret] "={r0}" (-> usize)
44 : [number] "{r7}" (number),44 : [number] "{r7}" (@enumToInt(number)),
45 [arg1] "{r0}" (arg1),45 [arg1] "{r0}" (arg1),
46 [arg2] "{r1}" (arg2),46 [arg2] "{r1}" (arg2),
47 [arg3] "{r2}" (arg3),47 [arg3] "{r2}" (arg3),
...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
50 );50 );
51}51}
5252
53pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {53pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
54 return asm volatile ("svc #0"54 return asm volatile ("svc #0"
55 : [ret] "={r0}" (-> usize)55 : [ret] "={r0}" (-> usize)
56 : [number] "{r7}" (number),56 : [number] "{r7}" (@enumToInt(number)),
57 [arg1] "{r0}" (arg1),57 [arg1] "{r0}" (arg1),
58 [arg2] "{r1}" (arg2),58 [arg2] "{r1}" (arg2),
59 [arg3] "{r2}" (arg3),59 [arg3] "{r2}" (arg3),
...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
64}64}
6565
66pub fn syscall6(66pub fn syscall6(
67 number: usize,67 number: SYS,
68 arg1: usize,68 arg1: usize,
69 arg2: usize,69 arg2: usize,
70 arg3: usize,70 arg3: usize,
...@@ -74,7 +74,7 @@ pub fn syscall6(...@@ -74,7 +74,7 @@ pub fn syscall6(
74) usize {74) usize {
75 return asm volatile ("svc #0"75 return asm volatile ("svc #0"
76 : [ret] "={r0}" (-> usize)76 : [ret] "={r0}" (-> usize)
77 : [number] "{r7}" (number),77 : [number] "{r7}" (@enumToInt(number)),
78 [arg1] "{r0}" (arg1),78 [arg1] "{r0}" (arg1),
79 [arg2] "{r1}" (arg2),79 [arg2] "{r1}" (arg2),
80 [arg3] "{r2}" (arg3),80 [arg3] "{r2}" (arg3),
...@@ -91,7 +91,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a...@@ -91,7 +91,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a
91pub fn restore() callconv(.Naked) void {91pub fn restore() callconv(.Naked) void {
92 return asm volatile ("svc #0"92 return asm volatile ("svc #0"
93 :93 :
94 : [number] "{r7}" (@as(usize, SYS_sigreturn))94 : [number] "{r7}" (@enumToInt(SYS.sigreturn))
95 : "memory"95 : "memory"
96 );96 );
97}97}
...@@ -99,7 +99,7 @@ pub fn restore() callconv(.Naked) void {...@@ -99,7 +99,7 @@ pub fn restore() callconv(.Naked) void {
99pub fn restore_rt() callconv(.Naked) void {99pub fn restore_rt() callconv(.Naked) void {
100 return asm volatile ("svc #0"100 return asm volatile ("svc #0"
101 :101 :
102 : [number] "{r7}" (@as(usize, SYS_rt_sigreturn))102 : [number] "{r7}" (@enumToInt(SYS.rt_sigreturn))
103 : "memory"103 : "memory"
104 );104 );
105}105}
lib/std/os/linux/arm64.zig+15-15
...@@ -1,36 +1,36 @@...@@ -1,36 +1,36 @@
1usingnamespace @import("../bits.zig");1usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {3pub fn syscall0(number: SYS) usize {
4 return asm volatile ("svc #0"4 return asm volatile ("svc #0"
5 : [ret] "={x0}" (-> usize)5 : [ret] "={x0}" (-> usize)
6 : [number] "{x8}" (number)6 : [number] "{x8}" (@enumToInt(number))
7 : "memory", "cc"7 : "memory", "cc"
8 );8 );
9}9}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {11pub fn syscall1(number: SYS, arg1: usize) usize {
12 return asm volatile ("svc #0"12 return asm volatile ("svc #0"
13 : [ret] "={x0}" (-> usize)13 : [ret] "={x0}" (-> usize)
14 : [number] "{x8}" (number),14 : [number] "{x8}" (@enumToInt(number)),
15 [arg1] "{x0}" (arg1)15 [arg1] "{x0}" (arg1)
16 : "memory", "cc"16 : "memory", "cc"
17 );17 );
18}18}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
21 return asm volatile ("svc #0"21 return asm volatile ("svc #0"
22 : [ret] "={x0}" (-> usize)22 : [ret] "={x0}" (-> usize)
23 : [number] "{x8}" (number),23 : [number] "{x8}" (@enumToInt(number)),
24 [arg1] "{x0}" (arg1),24 [arg1] "{x0}" (arg1),
25 [arg2] "{x1}" (arg2)25 [arg2] "{x1}" (arg2)
26 : "memory", "cc"26 : "memory", "cc"
27 );27 );
28}28}
2929
30pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {30pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
31 return asm volatile ("svc #0"31 return asm volatile ("svc #0"
32 : [ret] "={x0}" (-> usize)32 : [ret] "={x0}" (-> usize)
33 : [number] "{x8}" (number),33 : [number] "{x8}" (@enumToInt(number)),
34 [arg1] "{x0}" (arg1),34 [arg1] "{x0}" (arg1),
35 [arg2] "{x1}" (arg2),35 [arg2] "{x1}" (arg2),
36 [arg3] "{x2}" (arg3)36 [arg3] "{x2}" (arg3)
...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
38 );38 );
39}39}
4040
41pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {41pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
42 return asm volatile ("svc #0"42 return asm volatile ("svc #0"
43 : [ret] "={x0}" (-> usize)43 : [ret] "={x0}" (-> usize)
44 : [number] "{x8}" (number),44 : [number] "{x8}" (@enumToInt(number)),
45 [arg1] "{x0}" (arg1),45 [arg1] "{x0}" (arg1),
46 [arg2] "{x1}" (arg2),46 [arg2] "{x1}" (arg2),
47 [arg3] "{x2}" (arg3),47 [arg3] "{x2}" (arg3),
...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
50 );50 );
51}51}
5252
53pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {53pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
54 return asm volatile ("svc #0"54 return asm volatile ("svc #0"
55 : [ret] "={x0}" (-> usize)55 : [ret] "={x0}" (-> usize)
56 : [number] "{x8}" (number),56 : [number] "{x8}" (@enumToInt(number)),
57 [arg1] "{x0}" (arg1),57 [arg1] "{x0}" (arg1),
58 [arg2] "{x1}" (arg2),58 [arg2] "{x1}" (arg2),
59 [arg3] "{x2}" (arg3),59 [arg3] "{x2}" (arg3),
...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
64}64}
6565
66pub fn syscall6(66pub fn syscall6(
67 number: usize,67 number: SYS,
68 arg1: usize,68 arg1: usize,
69 arg2: usize,69 arg2: usize,
70 arg3: usize,70 arg3: usize,
...@@ -74,7 +74,7 @@ pub fn syscall6(...@@ -74,7 +74,7 @@ pub fn syscall6(
74) usize {74) usize {
75 return asm volatile ("svc #0"75 return asm volatile ("svc #0"
76 : [ret] "={x0}" (-> usize)76 : [ret] "={x0}" (-> usize)
77 : [number] "{x8}" (number),77 : [number] "{x8}" (@enumToInt(number)),
78 [arg1] "{x0}" (arg1),78 [arg1] "{x0}" (arg1),
79 [arg2] "{x1}" (arg2),79 [arg2] "{x1}" (arg2),
80 [arg3] "{x2}" (arg3),80 [arg3] "{x2}" (arg3),
...@@ -93,7 +93,7 @@ pub const restore = restore_rt;...@@ -93,7 +93,7 @@ pub const restore = restore_rt;
93pub fn restore_rt() callconv(.Naked) void {93pub fn restore_rt() callconv(.Naked) void {
94 return asm volatile ("svc #0"94 return asm volatile ("svc #0"
95 :95 :
96 : [number] "{x8}" (@as(usize, SYS_rt_sigreturn))96 : [number] "{x8}" (@enumToInt(SYS.rt_sigreturn))
97 : "memory", "cc"97 : "memory", "cc"
98 );98 );
99}99}
lib/std/os/linux/i386.zig+17-17
...@@ -1,36 +1,36 @@...@@ -1,36 +1,36 @@
1usingnamespace @import("../bits.zig");1usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {3pub fn syscall0(number: SYS) usize {
4 return asm volatile ("int $0x80"4 return asm volatile ("int $0x80"
5 : [ret] "={eax}" (-> usize)5 : [ret] "={eax}" (-> usize)
6 : [number] "{eax}" (number)6 : [number] "{eax}" (@enumToInt(number))
7 : "memory"7 : "memory"
8 );8 );
9}9}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {11pub fn syscall1(number: SYS, arg1: usize) usize {
12 return asm volatile ("int $0x80"12 return asm volatile ("int $0x80"
13 : [ret] "={eax}" (-> usize)13 : [ret] "={eax}" (-> usize)
14 : [number] "{eax}" (number),14 : [number] "{eax}" (@enumToInt(number)),
15 [arg1] "{ebx}" (arg1)15 [arg1] "{ebx}" (arg1)
16 : "memory"16 : "memory"
17 );17 );
18}18}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
21 return asm volatile ("int $0x80"21 return asm volatile ("int $0x80"
22 : [ret] "={eax}" (-> usize)22 : [ret] "={eax}" (-> usize)
23 : [number] "{eax}" (number),23 : [number] "{eax}" (@enumToInt(number)),
24 [arg1] "{ebx}" (arg1),24 [arg1] "{ebx}" (arg1),
25 [arg2] "{ecx}" (arg2)25 [arg2] "{ecx}" (arg2)
26 : "memory"26 : "memory"
27 );27 );
28}28}
2929
30pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {30pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
31 return asm volatile ("int $0x80"31 return asm volatile ("int $0x80"
32 : [ret] "={eax}" (-> usize)32 : [ret] "={eax}" (-> usize)
33 : [number] "{eax}" (number),33 : [number] "{eax}" (@enumToInt(number)),
34 [arg1] "{ebx}" (arg1),34 [arg1] "{ebx}" (arg1),
35 [arg2] "{ecx}" (arg2),35 [arg2] "{ecx}" (arg2),
36 [arg3] "{edx}" (arg3)36 [arg3] "{edx}" (arg3)
...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
38 );38 );
39}39}
4040
41pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {41pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
42 return asm volatile ("int $0x80"42 return asm volatile ("int $0x80"
43 : [ret] "={eax}" (-> usize)43 : [ret] "={eax}" (-> usize)
44 : [number] "{eax}" (number),44 : [number] "{eax}" (@enumToInt(number)),
45 [arg1] "{ebx}" (arg1),45 [arg1] "{ebx}" (arg1),
46 [arg2] "{ecx}" (arg2),46 [arg2] "{ecx}" (arg2),
47 [arg3] "{edx}" (arg3),47 [arg3] "{edx}" (arg3),
...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
50 );50 );
51}51}
5252
53pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {53pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
54 return asm volatile ("int $0x80"54 return asm volatile ("int $0x80"
55 : [ret] "={eax}" (-> usize)55 : [ret] "={eax}" (-> usize)
56 : [number] "{eax}" (number),56 : [number] "{eax}" (@enumToInt(number)),
57 [arg1] "{ebx}" (arg1),57 [arg1] "{ebx}" (arg1),
58 [arg2] "{ecx}" (arg2),58 [arg2] "{ecx}" (arg2),
59 [arg3] "{edx}" (arg3),59 [arg3] "{edx}" (arg3),
...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
64}64}
6565
66pub fn syscall6(66pub fn syscall6(
67 number: usize,67 number: SYS,
68 arg1: usize,68 arg1: usize,
69 arg2: usize,69 arg2: usize,
70 arg3: usize,70 arg3: usize,
...@@ -84,7 +84,7 @@ pub fn syscall6(...@@ -84,7 +84,7 @@ pub fn syscall6(
84 \\ pop %%ebp84 \\ pop %%ebp
85 \\ add $4, %%esp85 \\ add $4, %%esp
86 : [ret] "={eax}" (-> usize)86 : [ret] "={eax}" (-> usize)
87 : [number] "{eax}" (number),87 : [number] "{eax}" (@enumToInt(number)),
88 [arg1] "{ebx}" (arg1),88 [arg1] "{ebx}" (arg1),
89 [arg2] "{ecx}" (arg2),89 [arg2] "{ecx}" (arg2),
90 [arg3] "{edx}" (arg3),90 [arg3] "{edx}" (arg3),
...@@ -98,7 +98,7 @@ pub fn syscall6(...@@ -98,7 +98,7 @@ pub fn syscall6(
98pub fn socketcall(call: usize, args: [*]usize) usize {98pub fn socketcall(call: usize, args: [*]usize) usize {
99 return asm volatile ("int $0x80"99 return asm volatile ("int $0x80"
100 : [ret] "={eax}" (-> usize)100 : [ret] "={eax}" (-> usize)
101 : [number] "{eax}" (@as(usize, SYS_socketcall)),101 : [number] "{eax}" (@enumToInt(SYS.socketcall)),
102 [arg1] "{ebx}" (call),102 [arg1] "{ebx}" (call),
103 [arg2] "{ecx}" (@ptrToInt(args))103 [arg2] "{ecx}" (@ptrToInt(args))
104 : "memory"104 : "memory"
...@@ -111,7 +111,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a...@@ -111,7 +111,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a
111pub fn restore() callconv(.Naked) void {111pub fn restore() callconv(.Naked) void {
112 return asm volatile ("int $0x80"112 return asm volatile ("int $0x80"
113 :113 :
114 : [number] "{eax}" (@as(usize, SYS_sigreturn))114 : [number] "{eax}" (@enumToInt(SYS.sigreturn))
115 : "memory"115 : "memory"
116 );116 );
117}117}
...@@ -119,7 +119,7 @@ pub fn restore() callconv(.Naked) void {...@@ -119,7 +119,7 @@ pub fn restore() callconv(.Naked) void {
119pub fn restore_rt() callconv(.Naked) void {119pub fn restore_rt() callconv(.Naked) void {
120 return asm volatile ("int $0x80"120 return asm volatile ("int $0x80"
121 :121 :
122 : [number] "{eax}" (@as(usize, SYS_rt_sigreturn))122 : [number] "{eax}" (@enumToInt(SYS.rt_sigreturn))
123 : "memory"123 : "memory"
124 );124 );
125}125}
lib/std/os/linux/mipsel.zig+17-17
...@@ -1,13 +1,13 @@...@@ -1,13 +1,13 @@
1usingnamespace @import("../bits.zig");1usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {3pub fn syscall0(number: SYS) usize {
4 return asm volatile (4 return asm volatile (
5 \\ syscall5 \\ syscall
6 \\ blez $7, 1f6 \\ blez $7, 1f
7 \\ subu $2, $0, $27 \\ subu $2, $0, $2
8 \\ 1:8 \\ 1:
9 : [ret] "={$2}" (-> usize)9 : [ret] "={$2}" (-> usize)
10 : [number] "{$2}" (number)10 : [number] "{$2}" (@enumToInt(number))
11 : "memory", "cc", "$7"11 : "memory", "cc", "$7"
12 );12 );
13}13}
...@@ -26,46 +26,46 @@ pub fn syscall_pipe(fd: *[2]i32) usize {...@@ -26,46 +26,46 @@ pub fn syscall_pipe(fd: *[2]i32) usize {
26 \\ sw $3, 4($4)26 \\ sw $3, 4($4)
27 \\ 2:27 \\ 2:
28 : [ret] "={$2}" (-> usize)28 : [ret] "={$2}" (-> usize)
29 : [number] "{$2}" (@as(usize, SYS_pipe))29 : [number] "{$2}" (@enumToInt(SYS.pipe))
30 : "memory", "cc", "$7"30 : "memory", "cc", "$7"
31 );31 );
32}32}
3333
34pub fn syscall1(number: usize, arg1: usize) usize {34pub fn syscall1(number: SYS, arg1: usize) usize {
35 return asm volatile (35 return asm volatile (
36 \\ syscall36 \\ syscall
37 \\ blez $7, 1f37 \\ blez $7, 1f
38 \\ subu $2, $0, $238 \\ subu $2, $0, $2
39 \\ 1:39 \\ 1:
40 : [ret] "={$2}" (-> usize)40 : [ret] "={$2}" (-> usize)
41 : [number] "{$2}" (number),41 : [number] "{$2}" (@enumToInt(number)),
42 [arg1] "{$4}" (arg1)42 [arg1] "{$4}" (arg1)
43 : "memory", "cc", "$7"43 : "memory", "cc", "$7"
44 );44 );
45}45}
4646
47pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {47pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
48 return asm volatile (48 return asm volatile (
49 \\ syscall49 \\ syscall
50 \\ blez $7, 1f50 \\ blez $7, 1f
51 \\ subu $2, $0, $251 \\ subu $2, $0, $2
52 \\ 1:52 \\ 1:
53 : [ret] "={$2}" (-> usize)53 : [ret] "={$2}" (-> usize)
54 : [number] "{$2}" (number),54 : [number] "{$2}" (@enumToInt(number)),
55 [arg1] "{$4}" (arg1),55 [arg1] "{$4}" (arg1),
56 [arg2] "{$5}" (arg2)56 [arg2] "{$5}" (arg2)
57 : "memory", "cc", "$7"57 : "memory", "cc", "$7"
58 );58 );
59}59}
6060
61pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {61pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
62 return asm volatile (62 return asm volatile (
63 \\ syscall63 \\ syscall
64 \\ blez $7, 1f64 \\ blez $7, 1f
65 \\ subu $2, $0, $265 \\ subu $2, $0, $2
66 \\ 1:66 \\ 1:
67 : [ret] "={$2}" (-> usize)67 : [ret] "={$2}" (-> usize)
68 : [number] "{$2}" (number),68 : [number] "{$2}" (@enumToInt(number)),
69 [arg1] "{$4}" (arg1),69 [arg1] "{$4}" (arg1),
70 [arg2] "{$5}" (arg2),70 [arg2] "{$5}" (arg2),
71 [arg3] "{$6}" (arg3)71 [arg3] "{$6}" (arg3)
...@@ -73,14 +73,14 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {...@@ -73,14 +73,14 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
73 );73 );
74}74}
7575
76pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {76pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
77 return asm volatile (77 return asm volatile (
78 \\ syscall78 \\ syscall
79 \\ blez $7, 1f79 \\ blez $7, 1f
80 \\ subu $2, $0, $280 \\ subu $2, $0, $2
81 \\ 1:81 \\ 1:
82 : [ret] "={$2}" (-> usize)82 : [ret] "={$2}" (-> usize)
83 : [number] "{$2}" (number),83 : [number] "{$2}" (@enumToInt(number)),
84 [arg1] "{$4}" (arg1),84 [arg1] "{$4}" (arg1),
85 [arg2] "{$5}" (arg2),85 [arg2] "{$5}" (arg2),
86 [arg3] "{$6}" (arg3),86 [arg3] "{$6}" (arg3),
...@@ -89,7 +89,7 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -89,7 +89,7 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
89 );89 );
90}90}
9191
92pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {92pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
93 return asm volatile (93 return asm volatile (
94 \\ .set noat94 \\ .set noat
95 \\ subu $sp, $sp, 2495 \\ subu $sp, $sp, 24
...@@ -100,7 +100,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -100,7 +100,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
100 \\ subu $2, $0, $2100 \\ subu $2, $0, $2
101 \\ 1:101 \\ 1:
102 : [ret] "={$2}" (-> usize)102 : [ret] "={$2}" (-> usize)
103 : [number] "{$2}" (number),103 : [number] "{$2}" (@enumToInt(number)),
104 [arg1] "{$4}" (arg1),104 [arg1] "{$4}" (arg1),
105 [arg2] "{$5}" (arg2),105 [arg2] "{$5}" (arg2),
106 [arg3] "{$6}" (arg3),106 [arg3] "{$6}" (arg3),
...@@ -111,7 +111,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -111,7 +111,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
111}111}
112112
113pub fn syscall6(113pub fn syscall6(
114 number: usize,114 number: SYS,
115 arg1: usize,115 arg1: usize,
116 arg2: usize,116 arg2: usize,
117 arg3: usize,117 arg3: usize,
...@@ -130,7 +130,7 @@ pub fn syscall6(...@@ -130,7 +130,7 @@ pub fn syscall6(
130 \\ subu $2, $0, $2130 \\ subu $2, $0, $2
131 \\ 1:131 \\ 1:
132 : [ret] "={$2}" (-> usize)132 : [ret] "={$2}" (-> usize)
133 : [number] "{$2}" (number),133 : [number] "{$2}" (@enumToInt(number)),
134 [arg1] "{$4}" (arg1),134 [arg1] "{$4}" (arg1),
135 [arg2] "{$5}" (arg2),135 [arg2] "{$5}" (arg2),
136 [arg3] "{$6}" (arg3),136 [arg3] "{$6}" (arg3),
...@@ -147,7 +147,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a...@@ -147,7 +147,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a
147pub fn restore() callconv(.Naked) void {147pub fn restore() callconv(.Naked) void {
148 return asm volatile ("syscall"148 return asm volatile ("syscall"
149 :149 :
150 : [number] "{$2}" (@as(usize, SYS_sigreturn))150 : [number] "{$2}" (@enumToInt(SYS.sigreturn))
151 : "memory", "cc", "$7"151 : "memory", "cc", "$7"
152 );152 );
153}153}
...@@ -155,7 +155,7 @@ pub fn restore() callconv(.Naked) void {...@@ -155,7 +155,7 @@ pub fn restore() callconv(.Naked) void {
155pub fn restore_rt() callconv(.Naked) void {155pub fn restore_rt() callconv(.Naked) void {
156 return asm volatile ("syscall"156 return asm volatile ("syscall"
157 :157 :
158 : [number] "{$2}" (@as(usize, SYS_rt_sigreturn))158 : [number] "{$2}" (@enumToInt(SYS.rt_sigreturn))
159 : "memory", "cc", "$7"159 : "memory", "cc", "$7"
160 );160 );
161}161}
lib/std/os/linux/riscv64.zig+15-15
...@@ -1,36 +1,36 @@...@@ -1,36 +1,36 @@
1usingnamespace @import("../bits.zig");1usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {3pub fn syscall0(number: SYS) usize {
4 return asm volatile ("ecall"4 return asm volatile ("ecall"
5 : [ret] "={x10}" (-> usize)5 : [ret] "={x10}" (-> usize)
6 : [number] "{x17}" (number)6 : [number] "{x17}" (@enumToInt(number))
7 : "memory"7 : "memory"
8 );8 );
9}9}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {11pub fn syscall1(number: SYS, arg1: usize) usize {
12 return asm volatile ("ecall"12 return asm volatile ("ecall"
13 : [ret] "={x10}" (-> usize)13 : [ret] "={x10}" (-> usize)
14 : [number] "{x17}" (number),14 : [number] "{x17}" (@enumToInt(number)),
15 [arg1] "{x10}" (arg1)15 [arg1] "{x10}" (arg1)
16 : "memory"16 : "memory"
17 );17 );
18}18}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
21 return asm volatile ("ecall"21 return asm volatile ("ecall"
22 : [ret] "={x10}" (-> usize)22 : [ret] "={x10}" (-> usize)
23 : [number] "{x17}" (number),23 : [number] "{x17}" (@enumToInt(number)),
24 [arg1] "{x10}" (arg1),24 [arg1] "{x10}" (arg1),
25 [arg2] "{x11}" (arg2)25 [arg2] "{x11}" (arg2)
26 : "memory"26 : "memory"
27 );27 );
28}28}
2929
30pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {30pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
31 return asm volatile ("ecall"31 return asm volatile ("ecall"
32 : [ret] "={x10}" (-> usize)32 : [ret] "={x10}" (-> usize)
33 : [number] "{x17}" (number),33 : [number] "{x17}" (@enumToInt(number)),
34 [arg1] "{x10}" (arg1),34 [arg1] "{x10}" (arg1),
35 [arg2] "{x11}" (arg2),35 [arg2] "{x11}" (arg2),
36 [arg3] "{x12}" (arg3)36 [arg3] "{x12}" (arg3)
...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
38 );38 );
39}39}
4040
41pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {41pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
42 return asm volatile ("ecall"42 return asm volatile ("ecall"
43 : [ret] "={x10}" (-> usize)43 : [ret] "={x10}" (-> usize)
44 : [number] "{x17}" (number),44 : [number] "{x17}" (@enumToInt(number)),
45 [arg1] "{x10}" (arg1),45 [arg1] "{x10}" (arg1),
46 [arg2] "{x11}" (arg2),46 [arg2] "{x11}" (arg2),
47 [arg3] "{x12}" (arg3),47 [arg3] "{x12}" (arg3),
...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
50 );50 );
51}51}
5252
53pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {53pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
54 return asm volatile ("ecall"54 return asm volatile ("ecall"
55 : [ret] "={x10}" (-> usize)55 : [ret] "={x10}" (-> usize)
56 : [number] "{x17}" (number),56 : [number] "{x17}" (@enumToInt(number)),
57 [arg1] "{x10}" (arg1),57 [arg1] "{x10}" (arg1),
58 [arg2] "{x11}" (arg2),58 [arg2] "{x11}" (arg2),
59 [arg3] "{x12}" (arg3),59 [arg3] "{x12}" (arg3),
...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
64}64}
6565
66pub fn syscall6(66pub fn syscall6(
67 number: usize,67 number: SYS,
68 arg1: usize,68 arg1: usize,
69 arg2: usize,69 arg2: usize,
70 arg3: usize,70 arg3: usize,
...@@ -74,7 +74,7 @@ pub fn syscall6(...@@ -74,7 +74,7 @@ pub fn syscall6(
74) usize {74) usize {
75 return asm volatile ("ecall"75 return asm volatile ("ecall"
76 : [ret] "={x10}" (-> usize)76 : [ret] "={x10}" (-> usize)
77 : [number] "{x17}" (number),77 : [number] "{x17}" (@enumToInt(number)),
78 [arg1] "{x10}" (arg1),78 [arg1] "{x10}" (arg1),
79 [arg2] "{x11}" (arg2),79 [arg2] "{x11}" (arg2),
80 [arg3] "{x12}" (arg3),80 [arg3] "{x12}" (arg3),
...@@ -92,7 +92,7 @@ pub const restore = restore_rt;...@@ -92,7 +92,7 @@ pub const restore = restore_rt;
92pub fn restore_rt() callconv(.Naked) void {92pub fn restore_rt() callconv(.Naked) void {
93 return asm volatile ("ecall"93 return asm volatile ("ecall"
94 :94 :
95 : [number] "{x17}" (@as(usize, SYS_rt_sigreturn))95 : [number] "{x17}" (@enumToInt(SYS.rt_sigreturn))
96 : "memory"96 : "memory"
97 );97 );
98}98}
lib/std/os/linux/tls.zig+4-4
...@@ -122,7 +122,7 @@ pub fn setThreadPointer(addr: usize) void {...@@ -122,7 +122,7 @@ pub fn setThreadPointer(addr: usize) void {
122 .seg_not_present = 0,122 .seg_not_present = 0,
123 .useable = 1,123 .useable = 1,
124 };124 };
125 const rc = std.os.linux.syscall1(std.os.linux.SYS_set_thread_area, @ptrToInt(&user_desc));125 const rc = std.os.linux.syscall1(.set_thread_area, @ptrToInt(&user_desc));
126 assert(rc == 0);126 assert(rc == 0);
127127
128 const gdt_entry_number = user_desc.entry_number;128 const gdt_entry_number = user_desc.entry_number;
...@@ -135,7 +135,7 @@ pub fn setThreadPointer(addr: usize) void {...@@ -135,7 +135,7 @@ pub fn setThreadPointer(addr: usize) void {
135 );135 );
136 },136 },
137 .x86_64 => {137 .x86_64 => {
138 const rc = std.os.linux.syscall2(std.os.linux.SYS_arch_prctl, std.os.linux.ARCH_SET_FS, addr);138 const rc = std.os.linux.syscall2(.arch_prctl, std.os.linux.ARCH_SET_FS, addr);
139 assert(rc == 0);139 assert(rc == 0);
140 },140 },
141 .aarch64 => {141 .aarch64 => {
...@@ -146,7 +146,7 @@ pub fn setThreadPointer(addr: usize) void {...@@ -146,7 +146,7 @@ pub fn setThreadPointer(addr: usize) void {
146 );146 );
147 },147 },
148 .arm => {148 .arm => {
149 const rc = std.os.linux.syscall1(std.os.linux.SYS_set_tls, addr);149 const rc = std.os.linux.syscall1(.set_tls, addr);
150 assert(rc == 0);150 assert(rc == 0);
151 },151 },
152 .riscv64 => {152 .riscv64 => {
...@@ -157,7 +157,7 @@ pub fn setThreadPointer(addr: usize) void {...@@ -157,7 +157,7 @@ pub fn setThreadPointer(addr: usize) void {
157 );157 );
158 },158 },
159 .mipsel => {159 .mipsel => {
160 const rc = std.os.linux.syscall1(std.os.linux.SYS_set_thread_area, addr);160 const rc = std.os.linux.syscall1(.set_thread_area, addr);
161 assert(rc == 0);161 assert(rc == 0);
162 },162 },
163 else => @compileError("Unsupported architecture"),163 else => @compileError("Unsupported architecture"),
lib/std/os/linux/x86_64.zig+15-15
...@@ -1,36 +1,36 @@...@@ -1,36 +1,36 @@
1usingnamespace @import("../bits.zig");1usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {3pub fn syscall0(number: SYS) usize {
4 return asm volatile ("syscall"4 return asm volatile ("syscall"
5 : [ret] "={rax}" (-> usize)5 : [ret] "={rax}" (-> usize)
6 : [number] "{rax}" (number)6 : [number] "{rax}" (@enumToInt(number))
7 : "rcx", "r11", "memory"7 : "rcx", "r11", "memory"
8 );8 );
9}9}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {11pub fn syscall1(number: SYS, arg1: usize) usize {
12 return asm volatile ("syscall"12 return asm volatile ("syscall"
13 : [ret] "={rax}" (-> usize)13 : [ret] "={rax}" (-> usize)
14 : [number] "{rax}" (number),14 : [number] "{rax}" (@enumToInt(number)),
15 [arg1] "{rdi}" (arg1)15 [arg1] "{rdi}" (arg1)
16 : "rcx", "r11", "memory"16 : "rcx", "r11", "memory"
17 );17 );
18}18}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
21 return asm volatile ("syscall"21 return asm volatile ("syscall"
22 : [ret] "={rax}" (-> usize)22 : [ret] "={rax}" (-> usize)
23 : [number] "{rax}" (number),23 : [number] "{rax}" (@enumToInt(number)),
24 [arg1] "{rdi}" (arg1),24 [arg1] "{rdi}" (arg1),
25 [arg2] "{rsi}" (arg2)25 [arg2] "{rsi}" (arg2)
26 : "rcx", "r11", "memory"26 : "rcx", "r11", "memory"
27 );27 );
28}28}
2929
30pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {30pub fn syscall3(number: SYS, arg1: usize, arg2: usize, arg3: usize) usize {
31 return asm volatile ("syscall"31 return asm volatile ("syscall"
32 : [ret] "={rax}" (-> usize)32 : [ret] "={rax}" (-> usize)
33 : [number] "{rax}" (number),33 : [number] "{rax}" (@enumToInt(number)),
34 [arg1] "{rdi}" (arg1),34 [arg1] "{rdi}" (arg1),
35 [arg2] "{rsi}" (arg2),35 [arg2] "{rsi}" (arg2),
36 [arg3] "{rdx}" (arg3)36 [arg3] "{rdx}" (arg3)
...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {...@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
38 );38 );
39}39}
4040
41pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {41pub fn syscall4(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize) usize {
42 return asm volatile ("syscall"42 return asm volatile ("syscall"
43 : [ret] "={rax}" (-> usize)43 : [ret] "={rax}" (-> usize)
44 : [number] "{rax}" (number),44 : [number] "{rax}" (@enumToInt(number)),
45 [arg1] "{rdi}" (arg1),45 [arg1] "{rdi}" (arg1),
46 [arg2] "{rsi}" (arg2),46 [arg2] "{rsi}" (arg2),
47 [arg3] "{rdx}" (arg3),47 [arg3] "{rdx}" (arg3),
...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
50 );50 );
51}51}
5252
53pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {53pub fn syscall5(number: SYS, arg1: usize, arg2: usize, arg3: usize, arg4: usize, arg5: usize) usize {
54 return asm volatile ("syscall"54 return asm volatile ("syscall"
55 : [ret] "={rax}" (-> usize)55 : [ret] "={rax}" (-> usize)
56 : [number] "{rax}" (number),56 : [number] "{rax}" (@enumToInt(number)),
57 [arg1] "{rdi}" (arg1),57 [arg1] "{rdi}" (arg1),
58 [arg2] "{rsi}" (arg2),58 [arg2] "{rsi}" (arg2),
59 [arg3] "{rdx}" (arg3),59 [arg3] "{rdx}" (arg3),
...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz...@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
64}64}
6565
66pub fn syscall6(66pub fn syscall6(
67 number: usize,67 number: SYS,
68 arg1: usize,68 arg1: usize,
69 arg2: usize,69 arg2: usize,
70 arg3: usize,70 arg3: usize,
...@@ -74,7 +74,7 @@ pub fn syscall6(...@@ -74,7 +74,7 @@ pub fn syscall6(
74) usize {74) usize {
75 return asm volatile ("syscall"75 return asm volatile ("syscall"
76 : [ret] "={rax}" (-> usize)76 : [ret] "={rax}" (-> usize)
77 : [number] "{rax}" (number),77 : [number] "{rax}" (@enumToInt(number)),
78 [arg1] "{rdi}" (arg1),78 [arg1] "{rdi}" (arg1),
79 [arg2] "{rsi}" (arg2),79 [arg2] "{rsi}" (arg2),
80 [arg3] "{rdx}" (arg3),80 [arg3] "{rdx}" (arg3),
...@@ -93,7 +93,7 @@ pub const restore = restore_rt;...@@ -93,7 +93,7 @@ pub const restore = restore_rt;
93pub fn restore_rt() callconv(.Naked) void {93pub fn restore_rt() callconv(.Naked) void {
94 return asm volatile ("syscall"94 return asm volatile ("syscall"
95 :95 :
96 : [number] "{rax}" (@as(usize, SYS_rt_sigreturn))96 : [number] "{rax}" (@enumToInt(SYS.rt_sigreturn))
97 : "rcx", "r11", "memory"97 : "rcx", "r11", "memory"
98 );98 );
99}99}
lib/std/special/compiler_rt/clear_cache.zig+1-1
...@@ -54,7 +54,7 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void {...@@ -54,7 +54,7 @@ pub fn clear_cache(start: usize, end: usize) callconv(.C) void {
54 // sysarch(ARM_SYNC_ICACHE, &arg);54 // sysarch(ARM_SYNC_ICACHE, &arg);
55 @compileError("TODO: implement for NetBSD/FreeBSD");55 @compileError("TODO: implement for NetBSD/FreeBSD");
56 } else if (os == .linux) {56 } else if (os == .linux) {
57 const result = std.os.linux.syscall3(std.os.linux.SYS_cacheflush, start, end, 0);57 const result = std.os.linux.syscall3(.cacheflush, start, end, 0);
58 std.debug.assert(result == 0);58 std.debug.assert(result == 0);
59 } else {59 } else {
60 @compileError("no __clear_cache implementation available for this target");60 @compileError("no __clear_cache implementation available for this target");