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 {
20652065 }
20662066 if (builtin.os.tag == .linux) {
20672067 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;
20692069 }
20702070 unreachable;
20712071}
lib/std/os/bits/linux/arm-eabi.zig+403-399
......@@ -9,406 +9,410 @@ const sigset_t = linux.sigset_t;
99const uid_t = linux.uid_t;
1010const gid_t = linux.gid_t;
1111
12pub const SYS_restart_syscall = 0;
13pub const SYS_exit = 1;
14pub const SYS_fork = 2;
15pub const SYS_read = 3;
16pub const SYS_write = 4;
17pub const SYS_open = 5;
18pub const SYS_close = 6;
19pub const SYS_creat = 8;
20pub const SYS_link = 9;
21pub const SYS_unlink = 10;
22pub const SYS_execve = 11;
23pub const SYS_chdir = 12;
24pub const SYS_mknod = 14;
25pub const SYS_chmod = 15;
26pub const SYS_lchown = 16;
27pub const SYS_lseek = 19;
28pub const SYS_getpid = 20;
29pub const SYS_mount = 21;
30pub const SYS_setuid = 23;
31pub const SYS_getuid = 24;
32pub const SYS_ptrace = 26;
33pub const SYS_pause = 29;
34pub const SYS_access = 33;
35pub const SYS_nice = 34;
36pub const SYS_sync = 36;
37pub const SYS_kill = 37;
38pub const SYS_rename = 38;
39pub const SYS_mkdir = 39;
40pub const SYS_rmdir = 40;
41pub const SYS_dup = 41;
42pub const SYS_pipe = 42;
43pub const SYS_times = 43;
44pub const SYS_brk = 45;
45pub const SYS_setgid = 46;
46pub const SYS_getgid = 47;
47pub const SYS_geteuid = 49;
48pub const SYS_getegid = 50;
49pub const SYS_acct = 51;
50pub const SYS_umount2 = 52;
51pub const SYS_ioctl = 54;
52pub const SYS_fcntl = 55;
53pub const SYS_setpgid = 57;
54pub const SYS_umask = 60;
55pub const SYS_chroot = 61;
56pub const SYS_ustat = 62;
57pub const SYS_dup2 = 63;
58pub const SYS_getppid = 64;
59pub const SYS_getpgrp = 65;
60pub const SYS_setsid = 66;
61pub const SYS_sigaction = 67;
62pub const SYS_setreuid = 70;
63pub const SYS_setregid = 71;
64pub const SYS_sigsuspend = 72;
65pub const SYS_sigpending = 73;
66pub const SYS_sethostname = 74;
67pub const SYS_setrlimit = 75;
68pub const SYS_getrusage = 77;
69pub const SYS_gettimeofday = 78;
70pub const SYS_settimeofday = 79;
71pub const SYS_getgroups = 80;
72pub const SYS_setgroups = 81;
73pub const SYS_symlink = 83;
74pub const SYS_readlink = 85;
75pub const SYS_uselib = 86;
76pub const SYS_swapon = 87;
77pub const SYS_reboot = 88;
78pub const SYS_munmap = 91;
79pub const SYS_truncate = 92;
80pub const SYS_ftruncate = 93;
81pub const SYS_fchmod = 94;
82pub const SYS_fchown = 95;
83pub const SYS_getpriority = 96;
84pub const SYS_setpriority = 97;
85pub const SYS_statfs = 99;
86pub const SYS_fstatfs = 100;
87pub const SYS_syslog = 103;
88pub const SYS_setitimer = 104;
89pub const SYS_getitimer = 105;
90pub const SYS_stat = 106;
91pub const SYS_lstat = 107;
92pub const SYS_fstat = 108;
93pub const SYS_vhangup = 111;
94pub const SYS_wait4 = 114;
95pub const SYS_swapoff = 115;
96pub const SYS_sysinfo = 116;
97pub const SYS_fsync = 118;
98pub const SYS_sigreturn = 119;
99pub const SYS_clone = 120;
100pub const SYS_setdomainname = 121;
101pub const SYS_uname = 122;
102pub const SYS_adjtimex = 124;
103pub const SYS_mprotect = 125;
104pub const SYS_sigprocmask = 126;
105pub const SYS_init_module = 128;
106pub const SYS_delete_module = 129;
107pub const SYS_quotactl = 131;
108pub const SYS_getpgid = 132;
109pub const SYS_fchdir = 133;
110pub const SYS_bdflush = 134;
111pub const SYS_sysfs = 135;
112pub const SYS_personality = 136;
113pub const SYS_setfsuid = 138;
114pub const SYS_setfsgid = 139;
115pub const SYS__llseek = 140;
116pub const SYS_getdents = 141;
117pub const SYS__newselect = 142;
118pub const SYS_flock = 143;
119pub const SYS_msync = 144;
120pub const SYS_readv = 145;
121pub const SYS_writev = 146;
122pub const SYS_getsid = 147;
123pub const SYS_fdatasync = 148;
124pub const SYS__sysctl = 149;
125pub const SYS_mlock = 150;
126pub const SYS_munlock = 151;
127pub const SYS_mlockall = 152;
128pub const SYS_munlockall = 153;
129pub const SYS_sched_setparam = 154;
130pub const SYS_sched_getparam = 155;
131pub const SYS_sched_setscheduler = 156;
132pub const SYS_sched_getscheduler = 157;
133pub const SYS_sched_yield = 158;
134pub const SYS_sched_get_priority_max = 159;
135pub const SYS_sched_get_priority_min = 160;
136pub const SYS_sched_rr_get_interval = 161;
137pub const SYS_nanosleep = 162;
138pub const SYS_mremap = 163;
139pub const SYS_setresuid = 164;
140pub const SYS_getresuid = 165;
141pub const SYS_poll = 168;
142pub const SYS_nfsservctl = 169;
143pub const SYS_setresgid = 170;
144pub const SYS_getresgid = 171;
145pub const SYS_prctl = 172;
146pub const SYS_rt_sigreturn = 173;
147pub const SYS_rt_sigaction = 174;
148pub const SYS_rt_sigprocmask = 175;
149pub const SYS_rt_sigpending = 176;
150pub const SYS_rt_sigtimedwait = 177;
151pub const SYS_rt_sigqueueinfo = 178;
152pub const SYS_rt_sigsuspend = 179;
153pub const SYS_pread64 = 180;
154pub const SYS_pwrite64 = 181;
155pub const SYS_chown = 182;
156pub const SYS_getcwd = 183;
157pub const SYS_capget = 184;
158pub const SYS_capset = 185;
159pub const SYS_sigaltstack = 186;
160pub const SYS_sendfile = 187;
161pub const SYS_vfork = 190;
162pub const SYS_ugetrlimit = 191;
163pub const SYS_mmap2 = 192;
164pub const SYS_truncate64 = 193;
165pub const SYS_ftruncate64 = 194;
166pub const SYS_stat64 = 195;
167pub const SYS_lstat64 = 196;
168pub const SYS_fstat64 = 197;
169pub const SYS_lchown32 = 198;
170pub const SYS_getuid32 = 199;
171pub const SYS_getgid32 = 200;
172pub const SYS_geteuid32 = 201;
173pub const SYS_getegid32 = 202;
174pub const SYS_setreuid32 = 203;
175pub const SYS_setregid32 = 204;
176pub const SYS_getgroups32 = 205;
177pub const SYS_setgroups32 = 206;
178pub const SYS_fchown32 = 207;
179pub const SYS_setresuid32 = 208;
180pub const SYS_getresuid32 = 209;
181pub const SYS_setresgid32 = 210;
182pub const SYS_getresgid32 = 211;
183pub const SYS_chown32 = 212;
184pub const SYS_setuid32 = 213;
185pub const SYS_setgid32 = 214;
186pub const SYS_setfsuid32 = 215;
187pub const SYS_setfsgid32 = 216;
188pub const SYS_getdents64 = 217;
189pub const SYS_pivot_root = 218;
190pub const SYS_mincore = 219;
191pub const SYS_madvise = 220;
192pub const SYS_fcntl64 = 221;
193pub const SYS_gettid = 224;
194pub const SYS_readahead = 225;
195pub const SYS_setxattr = 226;
196pub const SYS_lsetxattr = 227;
197pub const SYS_fsetxattr = 228;
198pub const SYS_getxattr = 229;
199pub const SYS_lgetxattr = 230;
200pub const SYS_fgetxattr = 231;
201pub const SYS_listxattr = 232;
202pub const SYS_llistxattr = 233;
203pub const SYS_flistxattr = 234;
204pub const SYS_removexattr = 235;
205pub const SYS_lremovexattr = 236;
206pub const SYS_fremovexattr = 237;
207pub const SYS_tkill = 238;
208pub const SYS_sendfile64 = 239;
209pub const SYS_futex = 240;
210pub const SYS_sched_setaffinity = 241;
211pub const SYS_sched_getaffinity = 242;
212pub const SYS_io_setup = 243;
213pub const SYS_io_destroy = 244;
214pub const SYS_io_getevents = 245;
215pub const SYS_io_submit = 246;
216pub const SYS_io_cancel = 247;
217pub const SYS_exit_group = 248;
218pub const SYS_lookup_dcookie = 249;
219pub const SYS_epoll_create = 250;
220pub const SYS_epoll_ctl = 251;
221pub const SYS_epoll_wait = 252;
222pub const SYS_remap_file_pages = 253;
223pub const SYS_set_tid_address = 256;
224pub const SYS_timer_create = 257;
225pub const SYS_timer_settime = 258;
226pub const SYS_timer_gettime = 259;
227pub const SYS_timer_getoverrun = 260;
228pub const SYS_timer_delete = 261;
229pub const SYS_clock_settime = 262;
230pub const SYS_clock_gettime = 263;
231pub const SYS_clock_getres = 264;
232pub const SYS_clock_nanosleep = 265;
233pub const SYS_statfs64 = 266;
234pub const SYS_fstatfs64 = 267;
235pub const SYS_tgkill = 268;
236pub const SYS_utimes = 269;
237pub const SYS_fadvise64_64 = 270;
238pub const SYS_arm_fadvise64_64 = 270;
239pub const SYS_pciconfig_iobase = 271;
240pub const SYS_pciconfig_read = 272;
241pub const SYS_pciconfig_write = 273;
242pub const SYS_mq_open = 274;
243pub const SYS_mq_unlink = 275;
244pub const SYS_mq_timedsend = 276;
245pub const SYS_mq_timedreceive = 277;
246pub const SYS_mq_notify = 278;
247pub const SYS_mq_getsetattr = 279;
248pub const SYS_waitid = 280;
249pub const SYS_socket = 281;
250pub const SYS_bind = 282;
251pub const SYS_connect = 283;
252pub const SYS_listen = 284;
253pub const SYS_accept = 285;
254pub const SYS_getsockname = 286;
255pub const SYS_getpeername = 287;
256pub const SYS_socketpair = 288;
257pub const SYS_send = 289;
258pub const SYS_sendto = 290;
259pub const SYS_recv = 291;
260pub const SYS_recvfrom = 292;
261pub const SYS_shutdown = 293;
262pub const SYS_setsockopt = 294;
263pub const SYS_getsockopt = 295;
264pub const SYS_sendmsg = 296;
265pub const SYS_recvmsg = 297;
266pub const SYS_semop = 298;
267pub const SYS_semget = 299;
268pub const SYS_semctl = 300;
269pub const SYS_msgsnd = 301;
270pub const SYS_msgrcv = 302;
271pub const SYS_msgget = 303;
272pub const SYS_msgctl = 304;
273pub const SYS_shmat = 305;
274pub const SYS_shmdt = 306;
275pub const SYS_shmget = 307;
276pub const SYS_shmctl = 308;
277pub const SYS_add_key = 309;
278pub const SYS_request_key = 310;
279pub const SYS_keyctl = 311;
280pub const SYS_semtimedop = 312;
281pub const SYS_vserver = 313;
282pub const SYS_ioprio_set = 314;
283pub const SYS_ioprio_get = 315;
284pub const SYS_inotify_init = 316;
285pub const SYS_inotify_add_watch = 317;
286pub const SYS_inotify_rm_watch = 318;
287pub const SYS_mbind = 319;
288pub const SYS_get_mempolicy = 320;
289pub const SYS_set_mempolicy = 321;
290pub const SYS_openat = 322;
291pub const SYS_mkdirat = 323;
292pub const SYS_mknodat = 324;
293pub const SYS_fchownat = 325;
294pub const SYS_futimesat = 326;
295pub const SYS_fstatat64 = 327;
296pub const SYS_unlinkat = 328;
297pub const SYS_renameat = 329;
298pub const SYS_linkat = 330;
299pub const SYS_symlinkat = 331;
300pub const SYS_readlinkat = 332;
301pub const SYS_fchmodat = 333;
302pub const SYS_faccessat = 334;
303pub const SYS_pselect6 = 335;
304pub const SYS_ppoll = 336;
305pub const SYS_unshare = 337;
306pub const SYS_set_robust_list = 338;
307pub const SYS_get_robust_list = 339;
308pub const SYS_splice = 340;
309pub const SYS_sync_file_range2 = 341;
310pub const SYS_arm_sync_file_range = 341;
311pub const SYS_tee = 342;
312pub const SYS_vmsplice = 343;
313pub const SYS_move_pages = 344;
314pub const SYS_getcpu = 345;
315pub const SYS_epoll_pwait = 346;
316pub const SYS_kexec_load = 347;
317pub const SYS_utimensat = 348;
318pub const SYS_signalfd = 349;
319pub const SYS_timerfd_create = 350;
320pub const SYS_eventfd = 351;
321pub const SYS_fallocate = 352;
322pub const SYS_timerfd_settime = 353;
323pub const SYS_timerfd_gettime = 354;
324pub const SYS_signalfd4 = 355;
325pub const SYS_eventfd2 = 356;
326pub const SYS_epoll_create1 = 357;
327pub const SYS_dup3 = 358;
328pub const SYS_pipe2 = 359;
329pub const SYS_inotify_init1 = 360;
330pub const SYS_preadv = 361;
331pub const SYS_pwritev = 362;
332pub const SYS_rt_tgsigqueueinfo = 363;
333pub const SYS_perf_event_open = 364;
334pub const SYS_recvmmsg = 365;
335pub const SYS_accept4 = 366;
336pub const SYS_fanotify_init = 367;
337pub const SYS_fanotify_mark = 368;
338pub const SYS_prlimit64 = 369;
339pub const SYS_name_to_handle_at = 370;
340pub const SYS_open_by_handle_at = 371;
341pub const SYS_clock_adjtime = 372;
342pub const SYS_syncfs = 373;
343pub const SYS_sendmmsg = 374;
344pub const SYS_setns = 375;
345pub const SYS_process_vm_readv = 376;
346pub const SYS_process_vm_writev = 377;
347pub const SYS_kcmp = 378;
348pub const SYS_finit_module = 379;
349pub const SYS_sched_setattr = 380;
350pub const SYS_sched_getattr = 381;
351pub const SYS_renameat2 = 382;
352pub const SYS_seccomp = 383;
353pub const SYS_getrandom = 384;
354pub const SYS_memfd_create = 385;
355pub const SYS_bpf = 386;
356pub const SYS_execveat = 387;
357pub const SYS_userfaultfd = 388;
358pub const SYS_membarrier = 389;
359pub const SYS_mlock2 = 390;
360pub const SYS_copy_file_range = 391;
361pub const SYS_preadv2 = 392;
362pub const SYS_pwritev2 = 393;
363pub const SYS_pkey_mprotect = 394;
364pub const SYS_pkey_alloc = 395;
365pub const SYS_pkey_free = 396;
366pub const SYS_statx = 397;
367pub const SYS_rseq = 398;
368pub const SYS_io_pgetevents = 399;
369pub const SYS_migrate_pages = 400;
370pub const SYS_kexec_file_load = 401;
371pub const SYS_clock_gettime64 = 403;
372pub const SYS_clock_settime64 = 404;
373pub const SYS_clock_adjtime64 = 405;
374pub const SYS_clock_getres_time64 = 406;
375pub const SYS_clock_nanosleep_time64 = 407;
376pub const SYS_timer_gettime64 = 408;
377pub const SYS_timer_settime64 = 409;
378pub const SYS_timerfd_gettime64 = 410;
379pub const SYS_timerfd_settime64 = 411;
380pub const SYS_utimensat_time64 = 412;
381pub const SYS_pselect6_time64 = 413;
382pub const SYS_ppoll_time64 = 414;
383pub const SYS_io_pgetevents_time64 = 416;
384pub const SYS_recvmmsg_time64 = 417;
385pub const SYS_mq_timedsend_time64 = 418;
386pub const SYS_mq_timedreceive_time64 = 419;
387pub const SYS_semtimedop_time64 = 420;
388pub const SYS_rt_sigtimedwait_time64 = 421;
389pub const SYS_futex_time64 = 422;
390pub const SYS_sched_rr_get_interval_time64 = 423;
391pub const SYS_pidfd_send_signal = 424;
392pub const SYS_io_uring_setup = 425;
393pub const SYS_io_uring_enter = 426;
394pub const SYS_io_uring_register = 427;
395pub const SYS_open_tree = 428;
396pub const SYS_move_mount = 429;
397pub const SYS_fsopen = 430;
398pub const SYS_fsconfig = 431;
399pub const SYS_fsmount = 432;
400pub const SYS_fspick = 433;
401pub const SYS_pidfd_open = 434;
402pub const SYS_clone3 = 435;
403pub const SYS_openat2 = 437;
404pub const SYS_pidfd_getfd = 438;
12pub const SYS = extern enum(usize) {
13 restart_syscall = 0,
14 exit = 1,
15 fork = 2,
16 read = 3,
17 write = 4,
18 open = 5,
19 close = 6,
20 creat = 8,
21 link = 9,
22 unlink = 10,
23 execve = 11,
24 chdir = 12,
25 mknod = 14,
26 chmod = 15,
27 lchown = 16,
28 lseek = 19,
29 getpid = 20,
30 mount = 21,
31 setuid = 23,
32 getuid = 24,
33 ptrace = 26,
34 pause = 29,
35 access = 33,
36 nice = 34,
37 sync = 36,
38 kill = 37,
39 rename = 38,
40 mkdir = 39,
41 rmdir = 40,
42 dup = 41,
43 pipe = 42,
44 times = 43,
45 brk = 45,
46 setgid = 46,
47 getgid = 47,
48 geteuid = 49,
49 getegid = 50,
50 acct = 51,
51 umount2 = 52,
52 ioctl = 54,
53 fcntl = 55,
54 setpgid = 57,
55 umask = 60,
56 chroot = 61,
57 ustat = 62,
58 dup2 = 63,
59 getppid = 64,
60 getpgrp = 65,
61 setsid = 66,
62 sigaction = 67,
63 setreuid = 70,
64 setregid = 71,
65 sigsuspend = 72,
66 sigpending = 73,
67 sethostname = 74,
68 setrlimit = 75,
69 getrusage = 77,
70 gettimeofday = 78,
71 settimeofday = 79,
72 getgroups = 80,
73 setgroups = 81,
74 symlink = 83,
75 readlink = 85,
76 uselib = 86,
77 swapon = 87,
78 reboot = 88,
79 munmap = 91,
80 truncate = 92,
81 ftruncate = 93,
82 fchmod = 94,
83 fchown = 95,
84 getpriority = 96,
85 setpriority = 97,
86 statfs = 99,
87 fstatfs = 100,
88 syslog = 103,
89 setitimer = 104,
90 getitimer = 105,
91 stat = 106,
92 lstat = 107,
93 fstat = 108,
94 vhangup = 111,
95 wait4 = 114,
96 swapoff = 115,
97 sysinfo = 116,
98 fsync = 118,
99 sigreturn = 119,
100 clone = 120,
101 setdomainname = 121,
102 uname = 122,
103 adjtimex = 124,
104 mprotect = 125,
105 sigprocmask = 126,
106 init_module = 128,
107 delete_module = 129,
108 quotactl = 131,
109 getpgid = 132,
110 fchdir = 133,
111 bdflush = 134,
112 sysfs = 135,
113 personality = 136,
114 setfsuid = 138,
115 setfsgid = 139,
116 _llseek = 140,
117 getdents = 141,
118 _newselect = 142,
119 flock = 143,
120 msync = 144,
121 readv = 145,
122 writev = 146,
123 getsid = 147,
124 fdatasync = 148,
125 _sysctl = 149,
126 mlock = 150,
127 munlock = 151,
128 mlockall = 152,
129 munlockall = 153,
130 sched_setparam = 154,
131 sched_getparam = 155,
132 sched_setscheduler = 156,
133 sched_getscheduler = 157,
134 sched_yield = 158,
135 sched_get_priority_max = 159,
136 sched_get_priority_min = 160,
137 sched_rr_get_interval = 161,
138 nanosleep = 162,
139 mremap = 163,
140 setresuid = 164,
141 getresuid = 165,
142 poll = 168,
143 nfsservctl = 169,
144 setresgid = 170,
145 getresgid = 171,
146 prctl = 172,
147 rt_sigreturn = 173,
148 rt_sigaction = 174,
149 rt_sigprocmask = 175,
150 rt_sigpending = 176,
151 rt_sigtimedwait = 177,
152 rt_sigqueueinfo = 178,
153 rt_sigsuspend = 179,
154 pread64 = 180,
155 pwrite64 = 181,
156 chown = 182,
157 getcwd = 183,
158 capget = 184,
159 capset = 185,
160 sigaltstack = 186,
161 sendfile = 187,
162 vfork = 190,
163 ugetrlimit = 191,
164 mmap2 = 192,
165 truncate64 = 193,
166 ftruncate64 = 194,
167 stat64 = 195,
168 lstat64 = 196,
169 fstat64 = 197,
170 lchown32 = 198,
171 getuid32 = 199,
172 getgid32 = 200,
173 geteuid32 = 201,
174 getegid32 = 202,
175 setreuid32 = 203,
176 setregid32 = 204,
177 getgroups32 = 205,
178 setgroups32 = 206,
179 fchown32 = 207,
180 setresuid32 = 208,
181 getresuid32 = 209,
182 setresgid32 = 210,
183 getresgid32 = 211,
184 chown32 = 212,
185 setuid32 = 213,
186 setgid32 = 214,
187 setfsuid32 = 215,
188 setfsgid32 = 216,
189 getdents64 = 217,
190 pivot_root = 218,
191 mincore = 219,
192 madvise = 220,
193 fcntl64 = 221,
194 gettid = 224,
195 readahead = 225,
196 setxattr = 226,
197 lsetxattr = 227,
198 fsetxattr = 228,
199 getxattr = 229,
200 lgetxattr = 230,
201 fgetxattr = 231,
202 listxattr = 232,
203 llistxattr = 233,
204 flistxattr = 234,
205 removexattr = 235,
206 lremovexattr = 236,
207 fremovexattr = 237,
208 tkill = 238,
209 sendfile64 = 239,
210 futex = 240,
211 sched_setaffinity = 241,
212 sched_getaffinity = 242,
213 io_setup = 243,
214 io_destroy = 244,
215 io_getevents = 245,
216 io_submit = 246,
217 io_cancel = 247,
218 exit_group = 248,
219 lookup_dcookie = 249,
220 epoll_create = 250,
221 epoll_ctl = 251,
222 epoll_wait = 252,
223 remap_file_pages = 253,
224 set_tid_address = 256,
225 timer_create = 257,
226 timer_settime = 258,
227 timer_gettime = 259,
228 timer_getoverrun = 260,
229 timer_delete = 261,
230 clock_settime = 262,
231 clock_gettime = 263,
232 clock_getres = 264,
233 clock_nanosleep = 265,
234 statfs64 = 266,
235 fstatfs64 = 267,
236 tgkill = 268,
237 utimes = 269,
238 fadvise64_64 = 270,
239 arm_fadvise64_64 = 270,
240 pciconfig_iobase = 271,
241 pciconfig_read = 272,
242 pciconfig_write = 273,
243 mq_open = 274,
244 mq_unlink = 275,
245 mq_timedsend = 276,
246 mq_timedreceive = 277,
247 mq_notify = 278,
248 mq_getsetattr = 279,
249 waitid = 280,
250 socket = 281,
251 bind = 282,
252 connect = 283,
253 listen = 284,
254 accept = 285,
255 getsockname = 286,
256 getpeername = 287,
257 socketpair = 288,
258 send = 289,
259 sendto = 290,
260 recv = 291,
261 recvfrom = 292,
262 shutdown = 293,
263 setsockopt = 294,
264 getsockopt = 295,
265 sendmsg = 296,
266 recvmsg = 297,
267 semop = 298,
268 semget = 299,
269 semctl = 300,
270 msgsnd = 301,
271 msgrcv = 302,
272 msgget = 303,
273 msgctl = 304,
274 shmat = 305,
275 shmdt = 306,
276 shmget = 307,
277 shmctl = 308,
278 add_key = 309,
279 request_key = 310,
280 keyctl = 311,
281 semtimedop = 312,
282 vserver = 313,
283 ioprio_set = 314,
284 ioprio_get = 315,
285 inotify_init = 316,
286 inotify_add_watch = 317,
287 inotify_rm_watch = 318,
288 mbind = 319,
289 get_mempolicy = 320,
290 set_mempolicy = 321,
291 openat = 322,
292 mkdirat = 323,
293 mknodat = 324,
294 fchownat = 325,
295 futimesat = 326,
296 fstatat64 = 327,
297 unlinkat = 328,
298 renameat = 329,
299 linkat = 330,
300 symlinkat = 331,
301 readlinkat = 332,
302 fchmodat = 333,
303 faccessat = 334,
304 pselect6 = 335,
305 ppoll = 336,
306 unshare = 337,
307 set_robust_list = 338,
308 get_robust_list = 339,
309 splice = 340,
310 sync_file_range2 = 341,
311 arm_sync_file_range = 341,
312 tee = 342,
313 vmsplice = 343,
314 move_pages = 344,
315 getcpu = 345,
316 epoll_pwait = 346,
317 kexec_load = 347,
318 utimensat = 348,
319 signalfd = 349,
320 timerfd_create = 350,
321 eventfd = 351,
322 fallocate = 352,
323 timerfd_settime = 353,
324 timerfd_gettime = 354,
325 signalfd4 = 355,
326 eventfd2 = 356,
327 epoll_create1 = 357,
328 dup3 = 358,
329 pipe2 = 359,
330 inotify_init1 = 360,
331 preadv = 361,
332 pwritev = 362,
333 rt_tgsigqueueinfo = 363,
334 perf_event_open = 364,
335 recvmmsg = 365,
336 accept4 = 366,
337 fanotify_init = 367,
338 fanotify_mark = 368,
339 prlimit64 = 369,
340 name_to_handle_at = 370,
341 open_by_handle_at = 371,
342 clock_adjtime = 372,
343 syncfs = 373,
344 sendmmsg = 374,
345 setns = 375,
346 process_vm_readv = 376,
347 process_vm_writev = 377,
348 kcmp = 378,
349 finit_module = 379,
350 sched_setattr = 380,
351 sched_getattr = 381,
352 renameat2 = 382,
353 seccomp = 383,
354 getrandom = 384,
355 memfd_create = 385,
356 bpf = 386,
357 execveat = 387,
358 userfaultfd = 388,
359 membarrier = 389,
360 mlock2 = 390,
361 copy_file_range = 391,
362 preadv2 = 392,
363 pwritev2 = 393,
364 pkey_mprotect = 394,
365 pkey_alloc = 395,
366 pkey_free = 396,
367 statx = 397,
368 rseq = 398,
369 io_pgetevents = 399,
370 migrate_pages = 400,
371 kexec_file_load = 401,
372 clock_gettime64 = 403,
373 clock_settime64 = 404,
374 clock_adjtime64 = 405,
375 clock_getres_time64 = 406,
376 clock_nanosleep_time64 = 407,
377 timer_gettime64 = 408,
378 timer_settime64 = 409,
379 timerfd_gettime64 = 410,
380 timerfd_settime64 = 411,
381 utimensat_time64 = 412,
382 pselect6_time64 = 413,
383 ppoll_time64 = 414,
384 io_pgetevents_time64 = 416,
385 recvmmsg_time64 = 417,
386 mq_timedsend_time64 = 418,
387 mq_timedreceive_time64 = 419,
388 semtimedop_time64 = 420,
389 rt_sigtimedwait_time64 = 421,
390 futex_time64 = 422,
391 sched_rr_get_interval_time64 = 423,
392 pidfd_send_signal = 424,
393 io_uring_setup = 425,
394 io_uring_enter = 426,
395 io_uring_register = 427,
396 open_tree = 428,
397 move_mount = 429,
398 fsopen = 430,
399 fsconfig = 431,
400 fsmount = 432,
401 fspick = 433,
402 pidfd_open = 434,
403 clone3 = 435,
404 openat2 = 437,
405 pidfd_getfd = 438,
405406
406pub const SYS_breakpoint = 0x0f0001;
407pub const SYS_cacheflush = 0x0f0002;
408pub const SYS_usr26 = 0x0f0003;
409pub const SYS_usr32 = 0x0f0004;
410pub const SYS_set_tls = 0x0f0005;
411pub const SYS_get_tls = 0x0f0006;
407 breakpoint = 0x0f0001,
408 cacheflush = 0x0f0002,
409 usr26 = 0x0f0003,
410 usr32 = 0x0f0004,
411 set_tls = 0x0f0005,
412 get_tls = 0x0f0006,
413
414 _,
415};
412416
413417pub const MMAP2_UNIT = 4096;
414418
lib/std/os/bits/linux/arm64.zig+296-293
......@@ -10,300 +10,303 @@ const uid_t = linux.uid_t;
1010const gid_t = linux.gid_t;
1111const stack_t = linux.stack_t;
1212const 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;
15pub const SYS_io_destroy = 1;
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;
308 _,
309};
307310
308311pub const O_CREAT = 0o100;
309312pub const O_EXCL = 0o200;
lib/std/os/bits/linux/i386.zig+429-425
......@@ -11,431 +11,435 @@ const gid_t = linux.gid_t;
1111const stack_t = linux.stack_t;
1212const sigset_t = linux.sigset_t;
1313
14pub const SYS_restart_syscall = 0;
15pub const SYS_exit = 1;
16pub const SYS_fork = 2;
17pub const SYS_read = 3;
18pub const SYS_write = 4;
19pub const SYS_open = 5;
20pub const SYS_close = 6;
21pub const SYS_waitpid = 7;
22pub const SYS_creat = 8;
23pub const SYS_link = 9;
24pub const SYS_unlink = 10;
25pub const SYS_execve = 11;
26pub const SYS_chdir = 12;
27pub const SYS_time = 13;
28pub const SYS_mknod = 14;
29pub const SYS_chmod = 15;
30pub const SYS_lchown = 16;
31pub const SYS_break = 17;
32pub const SYS_oldstat = 18;
33pub const SYS_lseek = 19;
34pub const SYS_getpid = 20;
35pub const SYS_mount = 21;
36pub const SYS_umount = 22;
37pub const SYS_setuid = 23;
38pub const SYS_getuid = 24;
39pub const SYS_stime = 25;
40pub const SYS_ptrace = 26;
41pub const SYS_alarm = 27;
42pub const SYS_oldfstat = 28;
43pub const SYS_pause = 29;
44pub const SYS_utime = 30;
45pub const SYS_stty = 31;
46pub const SYS_gtty = 32;
47pub const SYS_access = 33;
48pub const SYS_nice = 34;
49pub const SYS_ftime = 35;
50pub const SYS_sync = 36;
51pub const SYS_kill = 37;
52pub const SYS_rename = 38;
53pub const SYS_mkdir = 39;
54pub const SYS_rmdir = 40;
55pub const SYS_dup = 41;
56pub const SYS_pipe = 42;
57pub const SYS_times = 43;
58pub const SYS_prof = 44;
59pub const SYS_brk = 45;
60pub const SYS_setgid = 46;
61pub const SYS_getgid = 47;
62pub const SYS_signal = 48;
63pub const SYS_geteuid = 49;
64pub const SYS_getegid = 50;
65pub const SYS_acct = 51;
66pub const SYS_umount2 = 52;
67pub const SYS_lock = 53;
68pub const SYS_ioctl = 54;
69pub const SYS_fcntl = 55;
70pub const SYS_mpx = 56;
71pub const SYS_setpgid = 57;
72pub const SYS_ulimit = 58;
73pub const SYS_oldolduname = 59;
74pub const SYS_umask = 60;
75pub const SYS_chroot = 61;
76pub const SYS_ustat = 62;
77pub const SYS_dup2 = 63;
78pub const SYS_getppid = 64;
79pub const SYS_getpgrp = 65;
80pub const SYS_setsid = 66;
81pub const SYS_sigaction = 67;
82pub const SYS_sgetmask = 68;
83pub const SYS_ssetmask = 69;
84pub const SYS_setreuid = 70;
85pub const SYS_setregid = 71;
86pub const SYS_sigsuspend = 72;
87pub const SYS_sigpending = 73;
88pub const SYS_sethostname = 74;
89pub const SYS_setrlimit = 75;
90pub const SYS_getrlimit = 76;
91pub const SYS_getrusage = 77;
92pub const SYS_gettimeofday = 78;
93pub const SYS_settimeofday = 79;
94pub const SYS_getgroups = 80;
95pub const SYS_setgroups = 81;
96pub const SYS_select = 82;
97pub const SYS_symlink = 83;
98pub const SYS_oldlstat = 84;
99pub const SYS_readlink = 85;
100pub const SYS_uselib = 86;
101pub const SYS_swapon = 87;
102pub const SYS_reboot = 88;
103pub const SYS_readdir = 89;
104pub const SYS_mmap = 90;
105pub const SYS_munmap = 91;
106pub const SYS_truncate = 92;
107pub const SYS_ftruncate = 93;
108pub const SYS_fchmod = 94;
109pub const SYS_fchown = 95;
110pub const SYS_getpriority = 96;
111pub const SYS_setpriority = 97;
112pub const SYS_profil = 98;
113pub const SYS_statfs = 99;
114pub const SYS_fstatfs = 100;
115pub const SYS_ioperm = 101;
116pub const SYS_socketcall = 102;
117pub const SYS_syslog = 103;
118pub const SYS_setitimer = 104;
119pub const SYS_getitimer = 105;
120pub const SYS_stat = 106;
121pub const SYS_lstat = 107;
122pub const SYS_fstat = 108;
123pub const SYS_olduname = 109;
124pub const SYS_iopl = 110;
125pub const SYS_vhangup = 111;
126pub const SYS_idle = 112;
127pub const SYS_vm86old = 113;
128pub const SYS_wait4 = 114;
129pub const SYS_swapoff = 115;
130pub const SYS_sysinfo = 116;
131pub const SYS_ipc = 117;
132pub const SYS_fsync = 118;
133pub const SYS_sigreturn = 119;
134pub const SYS_clone = 120;
135pub const SYS_setdomainname = 121;
136pub const SYS_uname = 122;
137pub const SYS_modify_ldt = 123;
138pub const SYS_adjtimex = 124;
139pub const SYS_mprotect = 125;
140pub const SYS_sigprocmask = 126;
141pub const SYS_create_module = 127;
142pub const SYS_init_module = 128;
143pub const SYS_delete_module = 129;
144pub const SYS_get_kernel_syms = 130;
145pub const SYS_quotactl = 131;
146pub const SYS_getpgid = 132;
147pub const SYS_fchdir = 133;
148pub const SYS_bdflush = 134;
149pub const SYS_sysfs = 135;
150pub const SYS_personality = 136;
151pub const SYS_afs_syscall = 137;
152pub const SYS_setfsuid = 138;
153pub const SYS_setfsgid = 139;
154pub const SYS__llseek = 140;
155pub const SYS_getdents = 141;
156pub const SYS__newselect = 142;
157pub const SYS_flock = 143;
158pub const SYS_msync = 144;
159pub const SYS_readv = 145;
160pub const SYS_writev = 146;
161pub const SYS_getsid = 147;
162pub const SYS_fdatasync = 148;
163pub const SYS__sysctl = 149;
164pub const SYS_mlock = 150;
165pub const SYS_munlock = 151;
166pub const SYS_mlockall = 152;
167pub const SYS_munlockall = 153;
168pub const SYS_sched_setparam = 154;
169pub const SYS_sched_getparam = 155;
170pub const SYS_sched_setscheduler = 156;
171pub const SYS_sched_getscheduler = 157;
172pub const SYS_sched_yield = 158;
173pub const SYS_sched_get_priority_max = 159;
174pub const SYS_sched_get_priority_min = 160;
175pub const SYS_sched_rr_get_interval = 161;
176pub const SYS_nanosleep = 162;
177pub const SYS_mremap = 163;
178pub const SYS_setresuid = 164;
179pub const SYS_getresuid = 165;
180pub const SYS_vm86 = 166;
181pub const SYS_query_module = 167;
182pub const SYS_poll = 168;
183pub const SYS_nfsservctl = 169;
184pub const SYS_setresgid = 170;
185pub const SYS_getresgid = 171;
186pub const SYS_prctl = 172;
187pub const SYS_rt_sigreturn = 173;
188pub const SYS_rt_sigaction = 174;
189pub const SYS_rt_sigprocmask = 175;
190pub const SYS_rt_sigpending = 176;
191pub const SYS_rt_sigtimedwait = 177;
192pub const SYS_rt_sigqueueinfo = 178;
193pub const SYS_rt_sigsuspend = 179;
194pub const SYS_pread64 = 180;
195pub const SYS_pwrite64 = 181;
196pub const SYS_chown = 182;
197pub const SYS_getcwd = 183;
198pub const SYS_capget = 184;
199pub const SYS_capset = 185;
200pub const SYS_sigaltstack = 186;
201pub const SYS_sendfile = 187;
202pub const SYS_getpmsg = 188;
203pub const SYS_putpmsg = 189;
204pub const SYS_vfork = 190;
205pub const SYS_ugetrlimit = 191;
206pub const SYS_mmap2 = 192;
207pub const SYS_truncate64 = 193;
208pub const SYS_ftruncate64 = 194;
209pub const SYS_stat64 = 195;
210pub const SYS_lstat64 = 196;
211pub const SYS_fstat64 = 197;
212pub const SYS_lchown32 = 198;
213pub const SYS_getuid32 = 199;
214pub const SYS_getgid32 = 200;
215pub const SYS_geteuid32 = 201;
216pub const SYS_getegid32 = 202;
217pub const SYS_setreuid32 = 203;
218pub const SYS_setregid32 = 204;
219pub const SYS_getgroups32 = 205;
220pub const SYS_setgroups32 = 206;
221pub const SYS_fchown32 = 207;
222pub const SYS_setresuid32 = 208;
223pub const SYS_getresuid32 = 209;
224pub const SYS_setresgid32 = 210;
225pub const SYS_getresgid32 = 211;
226pub const SYS_chown32 = 212;
227pub const SYS_setuid32 = 213;
228pub const SYS_setgid32 = 214;
229pub const SYS_setfsuid32 = 215;
230pub const SYS_setfsgid32 = 216;
231pub const SYS_pivot_root = 217;
232pub const SYS_mincore = 218;
233pub const SYS_madvise = 219;
234pub const SYS_getdents64 = 220;
235pub const SYS_fcntl64 = 221;
236pub const SYS_gettid = 224;
237pub const SYS_readahead = 225;
238pub const SYS_setxattr = 226;
239pub const SYS_lsetxattr = 227;
240pub const SYS_fsetxattr = 228;
241pub const SYS_getxattr = 229;
242pub const SYS_lgetxattr = 230;
243pub const SYS_fgetxattr = 231;
244pub const SYS_listxattr = 232;
245pub const SYS_llistxattr = 233;
246pub const SYS_flistxattr = 234;
247pub const SYS_removexattr = 235;
248pub const SYS_lremovexattr = 236;
249pub const SYS_fremovexattr = 237;
250pub const SYS_tkill = 238;
251pub const SYS_sendfile64 = 239;
252pub const SYS_futex = 240;
253pub const SYS_sched_setaffinity = 241;
254pub const SYS_sched_getaffinity = 242;
255pub const SYS_set_thread_area = 243;
256pub const SYS_get_thread_area = 244;
257pub const SYS_io_setup = 245;
258pub const SYS_io_destroy = 246;
259pub const SYS_io_getevents = 247;
260pub const SYS_io_submit = 248;
261pub const SYS_io_cancel = 249;
262pub const SYS_fadvise64 = 250;
263pub const SYS_exit_group = 252;
264pub const SYS_lookup_dcookie = 253;
265pub const SYS_epoll_create = 254;
266pub const SYS_epoll_ctl = 255;
267pub const SYS_epoll_wait = 256;
268pub const SYS_remap_file_pages = 257;
269pub const SYS_set_tid_address = 258;
270pub const SYS_timer_create = 259;
271pub const SYS_timer_settime = SYS_timer_create + 1;
272pub const SYS_timer_gettime = SYS_timer_create + 2;
273pub const SYS_timer_getoverrun = SYS_timer_create + 3;
274pub const SYS_timer_delete = SYS_timer_create + 4;
275pub const SYS_clock_settime = SYS_timer_create + 5;
276pub const SYS_clock_gettime = SYS_timer_create + 6;
277pub const SYS_clock_getres = SYS_timer_create + 7;
278pub const SYS_clock_nanosleep = SYS_timer_create + 8;
279pub const SYS_statfs64 = 268;
280pub const SYS_fstatfs64 = 269;
281pub const SYS_tgkill = 270;
282pub const SYS_utimes = 271;
283pub const SYS_fadvise64_64 = 272;
284pub const SYS_vserver = 273;
285pub const SYS_mbind = 274;
286pub const SYS_get_mempolicy = 275;
287pub const SYS_set_mempolicy = 276;
288pub const SYS_mq_open = 277;
289pub const SYS_mq_unlink = SYS_mq_open + 1;
290pub const SYS_mq_timedsend = SYS_mq_open + 2;
291pub const SYS_mq_timedreceive = SYS_mq_open + 3;
292pub const SYS_mq_notify = SYS_mq_open + 4;
293pub const SYS_mq_getsetattr = SYS_mq_open + 5;
294pub const SYS_kexec_load = 283;
295pub const SYS_waitid = 284;
296pub const SYS_add_key = 286;
297pub const SYS_request_key = 287;
298pub const SYS_keyctl = 288;
299pub const SYS_ioprio_set = 289;
300pub const SYS_ioprio_get = 290;
301pub const SYS_inotify_init = 291;
302pub const SYS_inotify_add_watch = 292;
303pub const SYS_inotify_rm_watch = 293;
304pub const SYS_migrate_pages = 294;
305pub const SYS_openat = 295;
306pub const SYS_mkdirat = 296;
307pub const SYS_mknodat = 297;
308pub const SYS_fchownat = 298;
309pub const SYS_futimesat = 299;
310pub const SYS_fstatat64 = 300;
311pub const SYS_unlinkat = 301;
312pub const SYS_renameat = 302;
313pub const SYS_linkat = 303;
314pub const SYS_symlinkat = 304;
315pub const SYS_readlinkat = 305;
316pub const SYS_fchmodat = 306;
317pub const SYS_faccessat = 307;
318pub const SYS_pselect6 = 308;
319pub const SYS_ppoll = 309;
320pub const SYS_unshare = 310;
321pub const SYS_set_robust_list = 311;
322pub const SYS_get_robust_list = 312;
323pub const SYS_splice = 313;
324pub const SYS_sync_file_range = 314;
325pub const SYS_tee = 315;
326pub const SYS_vmsplice = 316;
327pub const SYS_move_pages = 317;
328pub const SYS_getcpu = 318;
329pub const SYS_epoll_pwait = 319;
330pub const SYS_utimensat = 320;
331pub const SYS_signalfd = 321;
332pub const SYS_timerfd_create = 322;
333pub const SYS_eventfd = 323;
334pub const SYS_fallocate = 324;
335pub const SYS_timerfd_settime = 325;
336pub const SYS_timerfd_gettime = 326;
337pub const SYS_signalfd4 = 327;
338pub const SYS_eventfd2 = 328;
339pub const SYS_epoll_create1 = 329;
340pub const SYS_dup3 = 330;
341pub const SYS_pipe2 = 331;
342pub const SYS_inotify_init1 = 332;
343pub const SYS_preadv = 333;
344pub const SYS_pwritev = 334;
345pub const SYS_rt_tgsigqueueinfo = 335;
346pub const SYS_perf_event_open = 336;
347pub const SYS_recvmmsg = 337;
348pub const SYS_fanotify_init = 338;
349pub const SYS_fanotify_mark = 339;
350pub const SYS_prlimit64 = 340;
351pub const SYS_name_to_handle_at = 341;
352pub const SYS_open_by_handle_at = 342;
353pub const SYS_clock_adjtime = 343;
354pub const SYS_syncfs = 344;
355pub const SYS_sendmmsg = 345;
356pub const SYS_setns = 346;
357pub const SYS_process_vm_readv = 347;
358pub const SYS_process_vm_writev = 348;
359pub const SYS_kcmp = 349;
360pub const SYS_finit_module = 350;
361pub const SYS_sched_setattr = 351;
362pub const SYS_sched_getattr = 352;
363pub const SYS_renameat2 = 353;
364pub const SYS_seccomp = 354;
365pub const SYS_getrandom = 355;
366pub const SYS_memfd_create = 356;
367pub const SYS_bpf = 357;
368pub const SYS_execveat = 358;
369pub const SYS_socket = 359;
370pub const SYS_socketpair = 360;
371pub const SYS_bind = 361;
372pub const SYS_connect = 362;
373pub const SYS_listen = 363;
374pub const SYS_accept4 = 364;
375pub const SYS_getsockopt = 365;
376pub const SYS_setsockopt = 366;
377pub const SYS_getsockname = 367;
378pub const SYS_getpeername = 368;
379pub const SYS_sendto = 369;
380pub const SYS_sendmsg = 370;
381pub const SYS_recvfrom = 371;
382pub const SYS_recvmsg = 372;
383pub const SYS_shutdown = 373;
384pub const SYS_userfaultfd = 374;
385pub const SYS_membarrier = 375;
386pub const SYS_mlock2 = 376;
387pub const SYS_copy_file_range = 377;
388pub const SYS_preadv2 = 378;
389pub const SYS_pwritev2 = 379;
390pub const SYS_pkey_mprotect = 380;
391pub const SYS_pkey_alloc = 381;
392pub const SYS_pkey_free = 382;
393pub const SYS_statx = 383;
394pub const SYS_arch_prctl = 384;
395pub const SYS_io_pgetevents = 385;
396pub const SYS_rseq = 386;
397pub const SYS_semget = 393;
398pub const SYS_semctl = 394;
399pub const SYS_shmget = 395;
400pub const SYS_shmctl = 396;
401pub const SYS_shmat = 397;
402pub const SYS_shmdt = 398;
403pub const SYS_msgget = 399;
404pub const SYS_msgsnd = 400;
405pub const SYS_msgrcv = 401;
406pub const SYS_msgctl = 402;
407pub const SYS_clock_gettime64 = 403;
408pub const SYS_clock_settime64 = 404;
409pub const SYS_clock_adjtime64 = 405;
410pub const SYS_clock_getres_time64 = 406;
411pub const SYS_clock_nanosleep_time64 = 407;
412pub const SYS_timer_gettime64 = 408;
413pub const SYS_timer_settime64 = 409;
414pub const SYS_timerfd_gettime64 = 410;
415pub const SYS_timerfd_settime64 = 411;
416pub const SYS_utimensat_time64 = 412;
417pub const SYS_pselect6_time64 = 413;
418pub const SYS_ppoll_time64 = 414;
419pub const SYS_io_pgetevents_time64 = 416;
420pub const SYS_recvmmsg_time64 = 417;
421pub const SYS_mq_timedsend_time64 = 418;
422pub const SYS_mq_timedreceive_time64 = 419;
423pub const SYS_semtimedop_time64 = 420;
424pub const SYS_rt_sigtimedwait_time64 = 421;
425pub const SYS_futex_time64 = 422;
426pub const SYS_sched_rr_get_interval_time64 = 423;
427pub const SYS_pidfd_send_signal = 424;
428pub const SYS_io_uring_setup = 425;
429pub const SYS_io_uring_enter = 426;
430pub const SYS_io_uring_register = 427;
431pub const SYS_open_tree = 428;
432pub const SYS_move_mount = 429;
433pub const SYS_fsopen = 430;
434pub const SYS_fsconfig = 431;
435pub const SYS_fsmount = 432;
436pub const SYS_fspick = 433;
437pub const SYS_openat2 = 437;
438pub const SYS_pidfd_getfd = 438;
14pub const SYS = extern enum(usize) {
15 restart_syscall = 0,
16 exit = 1,
17 fork = 2,
18 read = 3,
19 write = 4,
20 open = 5,
21 close = 6,
22 waitpid = 7,
23 creat = 8,
24 link = 9,
25 unlink = 10,
26 execve = 11,
27 chdir = 12,
28 time = 13,
29 mknod = 14,
30 chmod = 15,
31 lchown = 16,
32 @"break" = 17,
33 oldstat = 18,
34 lseek = 19,
35 getpid = 20,
36 mount = 21,
37 umount = 22,
38 setuid = 23,
39 getuid = 24,
40 stime = 25,
41 ptrace = 26,
42 alarm = 27,
43 oldfstat = 28,
44 pause = 29,
45 utime = 30,
46 stty = 31,
47 gtty = 32,
48 access = 33,
49 nice = 34,
50 ftime = 35,
51 sync = 36,
52 kill = 37,
53 rename = 38,
54 mkdir = 39,
55 rmdir = 40,
56 dup = 41,
57 pipe = 42,
58 times = 43,
59 prof = 44,
60 brk = 45,
61 setgid = 46,
62 getgid = 47,
63 signal = 48,
64 geteuid = 49,
65 getegid = 50,
66 acct = 51,
67 umount2 = 52,
68 lock = 53,
69 ioctl = 54,
70 fcntl = 55,
71 mpx = 56,
72 setpgid = 57,
73 ulimit = 58,
74 oldolduname = 59,
75 umask = 60,
76 chroot = 61,
77 ustat = 62,
78 dup2 = 63,
79 getppid = 64,
80 getpgrp = 65,
81 setsid = 66,
82 sigaction = 67,
83 sgetmask = 68,
84 ssetmask = 69,
85 setreuid = 70,
86 setregid = 71,
87 sigsuspend = 72,
88 sigpending = 73,
89 sethostname = 74,
90 setrlimit = 75,
91 getrlimit = 76,
92 getrusage = 77,
93 gettimeofday = 78,
94 settimeofday = 79,
95 getgroups = 80,
96 setgroups = 81,
97 select = 82,
98 symlink = 83,
99 oldlstat = 84,
100 readlink = 85,
101 uselib = 86,
102 swapon = 87,
103 reboot = 88,
104 readdir = 89,
105 mmap = 90,
106 munmap = 91,
107 truncate = 92,
108 ftruncate = 93,
109 fchmod = 94,
110 fchown = 95,
111 getpriority = 96,
112 setpriority = 97,
113 profil = 98,
114 statfs = 99,
115 fstatfs = 100,
116 ioperm = 101,
117 socketcall = 102,
118 syslog = 103,
119 setitimer = 104,
120 getitimer = 105,
121 stat = 106,
122 lstat = 107,
123 fstat = 108,
124 olduname = 109,
125 iopl = 110,
126 vhangup = 111,
127 idle = 112,
128 vm86old = 113,
129 wait4 = 114,
130 swapoff = 115,
131 sysinfo = 116,
132 ipc = 117,
133 fsync = 118,
134 sigreturn = 119,
135 clone = 120,
136 setdomainname = 121,
137 uname = 122,
138 modify_ldt = 123,
139 adjtimex = 124,
140 mprotect = 125,
141 sigprocmask = 126,
142 create_module = 127,
143 init_module = 128,
144 delete_module = 129,
145 get_kernel_syms = 130,
146 quotactl = 131,
147 getpgid = 132,
148 fchdir = 133,
149 bdflush = 134,
150 sysfs = 135,
151 personality = 136,
152 afs_syscall = 137,
153 setfsuid = 138,
154 setfsgid = 139,
155 _llseek = 140,
156 getdents = 141,
157 _newselect = 142,
158 flock = 143,
159 msync = 144,
160 readv = 145,
161 writev = 146,
162 getsid = 147,
163 fdatasync = 148,
164 _sysctl = 149,
165 mlock = 150,
166 munlock = 151,
167 mlockall = 152,
168 munlockall = 153,
169 sched_setparam = 154,
170 sched_getparam = 155,
171 sched_setscheduler = 156,
172 sched_getscheduler = 157,
173 sched_yield = 158,
174 sched_get_priority_max = 159,
175 sched_get_priority_min = 160,
176 sched_rr_get_interval = 161,
177 nanosleep = 162,
178 mremap = 163,
179 setresuid = 164,
180 getresuid = 165,
181 vm86 = 166,
182 query_module = 167,
183 poll = 168,
184 nfsservctl = 169,
185 setresgid = 170,
186 getresgid = 171,
187 prctl = 172,
188 rt_sigreturn = 173,
189 rt_sigaction = 174,
190 rt_sigprocmask = 175,
191 rt_sigpending = 176,
192 rt_sigtimedwait = 177,
193 rt_sigqueueinfo = 178,
194 rt_sigsuspend = 179,
195 pread64 = 180,
196 pwrite64 = 181,
197 chown = 182,
198 getcwd = 183,
199 capget = 184,
200 capset = 185,
201 sigaltstack = 186,
202 sendfile = 187,
203 getpmsg = 188,
204 putpmsg = 189,
205 vfork = 190,
206 ugetrlimit = 191,
207 mmap2 = 192,
208 truncate64 = 193,
209 ftruncate64 = 194,
210 stat64 = 195,
211 lstat64 = 196,
212 fstat64 = 197,
213 lchown32 = 198,
214 getuid32 = 199,
215 getgid32 = 200,
216 geteuid32 = 201,
217 getegid32 = 202,
218 setreuid32 = 203,
219 setregid32 = 204,
220 getgroups32 = 205,
221 setgroups32 = 206,
222 fchown32 = 207,
223 setresuid32 = 208,
224 getresuid32 = 209,
225 setresgid32 = 210,
226 getresgid32 = 211,
227 chown32 = 212,
228 setuid32 = 213,
229 setgid32 = 214,
230 setfsuid32 = 215,
231 setfsgid32 = 216,
232 pivot_root = 217,
233 mincore = 218,
234 madvise = 219,
235 getdents64 = 220,
236 fcntl64 = 221,
237 gettid = 224,
238 readahead = 225,
239 setxattr = 226,
240 lsetxattr = 227,
241 fsetxattr = 228,
242 getxattr = 229,
243 lgetxattr = 230,
244 fgetxattr = 231,
245 listxattr = 232,
246 llistxattr = 233,
247 flistxattr = 234,
248 removexattr = 235,
249 lremovexattr = 236,
250 fremovexattr = 237,
251 tkill = 238,
252 sendfile64 = 239,
253 futex = 240,
254 sched_setaffinity = 241,
255 sched_getaffinity = 242,
256 set_thread_area = 243,
257 get_thread_area = 244,
258 io_setup = 245,
259 io_destroy = 246,
260 io_getevents = 247,
261 io_submit = 248,
262 io_cancel = 249,
263 fadvise64 = 250,
264 exit_group = 252,
265 lookup_dcookie = 253,
266 epoll_create = 254,
267 epoll_ctl = 255,
268 epoll_wait = 256,
269 remap_file_pages = 257,
270 set_tid_address = 258,
271 timer_create = 259,
272 timer_settime, // SYS_timer_create + 1
273 timer_gettime, // SYS_timer_create + 2
274 timer_getoverrun, // SYS_timer_create + 3
275 timer_delete, // SYS_timer_create + 4
276 clock_settime, // SYS_timer_create + 5
277 clock_gettime, // SYS_timer_create + 6
278 clock_getres, // SYS_timer_create + 7
279 clock_nanosleep, // SYS_timer_create + 8
280 statfs64 = 268,
281 fstatfs64 = 269,
282 tgkill = 270,
283 utimes = 271,
284 fadvise64_64 = 272,
285 vserver = 273,
286 mbind = 274,
287 get_mempolicy = 275,
288 set_mempolicy = 276,
289 mq_open = 277,
290 mq_unlink, // SYS_mq_open + 1
291 mq_timedsend, // SYS_mq_open + 2
292 mq_timedreceive, // SYS_mq_open + 3
293 mq_notify, // SYS_mq_open + 4
294 mq_getsetattr, // SYS_mq_open + 5
295 kexec_load = 283,
296 waitid = 284,
297 add_key = 286,
298 request_key = 287,
299 keyctl = 288,
300 ioprio_set = 289,
301 ioprio_get = 290,
302 inotify_init = 291,
303 inotify_add_watch = 292,
304 inotify_rm_watch = 293,
305 migrate_pages = 294,
306 openat = 295,
307 mkdirat = 296,
308 mknodat = 297,
309 fchownat = 298,
310 futimesat = 299,
311 fstatat64 = 300,
312 unlinkat = 301,
313 renameat = 302,
314 linkat = 303,
315 symlinkat = 304,
316 readlinkat = 305,
317 fchmodat = 306,
318 faccessat = 307,
319 pselect6 = 308,
320 ppoll = 309,
321 unshare = 310,
322 set_robust_list = 311,
323 get_robust_list = 312,
324 splice = 313,
325 sync_file_range = 314,
326 tee = 315,
327 vmsplice = 316,
328 move_pages = 317,
329 getcpu = 318,
330 epoll_pwait = 319,
331 utimensat = 320,
332 signalfd = 321,
333 timerfd_create = 322,
334 eventfd = 323,
335 fallocate = 324,
336 timerfd_settime = 325,
337 timerfd_gettime = 326,
338 signalfd4 = 327,
339 eventfd2 = 328,
340 epoll_create1 = 329,
341 dup3 = 330,
342 pipe2 = 331,
343 inotify_init1 = 332,
344 preadv = 333,
345 pwritev = 334,
346 rt_tgsigqueueinfo = 335,
347 perf_event_open = 336,
348 recvmmsg = 337,
349 fanotify_init = 338,
350 fanotify_mark = 339,
351 prlimit64 = 340,
352 name_to_handle_at = 341,
353 open_by_handle_at = 342,
354 clock_adjtime = 343,
355 syncfs = 344,
356 sendmmsg = 345,
357 setns = 346,
358 process_vm_readv = 347,
359 process_vm_writev = 348,
360 kcmp = 349,
361 finit_module = 350,
362 sched_setattr = 351,
363 sched_getattr = 352,
364 renameat2 = 353,
365 seccomp = 354,
366 getrandom = 355,
367 memfd_create = 356,
368 bpf = 357,
369 execveat = 358,
370 socket = 359,
371 socketpair = 360,
372 bind = 361,
373 connect = 362,
374 listen = 363,
375 accept4 = 364,
376 getsockopt = 365,
377 setsockopt = 366,
378 getsockname = 367,
379 getpeername = 368,
380 sendto = 369,
381 sendmsg = 370,
382 recvfrom = 371,
383 recvmsg = 372,
384 shutdown = 373,
385 userfaultfd = 374,
386 membarrier = 375,
387 mlock2 = 376,
388 copy_file_range = 377,
389 preadv2 = 378,
390 pwritev2 = 379,
391 pkey_mprotect = 380,
392 pkey_alloc = 381,
393 pkey_free = 382,
394 statx = 383,
395 arch_prctl = 384,
396 io_pgetevents = 385,
397 rseq = 386,
398 semget = 393,
399 semctl = 394,
400 shmget = 395,
401 shmctl = 396,
402 shmat = 397,
403 shmdt = 398,
404 msgget = 399,
405 msgsnd = 400,
406 msgrcv = 401,
407 msgctl = 402,
408 clock_gettime64 = 403,
409 clock_settime64 = 404,
410 clock_adjtime64 = 405,
411 clock_getres_time64 = 406,
412 clock_nanosleep_time64 = 407,
413 timer_gettime64 = 408,
414 timer_settime64 = 409,
415 timerfd_gettime64 = 410,
416 timerfd_settime64 = 411,
417 utimensat_time64 = 412,
418 pselect6_time64 = 413,
419 ppoll_time64 = 414,
420 io_pgetevents_time64 = 416,
421 recvmmsg_time64 = 417,
422 mq_timedsend_time64 = 418,
423 mq_timedreceive_time64 = 419,
424 semtimedop_time64 = 420,
425 rt_sigtimedwait_time64 = 421,
426 futex_time64 = 422,
427 sched_rr_get_interval_time64 = 423,
428 pidfd_send_signal = 424,
429 io_uring_setup = 425,
430 io_uring_enter = 426,
431 io_uring_register = 427,
432 open_tree = 428,
433 move_mount = 429,
434 fsopen = 430,
435 fsconfig = 431,
436 fsmount = 432,
437 fspick = 433,
438 openat2 = 437,
439 pidfd_getfd = 438,
440
441 _,
442};
439443
440444pub const O_CREAT = 0o100;
441445pub const O_EXCL = 0o200;
lib/std/os/bits/linux/mipsel.zig+376-371
......@@ -6,377 +6,382 @@ const iovec_const = linux.iovec_const;
66const uid_t = linux.uid_t;
77const gid_t = linux.gid_t;
88
9pub const SYS_Linux = 4000;
10pub const SYS_syscall = (SYS_Linux + 0);
11pub const SYS_exit = (SYS_Linux + 1);
12pub const SYS_fork = (SYS_Linux + 2);
13pub const SYS_read = (SYS_Linux + 3);
14pub const SYS_write = (SYS_Linux + 4);
15pub const SYS_open = (SYS_Linux + 5);
16pub const SYS_close = (SYS_Linux + 6);
17pub const SYS_waitpid = (SYS_Linux + 7);
18pub const SYS_creat = (SYS_Linux + 8);
19pub const SYS_link = (SYS_Linux + 9);
20pub const SYS_unlink = (SYS_Linux + 10);
21pub const SYS_execve = (SYS_Linux + 11);
22pub const SYS_chdir = (SYS_Linux + 12);
23pub const SYS_time = (SYS_Linux + 13);
24pub const SYS_mknod = (SYS_Linux + 14);
25pub const SYS_chmod = (SYS_Linux + 15);
26pub const SYS_lchown = (SYS_Linux + 16);
27pub const SYS_break = (SYS_Linux + 17);
28pub const SYS_unused18 = (SYS_Linux + 18);
29pub const SYS_lseek = (SYS_Linux + 19);
30pub const SYS_getpid = (SYS_Linux + 20);
31pub const SYS_mount = (SYS_Linux + 21);
32pub const SYS_umount = (SYS_Linux + 22);
33pub const SYS_setuid = (SYS_Linux + 23);
34pub const SYS_getuid = (SYS_Linux + 24);
35pub const SYS_stime = (SYS_Linux + 25);
36pub const SYS_ptrace = (SYS_Linux + 26);
37pub const SYS_alarm = (SYS_Linux + 27);
38pub const SYS_unused28 = (SYS_Linux + 28);
39pub const SYS_pause = (SYS_Linux + 29);
40pub const SYS_utime = (SYS_Linux + 30);
41pub const SYS_stty = (SYS_Linux + 31);
42pub const SYS_gtty = (SYS_Linux + 32);
43pub const SYS_access = (SYS_Linux + 33);
44pub const SYS_nice = (SYS_Linux + 34);
45pub const SYS_ftime = (SYS_Linux + 35);
46pub const SYS_sync = (SYS_Linux + 36);
47pub const SYS_kill = (SYS_Linux + 37);
48pub const SYS_rename = (SYS_Linux + 38);
49pub const SYS_mkdir = (SYS_Linux + 39);
50pub const SYS_rmdir = (SYS_Linux + 40);
51pub const SYS_dup = (SYS_Linux + 41);
52pub const SYS_pipe = (SYS_Linux + 42);
53pub const SYS_times = (SYS_Linux + 43);
54pub const SYS_prof = (SYS_Linux + 44);
55pub const SYS_brk = (SYS_Linux + 45);
56pub const SYS_setgid = (SYS_Linux + 46);
57pub const SYS_getgid = (SYS_Linux + 47);
58pub const SYS_signal = (SYS_Linux + 48);
59pub const SYS_geteuid = (SYS_Linux + 49);
60pub const SYS_getegid = (SYS_Linux + 50);
61pub const SYS_acct = (SYS_Linux + 51);
62pub const SYS_umount2 = (SYS_Linux + 52);
63pub const SYS_lock = (SYS_Linux + 53);
64pub const SYS_ioctl = (SYS_Linux + 54);
65pub const SYS_fcntl = (SYS_Linux + 55);
66pub const SYS_mpx = (SYS_Linux + 56);
67pub const SYS_setpgid = (SYS_Linux + 57);
68pub const SYS_ulimit = (SYS_Linux + 58);
69pub const SYS_unused59 = (SYS_Linux + 59);
70pub const SYS_umask = (SYS_Linux + 60);
71pub const SYS_chroot = (SYS_Linux + 61);
72pub const SYS_ustat = (SYS_Linux + 62);
73pub const SYS_dup2 = (SYS_Linux + 63);
74pub const SYS_getppid = (SYS_Linux + 64);
75pub const SYS_getpgrp = (SYS_Linux + 65);
76pub const SYS_setsid = (SYS_Linux + 66);
77pub const SYS_sigaction = (SYS_Linux + 67);
78pub const SYS_sgetmask = (SYS_Linux + 68);
79pub const SYS_ssetmask = (SYS_Linux + 69);
80pub const SYS_setreuid = (SYS_Linux + 70);
81pub const SYS_setregid = (SYS_Linux + 71);
82pub const SYS_sigsuspend = (SYS_Linux + 72);
83pub const SYS_sigpending = (SYS_Linux + 73);
84pub const SYS_sethostname = (SYS_Linux + 74);
85pub const SYS_setrlimit = (SYS_Linux + 75);
86pub const SYS_getrlimit = (SYS_Linux + 76);
87pub const SYS_getrusage = (SYS_Linux + 77);
88pub const SYS_gettimeofday = (SYS_Linux + 78);
89pub const SYS_settimeofday = (SYS_Linux + 79);
90pub const SYS_getgroups = (SYS_Linux + 80);
91pub const SYS_setgroups = (SYS_Linux + 81);
92pub const SYS_reserved82 = (SYS_Linux + 82);
93pub const SYS_symlink = (SYS_Linux + 83);
94pub const SYS_unused84 = (SYS_Linux + 84);
95pub const SYS_readlink = (SYS_Linux + 85);
96pub const SYS_uselib = (SYS_Linux + 86);
97pub const SYS_swapon = (SYS_Linux + 87);
98pub const SYS_reboot = (SYS_Linux + 88);
99pub const SYS_readdir = (SYS_Linux + 89);
100pub const SYS_mmap = (SYS_Linux + 90);
101pub const SYS_munmap = (SYS_Linux + 91);
102pub const SYS_truncate = (SYS_Linux + 92);
103pub const SYS_ftruncate = (SYS_Linux + 93);
104pub const SYS_fchmod = (SYS_Linux + 94);
105pub const SYS_fchown = (SYS_Linux + 95);
106pub const SYS_getpriority = (SYS_Linux + 96);
107pub const SYS_setpriority = (SYS_Linux + 97);
108pub const SYS_profil = (SYS_Linux + 98);
109pub const SYS_statfs = (SYS_Linux + 99);
110pub const SYS_fstatfs = (SYS_Linux + 100);
111pub const SYS_ioperm = (SYS_Linux + 101);
112pub const SYS_socketcall = (SYS_Linux + 102);
113pub const SYS_syslog = (SYS_Linux + 103);
114pub const SYS_setitimer = (SYS_Linux + 104);
115pub const SYS_getitimer = (SYS_Linux + 105);
116pub const SYS_stat = (SYS_Linux + 106);
117pub const SYS_lstat = (SYS_Linux + 107);
118pub const SYS_fstat = (SYS_Linux + 108);
119pub const SYS_unused109 = (SYS_Linux + 109);
120pub const SYS_iopl = (SYS_Linux + 110);
121pub const SYS_vhangup = (SYS_Linux + 111);
122pub const SYS_idle = (SYS_Linux + 112);
123pub const SYS_vm86 = (SYS_Linux + 113);
124pub const SYS_wait4 = (SYS_Linux + 114);
125pub const SYS_swapoff = (SYS_Linux + 115);
126pub const SYS_sysinfo = (SYS_Linux + 116);
127pub const SYS_ipc = (SYS_Linux + 117);
128pub const SYS_fsync = (SYS_Linux + 118);
129pub const SYS_sigreturn = (SYS_Linux + 119);
130pub const SYS_clone = (SYS_Linux + 120);
131pub const SYS_setdomainname = (SYS_Linux + 121);
132pub const SYS_uname = (SYS_Linux + 122);
133pub const SYS_modify_ldt = (SYS_Linux + 123);
134pub const SYS_adjtimex = (SYS_Linux + 124);
135pub const SYS_mprotect = (SYS_Linux + 125);
136pub const SYS_sigprocmask = (SYS_Linux + 126);
137pub const SYS_create_module = (SYS_Linux + 127);
138pub const SYS_init_module = (SYS_Linux + 128);
139pub const SYS_delete_module = (SYS_Linux + 129);
140pub const SYS_get_kernel_syms = (SYS_Linux + 130);
141pub const SYS_quotactl = (SYS_Linux + 131);
142pub const SYS_getpgid = (SYS_Linux + 132);
143pub const SYS_fchdir = (SYS_Linux + 133);
144pub const SYS_bdflush = (SYS_Linux + 134);
145pub const SYS_sysfs = (SYS_Linux + 135);
146pub const SYS_personality = (SYS_Linux + 136);
147pub const SYS_afs_syscall = (SYS_Linux + 137);
148pub const SYS_setfsuid = (SYS_Linux + 138);
149pub const SYS_setfsgid = (SYS_Linux + 139);
150pub const SYS__llseek = (SYS_Linux + 140);
151pub const SYS_getdents = (SYS_Linux + 141);
152pub const SYS__newselect = (SYS_Linux + 142);
153pub const SYS_flock = (SYS_Linux + 143);
154pub const SYS_msync = (SYS_Linux + 144);
155pub const SYS_readv = (SYS_Linux + 145);
156pub const SYS_writev = (SYS_Linux + 146);
157pub const SYS_cacheflush = (SYS_Linux + 147);
158pub const SYS_cachectl = (SYS_Linux + 148);
159pub const SYS_sysmips = (SYS_Linux + 149);
160pub const SYS_unused150 = (SYS_Linux + 150);
161pub const SYS_getsid = (SYS_Linux + 151);
162pub const SYS_fdatasync = (SYS_Linux + 152);
163pub const SYS__sysctl = (SYS_Linux + 153);
164pub const SYS_mlock = (SYS_Linux + 154);
165pub const SYS_munlock = (SYS_Linux + 155);
166pub const SYS_mlockall = (SYS_Linux + 156);
167pub const SYS_munlockall = (SYS_Linux + 157);
168pub const SYS_sched_setparam = (SYS_Linux + 158);
169pub const SYS_sched_getparam = (SYS_Linux + 159);
170pub const SYS_sched_setscheduler = (SYS_Linux + 160);
171pub const SYS_sched_getscheduler = (SYS_Linux + 161);
172pub const SYS_sched_yield = (SYS_Linux + 162);
173pub const SYS_sched_get_priority_max = (SYS_Linux + 163);
174pub const SYS_sched_get_priority_min = (SYS_Linux + 164);
175pub const SYS_sched_rr_get_interval = (SYS_Linux + 165);
176pub const SYS_nanosleep = (SYS_Linux + 166);
177pub const SYS_mremap = (SYS_Linux + 167);
178pub const SYS_accept = (SYS_Linux + 168);
179pub const SYS_bind = (SYS_Linux + 169);
180pub const SYS_connect = (SYS_Linux + 170);
181pub const SYS_getpeername = (SYS_Linux + 171);
182pub const SYS_getsockname = (SYS_Linux + 172);
183pub const SYS_getsockopt = (SYS_Linux + 173);
184pub const SYS_listen = (SYS_Linux + 174);
185pub const SYS_recv = (SYS_Linux + 175);
186pub const SYS_recvfrom = (SYS_Linux + 176);
187pub const SYS_recvmsg = (SYS_Linux + 177);
188pub const SYS_send = (SYS_Linux + 178);
189pub const SYS_sendmsg = (SYS_Linux + 179);
190pub const SYS_sendto = (SYS_Linux + 180);
191pub const SYS_setsockopt = (SYS_Linux + 181);
192pub const SYS_shutdown = (SYS_Linux + 182);
193pub const SYS_socket = (SYS_Linux + 183);
194pub const SYS_socketpair = (SYS_Linux + 184);
195pub const SYS_setresuid = (SYS_Linux + 185);
196pub const SYS_getresuid = (SYS_Linux + 186);
197pub const SYS_query_module = (SYS_Linux + 187);
198pub const SYS_poll = (SYS_Linux + 188);
199pub const SYS_nfsservctl = (SYS_Linux + 189);
200pub const SYS_setresgid = (SYS_Linux + 190);
201pub const SYS_getresgid = (SYS_Linux + 191);
202pub const SYS_prctl = (SYS_Linux + 192);
203pub const SYS_rt_sigreturn = (SYS_Linux + 193);
204pub const SYS_rt_sigaction = (SYS_Linux + 194);
205pub const SYS_rt_sigprocmask = (SYS_Linux + 195);
206pub const SYS_rt_sigpending = (SYS_Linux + 196);
207pub const SYS_rt_sigtimedwait = (SYS_Linux + 197);
208pub const SYS_rt_sigqueueinfo = (SYS_Linux + 198);
209pub const SYS_rt_sigsuspend = (SYS_Linux + 199);
210pub const SYS_pread64 = (SYS_Linux + 200);
211pub const SYS_pwrite64 = (SYS_Linux + 201);
212pub const SYS_chown = (SYS_Linux + 202);
213pub const SYS_getcwd = (SYS_Linux + 203);
214pub const SYS_capget = (SYS_Linux + 204);
215pub const SYS_capset = (SYS_Linux + 205);
216pub const SYS_sigaltstack = (SYS_Linux + 206);
217pub const SYS_sendfile = (SYS_Linux + 207);
218pub const SYS_getpmsg = (SYS_Linux + 208);
219pub const SYS_putpmsg = (SYS_Linux + 209);
220pub const SYS_mmap2 = (SYS_Linux + 210);
221pub const SYS_truncate64 = (SYS_Linux + 211);
222pub const SYS_ftruncate64 = (SYS_Linux + 212);
223pub const SYS_stat64 = (SYS_Linux + 213);
224pub const SYS_lstat64 = (SYS_Linux + 214);
225pub const SYS_fstat64 = (SYS_Linux + 215);
226pub const SYS_pivot_root = (SYS_Linux + 216);
227pub const SYS_mincore = (SYS_Linux + 217);
228pub const SYS_madvise = (SYS_Linux + 218);
229pub const SYS_getdents64 = (SYS_Linux + 219);
230pub const SYS_fcntl64 = (SYS_Linux + 220);
231pub const SYS_reserved221 = (SYS_Linux + 221);
232pub const SYS_gettid = (SYS_Linux + 222);
233pub const SYS_readahead = (SYS_Linux + 223);
234pub const SYS_setxattr = (SYS_Linux + 224);
235pub const SYS_lsetxattr = (SYS_Linux + 225);
236pub const SYS_fsetxattr = (SYS_Linux + 226);
237pub const SYS_getxattr = (SYS_Linux + 227);
238pub const SYS_lgetxattr = (SYS_Linux + 228);
239pub const SYS_fgetxattr = (SYS_Linux + 229);
240pub const SYS_listxattr = (SYS_Linux + 230);
241pub const SYS_llistxattr = (SYS_Linux + 231);
242pub const SYS_flistxattr = (SYS_Linux + 232);
243pub const SYS_removexattr = (SYS_Linux + 233);
244pub const SYS_lremovexattr = (SYS_Linux + 234);
245pub const SYS_fremovexattr = (SYS_Linux + 235);
246pub const SYS_tkill = (SYS_Linux + 236);
247pub const SYS_sendfile64 = (SYS_Linux + 237);
248pub const SYS_futex = (SYS_Linux + 238);
249pub const SYS_sched_setaffinity = (SYS_Linux + 239);
250pub const SYS_sched_getaffinity = (SYS_Linux + 240);
251pub const SYS_io_setup = (SYS_Linux + 241);
252pub const SYS_io_destroy = (SYS_Linux + 242);
253pub const SYS_io_getevents = (SYS_Linux + 243);
254pub const SYS_io_submit = (SYS_Linux + 244);
255pub const SYS_io_cancel = (SYS_Linux + 245);
256pub const SYS_exit_group = (SYS_Linux + 246);
257pub const SYS_lookup_dcookie = (SYS_Linux + 247);
258pub const SYS_epoll_create = (SYS_Linux + 248);
259pub const SYS_epoll_ctl = (SYS_Linux + 249);
260pub const SYS_epoll_wait = (SYS_Linux + 250);
261pub const SYS_remap_file_pages = (SYS_Linux + 251);
262pub const SYS_set_tid_address = (SYS_Linux + 252);
263pub const SYS_restart_syscall = (SYS_Linux + 253);
264pub const SYS_fadvise64 = (SYS_Linux + 254);
265pub const SYS_statfs64 = (SYS_Linux + 255);
266pub const SYS_fstatfs64 = (SYS_Linux + 256);
267pub const SYS_timer_create = (SYS_Linux + 257);
268pub const SYS_timer_settime = (SYS_Linux + 258);
269pub const SYS_timer_gettime = (SYS_Linux + 259);
270pub const SYS_timer_getoverrun = (SYS_Linux + 260);
271pub const SYS_timer_delete = (SYS_Linux + 261);
272pub const SYS_clock_settime = (SYS_Linux + 262);
273pub const SYS_clock_gettime = (SYS_Linux + 263);
274pub const SYS_clock_getres = (SYS_Linux + 264);
275pub const SYS_clock_nanosleep = (SYS_Linux + 265);
276pub const SYS_tgkill = (SYS_Linux + 266);
277pub const SYS_utimes = (SYS_Linux + 267);
278pub const SYS_mbind = (SYS_Linux + 268);
279pub const SYS_get_mempolicy = (SYS_Linux + 269);
280pub const SYS_set_mempolicy = (SYS_Linux + 270);
281pub const SYS_mq_open = (SYS_Linux + 271);
282pub const SYS_mq_unlink = (SYS_Linux + 272);
283pub const SYS_mq_timedsend = (SYS_Linux + 273);
284pub const SYS_mq_timedreceive = (SYS_Linux + 274);
285pub const SYS_mq_notify = (SYS_Linux + 275);
286pub const SYS_mq_getsetattr = (SYS_Linux + 276);
287pub const SYS_vserver = (SYS_Linux + 277);
288pub const SYS_waitid = (SYS_Linux + 278);
289pub const SYS_add_key = (SYS_Linux + 280);
290pub const SYS_request_key = (SYS_Linux + 281);
291pub const SYS_keyctl = (SYS_Linux + 282);
292pub const SYS_set_thread_area = (SYS_Linux + 283);
293pub const SYS_inotify_init = (SYS_Linux + 284);
294pub const SYS_inotify_add_watch = (SYS_Linux + 285);
295pub const SYS_inotify_rm_watch = (SYS_Linux + 286);
296pub const SYS_migrate_pages = (SYS_Linux + 287);
297pub const SYS_openat = (SYS_Linux + 288);
298pub const SYS_mkdirat = (SYS_Linux + 289);
299pub const SYS_mknodat = (SYS_Linux + 290);
300pub const SYS_fchownat = (SYS_Linux + 291);
301pub const SYS_futimesat = (SYS_Linux + 292);
302pub const SYS_fstatat64 = (SYS_Linux + 293);
303pub const SYS_unlinkat = (SYS_Linux + 294);
304pub const SYS_renameat = (SYS_Linux + 295);
305pub const SYS_linkat = (SYS_Linux + 296);
306pub const SYS_symlinkat = (SYS_Linux + 297);
307pub const SYS_readlinkat = (SYS_Linux + 298);
308pub const SYS_fchmodat = (SYS_Linux + 299);
309pub const SYS_faccessat = (SYS_Linux + 300);
310pub const SYS_pselect6 = (SYS_Linux + 301);
311pub const SYS_ppoll = (SYS_Linux + 302);
312pub const SYS_unshare = (SYS_Linux + 303);
313pub const SYS_splice = (SYS_Linux + 304);
314pub const SYS_sync_file_range = (SYS_Linux + 305);
315pub const SYS_tee = (SYS_Linux + 306);
316pub const SYS_vmsplice = (SYS_Linux + 307);
317pub const SYS_move_pages = (SYS_Linux + 308);
318pub const SYS_set_robust_list = (SYS_Linux + 309);
319pub const SYS_get_robust_list = (SYS_Linux + 310);
320pub const SYS_kexec_load = (SYS_Linux + 311);
321pub const SYS_getcpu = (SYS_Linux + 312);
322pub const SYS_epoll_pwait = (SYS_Linux + 313);
323pub const SYS_ioprio_set = (SYS_Linux + 314);
324pub const SYS_ioprio_get = (SYS_Linux + 315);
325pub const SYS_utimensat = (SYS_Linux + 316);
326pub const SYS_signalfd = (SYS_Linux + 317);
327pub const SYS_timerfd = (SYS_Linux + 318);
328pub const SYS_eventfd = (SYS_Linux + 319);
329pub const SYS_fallocate = (SYS_Linux + 320);
330pub const SYS_timerfd_create = (SYS_Linux + 321);
331pub const SYS_timerfd_gettime = (SYS_Linux + 322);
332pub const SYS_timerfd_settime = (SYS_Linux + 323);
333pub const SYS_signalfd4 = (SYS_Linux + 324);
334pub const SYS_eventfd2 = (SYS_Linux + 325);
335pub const SYS_epoll_create1 = (SYS_Linux + 326);
336pub const SYS_dup3 = (SYS_Linux + 327);
337pub const SYS_pipe2 = (SYS_Linux + 328);
338pub const SYS_inotify_init1 = (SYS_Linux + 329);
339pub const SYS_preadv = (SYS_Linux + 330);
340pub const SYS_pwritev = (SYS_Linux + 331);
341pub const SYS_rt_tgsigqueueinfo = (SYS_Linux + 332);
342pub const SYS_perf_event_open = (SYS_Linux + 333);
343pub const SYS_accept4 = (SYS_Linux + 334);
344pub const SYS_recvmmsg = (SYS_Linux + 335);
345pub const SYS_fanotify_init = (SYS_Linux + 336);
346pub const SYS_fanotify_mark = (SYS_Linux + 337);
347pub const SYS_prlimit64 = (SYS_Linux + 338);
348pub const SYS_name_to_handle_at = (SYS_Linux + 339);
349pub const SYS_open_by_handle_at = (SYS_Linux + 340);
350pub const SYS_clock_adjtime = (SYS_Linux + 341);
351pub const SYS_syncfs = (SYS_Linux + 342);
352pub const SYS_sendmmsg = (SYS_Linux + 343);
353pub const SYS_setns = (SYS_Linux + 344);
354pub const SYS_process_vm_readv = (SYS_Linux + 345);
355pub const SYS_process_vm_writev = (SYS_Linux + 346);
356pub const SYS_kcmp = (SYS_Linux + 347);
357pub const SYS_finit_module = (SYS_Linux + 348);
358pub const SYS_sched_setattr = (SYS_Linux + 349);
359pub const SYS_sched_getattr = (SYS_Linux + 350);
360pub const SYS_renameat2 = (SYS_Linux + 351);
361pub const SYS_seccomp = (SYS_Linux + 352);
362pub const SYS_getrandom = (SYS_Linux + 353);
363pub const SYS_memfd_create = (SYS_Linux + 354);
364pub const SYS_bpf = (SYS_Linux + 355);
365pub const SYS_execveat = (SYS_Linux + 356);
366pub const SYS_userfaultfd = (SYS_Linux + 357);
367pub const SYS_membarrier = (SYS_Linux + 358);
368pub const SYS_mlock2 = (SYS_Linux + 359);
369pub const SYS_copy_file_range = (SYS_Linux + 360);
370pub const SYS_preadv2 = (SYS_Linux + 361);
371pub const SYS_pwritev2 = (SYS_Linux + 362);
372pub const SYS_pkey_mprotect = (SYS_Linux + 363);
373pub const SYS_pkey_alloc = (SYS_Linux + 364);
374pub const SYS_pkey_free = (SYS_Linux + 365);
375pub const SYS_statx = (SYS_Linux + 366);
376pub const SYS_rseq = (SYS_Linux + 367);
377pub const SYS_io_pgetevents = (SYS_Linux + 368);
378pub const SYS_openat2 = (SYS_Linux + 437);
379pub const SYS_pidfd_getfd = (SYS_Linux + 438);
9pub const SYS = extern enum(usize) {
10 pub const Linux = 4000;
11
12 syscall = Linux + 0,
13 exit = Linux + 1,
14 fork = Linux + 2,
15 read = Linux + 3,
16 write = Linux + 4,
17 open = Linux + 5,
18 close = Linux + 6,
19 waitpid = Linux + 7,
20 creat = Linux + 8,
21 link = Linux + 9,
22 unlink = Linux + 10,
23 execve = Linux + 11,
24 chdir = Linux + 12,
25 time = Linux + 13,
26 mknod = Linux + 14,
27 chmod = Linux + 15,
28 lchown = Linux + 16,
29 @"break" = Linux + 17,
30 unused18 = Linux + 18,
31 lseek = Linux + 19,
32 getpid = Linux + 20,
33 mount = Linux + 21,
34 umount = Linux + 22,
35 setuid = Linux + 23,
36 getuid = Linux + 24,
37 stime = Linux + 25,
38 ptrace = Linux + 26,
39 alarm = Linux + 27,
40 unused28 = Linux + 28,
41 pause = Linux + 29,
42 utime = Linux + 30,
43 stty = Linux + 31,
44 gtty = Linux + 32,
45 access = Linux + 33,
46 nice = Linux + 34,
47 ftime = Linux + 35,
48 sync = Linux + 36,
49 kill = Linux + 37,
50 rename = Linux + 38,
51 mkdir = Linux + 39,
52 rmdir = Linux + 40,
53 dup = Linux + 41,
54 pipe = Linux + 42,
55 times = Linux + 43,
56 prof = Linux + 44,
57 brk = Linux + 45,
58 setgid = Linux + 46,
59 getgid = Linux + 47,
60 signal = Linux + 48,
61 geteuid = Linux + 49,
62 getegid = Linux + 50,
63 acct = Linux + 51,
64 umount2 = Linux + 52,
65 lock = Linux + 53,
66 ioctl = Linux + 54,
67 fcntl = Linux + 55,
68 mpx = Linux + 56,
69 setpgid = Linux + 57,
70 ulimit = Linux + 58,
71 unused59 = Linux + 59,
72 umask = Linux + 60,
73 chroot = Linux + 61,
74 ustat = Linux + 62,
75 dup2 = Linux + 63,
76 getppid = Linux + 64,
77 getpgrp = Linux + 65,
78 setsid = Linux + 66,
79 sigaction = Linux + 67,
80 sgetmask = Linux + 68,
81 ssetmask = Linux + 69,
82 setreuid = Linux + 70,
83 setregid = Linux + 71,
84 sigsuspend = Linux + 72,
85 sigpending = Linux + 73,
86 sethostname = Linux + 74,
87 setrlimit = Linux + 75,
88 getrlimit = Linux + 76,
89 getrusage = Linux + 77,
90 gettimeofday = Linux + 78,
91 settimeofday = Linux + 79,
92 getgroups = Linux + 80,
93 setgroups = Linux + 81,
94 reserved82 = Linux + 82,
95 symlink = Linux + 83,
96 unused84 = Linux + 84,
97 readlink = Linux + 85,
98 uselib = Linux + 86,
99 swapon = Linux + 87,
100 reboot = Linux + 88,
101 readdir = Linux + 89,
102 mmap = Linux + 90,
103 munmap = Linux + 91,
104 truncate = Linux + 92,
105 ftruncate = Linux + 93,
106 fchmod = Linux + 94,
107 fchown = Linux + 95,
108 getpriority = Linux + 96,
109 setpriority = Linux + 97,
110 profil = Linux + 98,
111 statfs = Linux + 99,
112 fstatfs = Linux + 100,
113 ioperm = Linux + 101,
114 socketcall = Linux + 102,
115 syslog = Linux + 103,
116 setitimer = Linux + 104,
117 getitimer = Linux + 105,
118 stat = Linux + 106,
119 lstat = Linux + 107,
120 fstat = Linux + 108,
121 unused109 = Linux + 109,
122 iopl = Linux + 110,
123 vhangup = Linux + 111,
124 idle = Linux + 112,
125 vm86 = Linux + 113,
126 wait4 = Linux + 114,
127 swapoff = Linux + 115,
128 sysinfo = Linux + 116,
129 ipc = Linux + 117,
130 fsync = Linux + 118,
131 sigreturn = Linux + 119,
132 clone = Linux + 120,
133 setdomainname = Linux + 121,
134 uname = Linux + 122,
135 modify_ldt = Linux + 123,
136 adjtimex = Linux + 124,
137 mprotect = Linux + 125,
138 sigprocmask = Linux + 126,
139 create_module = Linux + 127,
140 init_module = Linux + 128,
141 delete_module = Linux + 129,
142 get_kernel_syms = Linux + 130,
143 quotactl = Linux + 131,
144 getpgid = Linux + 132,
145 fchdir = Linux + 133,
146 bdflush = Linux + 134,
147 sysfs = Linux + 135,
148 personality = Linux + 136,
149 afs_syscall = Linux + 137,
150 setfsuid = Linux + 138,
151 setfsgid = Linux + 139,
152 _llseek = Linux + 140,
153 getdents = Linux + 141,
154 _newselect = Linux + 142,
155 flock = Linux + 143,
156 msync = Linux + 144,
157 readv = Linux + 145,
158 writev = Linux + 146,
159 cacheflush = Linux + 147,
160 cachectl = Linux + 148,
161 sysmips = Linux + 149,
162 unused150 = Linux + 150,
163 getsid = Linux + 151,
164 fdatasync = Linux + 152,
165 _sysctl = Linux + 153,
166 mlock = Linux + 154,
167 munlock = Linux + 155,
168 mlockall = Linux + 156,
169 munlockall = Linux + 157,
170 sched_setparam = Linux + 158,
171 sched_getparam = Linux + 159,
172 sched_setscheduler = Linux + 160,
173 sched_getscheduler = Linux + 161,
174 sched_yield = Linux + 162,
175 sched_get_priority_max = Linux + 163,
176 sched_get_priority_min = Linux + 164,
177 sched_rr_get_interval = Linux + 165,
178 nanosleep = Linux + 166,
179 mremap = Linux + 167,
180 accept = Linux + 168,
181 bind = Linux + 169,
182 connect = Linux + 170,
183 getpeername = Linux + 171,
184 getsockname = Linux + 172,
185 getsockopt = Linux + 173,
186 listen = Linux + 174,
187 recv = Linux + 175,
188 recvfrom = Linux + 176,
189 recvmsg = Linux + 177,
190 send = Linux + 178,
191 sendmsg = Linux + 179,
192 sendto = Linux + 180,
193 setsockopt = Linux + 181,
194 shutdown = Linux + 182,
195 socket = Linux + 183,
196 socketpair = Linux + 184,
197 setresuid = Linux + 185,
198 getresuid = Linux + 186,
199 query_module = Linux + 187,
200 poll = Linux + 188,
201 nfsservctl = Linux + 189,
202 setresgid = Linux + 190,
203 getresgid = Linux + 191,
204 prctl = Linux + 192,
205 rt_sigreturn = Linux + 193,
206 rt_sigaction = Linux + 194,
207 rt_sigprocmask = Linux + 195,
208 rt_sigpending = Linux + 196,
209 rt_sigtimedwait = Linux + 197,
210 rt_sigqueueinfo = Linux + 198,
211 rt_sigsuspend = Linux + 199,
212 pread64 = Linux + 200,
213 pwrite64 = Linux + 201,
214 chown = Linux + 202,
215 getcwd = Linux + 203,
216 capget = Linux + 204,
217 capset = Linux + 205,
218 sigaltstack = Linux + 206,
219 sendfile = Linux + 207,
220 getpmsg = Linux + 208,
221 putpmsg = Linux + 209,
222 mmap2 = Linux + 210,
223 truncate64 = Linux + 211,
224 ftruncate64 = Linux + 212,
225 stat64 = Linux + 213,
226 lstat64 = Linux + 214,
227 fstat64 = Linux + 215,
228 pivot_root = Linux + 216,
229 mincore = Linux + 217,
230 madvise = Linux + 218,
231 getdents64 = Linux + 219,
232 fcntl64 = Linux + 220,
233 reserved221 = Linux + 221,
234 gettid = Linux + 222,
235 readahead = Linux + 223,
236 setxattr = Linux + 224,
237 lsetxattr = Linux + 225,
238 fsetxattr = Linux + 226,
239 getxattr = Linux + 227,
240 lgetxattr = Linux + 228,
241 fgetxattr = Linux + 229,
242 listxattr = Linux + 230,
243 llistxattr = Linux + 231,
244 flistxattr = Linux + 232,
245 removexattr = Linux + 233,
246 lremovexattr = Linux + 234,
247 fremovexattr = Linux + 235,
248 tkill = Linux + 236,
249 sendfile64 = Linux + 237,
250 futex = Linux + 238,
251 sched_setaffinity = Linux + 239,
252 sched_getaffinity = Linux + 240,
253 io_setup = Linux + 241,
254 io_destroy = Linux + 242,
255 io_getevents = Linux + 243,
256 io_submit = Linux + 244,
257 io_cancel = Linux + 245,
258 exit_group = Linux + 246,
259 lookup_dcookie = Linux + 247,
260 epoll_create = Linux + 248,
261 epoll_ctl = Linux + 249,
262 epoll_wait = Linux + 250,
263 remap_file_pages = Linux + 251,
264 set_tid_address = Linux + 252,
265 restart_syscall = Linux + 253,
266 fadvise64 = Linux + 254,
267 statfs64 = Linux + 255,
268 fstatfs64 = Linux + 256,
269 timer_create = Linux + 257,
270 timer_settime = Linux + 258,
271 timer_gettime = Linux + 259,
272 timer_getoverrun = Linux + 260,
273 timer_delete = Linux + 261,
274 clock_settime = Linux + 262,
275 clock_gettime = Linux + 263,
276 clock_getres = Linux + 264,
277 clock_nanosleep = Linux + 265,
278 tgkill = Linux + 266,
279 utimes = Linux + 267,
280 mbind = Linux + 268,
281 get_mempolicy = Linux + 269,
282 set_mempolicy = Linux + 270,
283 mq_open = Linux + 271,
284 mq_unlink = Linux + 272,
285 mq_timedsend = Linux + 273,
286 mq_timedreceive = Linux + 274,
287 mq_notify = Linux + 275,
288 mq_getsetattr = Linux + 276,
289 vserver = Linux + 277,
290 waitid = Linux + 278,
291 add_key = Linux + 280,
292 request_key = Linux + 281,
293 keyctl = Linux + 282,
294 set_thread_area = Linux + 283,
295 inotify_init = Linux + 284,
296 inotify_add_watch = Linux + 285,
297 inotify_rm_watch = Linux + 286,
298 migrate_pages = Linux + 287,
299 openat = Linux + 288,
300 mkdirat = Linux + 289,
301 mknodat = Linux + 290,
302 fchownat = Linux + 291,
303 futimesat = Linux + 292,
304 fstatat64 = Linux + 293,
305 unlinkat = Linux + 294,
306 renameat = Linux + 295,
307 linkat = Linux + 296,
308 symlinkat = Linux + 297,
309 readlinkat = Linux + 298,
310 fchmodat = Linux + 299,
311 faccessat = Linux + 300,
312 pselect6 = Linux + 301,
313 ppoll = Linux + 302,
314 unshare = Linux + 303,
315 splice = Linux + 304,
316 sync_file_range = Linux + 305,
317 tee = Linux + 306,
318 vmsplice = Linux + 307,
319 move_pages = Linux + 308,
320 set_robust_list = Linux + 309,
321 get_robust_list = Linux + 310,
322 kexec_load = Linux + 311,
323 getcpu = Linux + 312,
324 epoll_pwait = Linux + 313,
325 ioprio_set = Linux + 314,
326 ioprio_get = Linux + 315,
327 utimensat = Linux + 316,
328 signalfd = Linux + 317,
329 timerfd = Linux + 318,
330 eventfd = Linux + 319,
331 fallocate = Linux + 320,
332 timerfd_create = Linux + 321,
333 timerfd_gettime = Linux + 322,
334 timerfd_settime = Linux + 323,
335 signalfd4 = Linux + 324,
336 eventfd2 = Linux + 325,
337 epoll_create1 = Linux + 326,
338 dup3 = Linux + 327,
339 pipe2 = Linux + 328,
340 inotify_init1 = Linux + 329,
341 preadv = Linux + 330,
342 pwritev = Linux + 331,
343 rt_tgsigqueueinfo = Linux + 332,
344 perf_event_open = Linux + 333,
345 accept4 = Linux + 334,
346 recvmmsg = Linux + 335,
347 fanotify_init = Linux + 336,
348 fanotify_mark = Linux + 337,
349 prlimit64 = Linux + 338,
350 name_to_handle_at = Linux + 339,
351 open_by_handle_at = Linux + 340,
352 clock_adjtime = Linux + 341,
353 syncfs = Linux + 342,
354 sendmmsg = Linux + 343,
355 setns = Linux + 344,
356 process_vm_readv = Linux + 345,
357 process_vm_writev = Linux + 346,
358 kcmp = Linux + 347,
359 finit_module = Linux + 348,
360 sched_setattr = Linux + 349,
361 sched_getattr = Linux + 350,
362 renameat2 = Linux + 351,
363 seccomp = Linux + 352,
364 getrandom = Linux + 353,
365 memfd_create = Linux + 354,
366 bpf = Linux + 355,
367 execveat = Linux + 356,
368 userfaultfd = Linux + 357,
369 membarrier = Linux + 358,
370 mlock2 = Linux + 359,
371 copy_file_range = Linux + 360,
372 preadv2 = Linux + 361,
373 pwritev2 = Linux + 362,
374 pkey_mprotect = Linux + 363,
375 pkey_alloc = Linux + 364,
376 pkey_free = Linux + 365,
377 statx = Linux + 366,
378 rseq = Linux + 367,
379 io_pgetevents = Linux + 368,
380 openat2 = Linux + 437,
381 pidfd_getfd = Linux + 438,
382
383 _,
384};
380385
381386pub const O_CREAT = 0o0400;
382387pub const O_EXCL = 0o02000;
lib/std/os/bits/linux/riscv64.zig+298-294
......@@ -3,302 +3,306 @@ const std = @import("../../../std.zig");
33const uid_t = std.os.linux.uid_t;
44const gid_t = std.os.linux.gid_t;
55
6pub const SYS_io_setup = 0;
7pub const SYS_io_destroy = 1;
8pub const SYS_io_submit = 2;
9pub const SYS_io_cancel = 3;
10pub const SYS_io_getevents = 4;
11pub const SYS_setxattr = 5;
12pub const SYS_lsetxattr = 6;
13pub const SYS_fsetxattr = 7;
14pub const SYS_getxattr = 8;
15pub const SYS_lgetxattr = 9;
16pub const SYS_fgetxattr = 10;
17pub const SYS_listxattr = 11;
18pub const SYS_llistxattr = 12;
19pub const SYS_flistxattr = 13;
20pub const SYS_removexattr = 14;
21pub const SYS_lremovexattr = 15;
22pub const SYS_fremovexattr = 16;
23pub const SYS_getcwd = 17;
24pub const SYS_lookup_dcookie = 18;
25pub const SYS_eventfd2 = 19;
26pub const SYS_epoll_create1 = 20;
27pub const SYS_epoll_ctl = 21;
28pub const SYS_epoll_pwait = 22;
29pub const SYS_dup = 23;
30pub const SYS_dup3 = 24;
31pub const SYS_fcntl = 25;
32pub const SYS_inotify_init1 = 26;
33pub const SYS_inotify_add_watch = 27;
34pub const SYS_inotify_rm_watch = 28;
35pub const SYS_ioctl = 29;
36pub const SYS_ioprio_set = 30;
37pub const SYS_ioprio_get = 31;
38pub const SYS_flock = 32;
39pub const SYS_mknodat = 33;
40pub const SYS_mkdirat = 34;
41pub const SYS_unlinkat = 35;
42pub const SYS_symlinkat = 36;
43pub const SYS_linkat = 37;
44pub const SYS_umount2 = 39;
45pub const SYS_mount = 40;
46pub const SYS_pivot_root = 41;
47pub const SYS_nfsservctl = 42;
48pub const SYS_statfs = 43;
49pub const SYS_fstatfs = 44;
50pub const SYS_truncate = 45;
51pub const SYS_ftruncate = 46;
52pub const SYS_fallocate = 47;
53pub const SYS_faccessat = 48;
54pub const SYS_chdir = 49;
55pub const SYS_fchdir = 50;
56pub const SYS_chroot = 51;
57pub const SYS_fchmod = 52;
58pub const SYS_fchmodat = 53;
59pub const SYS_fchownat = 54;
60pub const SYS_fchown = 55;
61pub const SYS_openat = 56;
62pub const SYS_close = 57;
63pub const SYS_vhangup = 58;
64pub const SYS_pipe2 = 59;
65pub const SYS_quotactl = 60;
66pub const SYS_getdents64 = 61;
67pub const SYS_lseek = 62;
68pub const SYS_read = 63;
69pub const SYS_write = 64;
70pub const SYS_readv = 65;
71pub const SYS_writev = 66;
72pub const SYS_pread64 = 67;
73pub const SYS_pwrite64 = 68;
74pub const SYS_preadv = 69;
75pub const SYS_pwritev = 70;
76pub const SYS_sendfile = 71;
77pub const SYS_pselect6 = 72;
78pub const SYS_ppoll = 73;
79pub const SYS_signalfd4 = 74;
80pub const SYS_vmsplice = 75;
81pub const SYS_splice = 76;
82pub const SYS_tee = 77;
83pub const SYS_readlinkat = 78;
84pub const SYS_fstatat = 79;
85pub const SYS_fstat = 80;
86pub const SYS_sync = 81;
87pub const SYS_fsync = 82;
88pub const SYS_fdatasync = 83;
89pub const SYS_sync_file_range = 84;
90pub const SYS_timerfd_create = 85;
91pub const SYS_timerfd_settime = 86;
92pub const SYS_timerfd_gettime = 87;
93pub const SYS_utimensat = 88;
94pub const SYS_acct = 89;
95pub const SYS_capget = 90;
96pub const SYS_capset = 91;
97pub const SYS_personality = 92;
98pub const SYS_exit = 93;
99pub const SYS_exit_group = 94;
100pub const SYS_waitid = 95;
101pub const SYS_set_tid_address = 96;
102pub const SYS_unshare = 97;
103pub const SYS_futex = 98;
104pub const SYS_set_robust_list = 99;
105pub const SYS_get_robust_list = 100;
106pub const SYS_nanosleep = 101;
107pub const SYS_getitimer = 102;
108pub const SYS_setitimer = 103;
109pub const SYS_kexec_load = 104;
110pub const SYS_init_module = 105;
111pub const SYS_delete_module = 106;
112pub const SYS_timer_create = 107;
113pub const SYS_timer_gettime = 108;
114pub const SYS_timer_getoverrun = 109;
115pub const SYS_timer_settime = 110;
116pub const SYS_timer_delete = 111;
117pub const SYS_clock_settime = 112;
118pub const SYS_clock_gettime = 113;
119pub const SYS_clock_getres = 114;
120pub const SYS_clock_nanosleep = 115;
121pub const SYS_syslog = 116;
122pub const SYS_ptrace = 117;
123pub const SYS_sched_setparam = 118;
124pub const SYS_sched_setscheduler = 119;
125pub const SYS_sched_getscheduler = 120;
126pub const SYS_sched_getparam = 121;
127pub const SYS_sched_setaffinity = 122;
128pub const SYS_sched_getaffinity = 123;
129pub const SYS_sched_yield = 124;
130pub const SYS_sched_get_priority_max = 125;
131pub const SYS_sched_get_priority_min = 126;
132pub const SYS_sched_rr_get_interval = 127;
133pub const SYS_restart_syscall = 128;
134pub const SYS_kill = 129;
135pub const SYS_tkill = 130;
136pub const SYS_tgkill = 131;
137pub const SYS_sigaltstack = 132;
138pub const SYS_rt_sigsuspend = 133;
139pub const SYS_rt_sigaction = 134;
140pub const SYS_rt_sigprocmask = 135;
141pub const SYS_rt_sigpending = 136;
142pub const SYS_rt_sigtimedwait = 137;
143pub const SYS_rt_sigqueueinfo = 138;
144pub const SYS_rt_sigreturn = 139;
145pub const SYS_setpriority = 140;
146pub const SYS_getpriority = 141;
147pub const SYS_reboot = 142;
148pub const SYS_setregid = 143;
149pub const SYS_setgid = 144;
150pub const SYS_setreuid = 145;
151pub const SYS_setuid = 146;
152pub const SYS_setresuid = 147;
153pub const SYS_getresuid = 148;
154pub const SYS_setresgid = 149;
155pub const SYS_getresgid = 150;
156pub const SYS_setfsuid = 151;
157pub const SYS_setfsgid = 152;
158pub const SYS_times = 153;
159pub const SYS_setpgid = 154;
160pub const SYS_getpgid = 155;
161pub const SYS_getsid = 156;
162pub const SYS_setsid = 157;
163pub const SYS_getgroups = 158;
164pub const SYS_setgroups = 159;
165pub const SYS_uname = 160;
166pub const SYS_sethostname = 161;
167pub const SYS_setdomainname = 162;
168pub const SYS_getrlimit = 163;
169pub const SYS_setrlimit = 164;
170pub const SYS_getrusage = 165;
171pub const SYS_umask = 166;
172pub const SYS_prctl = 167;
173pub const SYS_getcpu = 168;
174pub const SYS_gettimeofday = 169;
175pub const SYS_settimeofday = 170;
176pub const SYS_adjtimex = 171;
177pub const SYS_getpid = 172;
178pub const SYS_getppid = 173;
179pub const SYS_getuid = 174;
180pub const SYS_geteuid = 175;
181pub const SYS_getgid = 176;
182pub const SYS_getegid = 177;
183pub const SYS_gettid = 178;
184pub const SYS_sysinfo = 179;
185pub const SYS_mq_open = 180;
186pub const SYS_mq_unlink = 181;
187pub const SYS_mq_timedsend = 182;
188pub const SYS_mq_timedreceive = 183;
189pub const SYS_mq_notify = 184;
190pub const SYS_mq_getsetattr = 185;
191pub const SYS_msgget = 186;
192pub const SYS_msgctl = 187;
193pub const SYS_msgrcv = 188;
194pub const SYS_msgsnd = 189;
195pub const SYS_semget = 190;
196pub const SYS_semctl = 191;
197pub const SYS_semtimedop = 192;
198pub const SYS_semop = 193;
199pub const SYS_shmget = 194;
200pub const SYS_shmctl = 195;
201pub const SYS_shmat = 196;
202pub const SYS_shmdt = 197;
203pub const SYS_socket = 198;
204pub const SYS_socketpair = 199;
205pub const SYS_bind = 200;
206pub const SYS_listen = 201;
207pub const SYS_accept = 202;
208pub const SYS_connect = 203;
209pub const SYS_getsockname = 204;
210pub const SYS_getpeername = 205;
211pub const SYS_sendto = 206;
212pub const SYS_recvfrom = 207;
213pub const SYS_setsockopt = 208;
214pub const SYS_getsockopt = 209;
215pub const SYS_shutdown = 210;
216pub const SYS_sendmsg = 211;
217pub const SYS_recvmsg = 212;
218pub const SYS_readahead = 213;
219pub const SYS_brk = 214;
220pub const SYS_munmap = 215;
221pub const SYS_mremap = 216;
222pub const SYS_add_key = 217;
223pub const SYS_request_key = 218;
224pub const SYS_keyctl = 219;
225pub const SYS_clone = 220;
226pub const SYS_execve = 221;
227pub const SYS_mmap = 222;
228pub const SYS_fadvise64 = 223;
229pub const SYS_swapon = 224;
230pub const SYS_swapoff = 225;
231pub const SYS_mprotect = 226;
232pub const SYS_msync = 227;
233pub const SYS_mlock = 228;
234pub const SYS_munlock = 229;
235pub const SYS_mlockall = 230;
236pub const SYS_munlockall = 231;
237pub const SYS_mincore = 232;
238pub const SYS_madvise = 233;
239pub const SYS_remap_file_pages = 234;
240pub const SYS_mbind = 235;
241pub const SYS_get_mempolicy = 236;
242pub const SYS_set_mempolicy = 237;
243pub const SYS_migrate_pages = 238;
244pub const SYS_move_pages = 239;
245pub const SYS_rt_tgsigqueueinfo = 240;
246pub const SYS_perf_event_open = 241;
247pub const SYS_accept4 = 242;
248pub const SYS_recvmmsg = 243;
6pub const SYS = extern enum(usize) {
7 io_setup = 0,
8 io_destroy = 1,
9 io_submit = 2,
10 io_cancel = 3,
11 io_getevents = 4,
12 setxattr = 5,
13 lsetxattr = 6,
14 fsetxattr = 7,
15 getxattr = 8,
16 lgetxattr = 9,
17 fgetxattr = 10,
18 listxattr = 11,
19 llistxattr = 12,
20 flistxattr = 13,
21 removexattr = 14,
22 lremovexattr = 15,
23 fremovexattr = 16,
24 getcwd = 17,
25 lookup_dcookie = 18,
26 eventfd2 = 19,
27 epoll_create1 = 20,
28 epoll_ctl = 21,
29 epoll_pwait = 22,
30 dup = 23,
31 dup3 = 24,
32 fcntl = 25,
33 inotify_init1 = 26,
34 inotify_add_watch = 27,
35 inotify_rm_watch = 28,
36 ioctl = 29,
37 ioprio_set = 30,
38 ioprio_get = 31,
39 flock = 32,
40 mknodat = 33,
41 mkdirat = 34,
42 unlinkat = 35,
43 symlinkat = 36,
44 linkat = 37,
45 umount2 = 39,
46 mount = 40,
47 pivot_root = 41,
48 nfsservctl = 42,
49 statfs = 43,
50 fstatfs = 44,
51 truncate = 45,
52 ftruncate = 46,
53 fallocate = 47,
54 faccessat = 48,
55 chdir = 49,
56 fchdir = 50,
57 chroot = 51,
58 fchmod = 52,
59 fchmodat = 53,
60 fchownat = 54,
61 fchown = 55,
62 openat = 56,
63 close = 57,
64 vhangup = 58,
65 pipe2 = 59,
66 quotactl = 60,
67 getdents64 = 61,
68 lseek = 62,
69 read = 63,
70 write = 64,
71 readv = 65,
72 writev = 66,
73 pread64 = 67,
74 pwrite64 = 68,
75 preadv = 69,
76 pwritev = 70,
77 sendfile = 71,
78 pselect6 = 72,
79 ppoll = 73,
80 signalfd4 = 74,
81 vmsplice = 75,
82 splice = 76,
83 tee = 77,
84 readlinkat = 78,
85 fstatat = 79,
86 fstat = 80,
87 sync = 81,
88 fsync = 82,
89 fdatasync = 83,
90 sync_file_range = 84,
91 timerfd_create = 85,
92 timerfd_settime = 86,
93 timerfd_gettime = 87,
94 utimensat = 88,
95 acct = 89,
96 capget = 90,
97 capset = 91,
98 personality = 92,
99 exit = 93,
100 exit_group = 94,
101 waitid = 95,
102 set_tid_address = 96,
103 unshare = 97,
104 futex = 98,
105 set_robust_list = 99,
106 get_robust_list = 100,
107 nanosleep = 101,
108 getitimer = 102,
109 setitimer = 103,
110 kexec_load = 104,
111 init_module = 105,
112 delete_module = 106,
113 timer_create = 107,
114 timer_gettime = 108,
115 timer_getoverrun = 109,
116 timer_settime = 110,
117 timer_delete = 111,
118 clock_settime = 112,
119 clock_gettime = 113,
120 clock_getres = 114,
121 clock_nanosleep = 115,
122 syslog = 116,
123 ptrace = 117,
124 sched_setparam = 118,
125 sched_setscheduler = 119,
126 sched_getscheduler = 120,
127 sched_getparam = 121,
128 sched_setaffinity = 122,
129 sched_getaffinity = 123,
130 sched_yield = 124,
131 sched_get_priority_max = 125,
132 sched_get_priority_min = 126,
133 sched_rr_get_interval = 127,
134 restart_syscall = 128,
135 kill = 129,
136 tkill = 130,
137 tgkill = 131,
138 sigaltstack = 132,
139 rt_sigsuspend = 133,
140 rt_sigaction = 134,
141 rt_sigprocmask = 135,
142 rt_sigpending = 136,
143 rt_sigtimedwait = 137,
144 rt_sigqueueinfo = 138,
145 rt_sigreturn = 139,
146 setpriority = 140,
147 getpriority = 141,
148 reboot = 142,
149 setregid = 143,
150 setgid = 144,
151 setreuid = 145,
152 setuid = 146,
153 setresuid = 147,
154 getresuid = 148,
155 setresgid = 149,
156 getresgid = 150,
157 setfsuid = 151,
158 setfsgid = 152,
159 times = 153,
160 setpgid = 154,
161 getpgid = 155,
162 getsid = 156,
163 setsid = 157,
164 getgroups = 158,
165 setgroups = 159,
166 uname = 160,
167 sethostname = 161,
168 setdomainname = 162,
169 getrlimit = 163,
170 setrlimit = 164,
171 getrusage = 165,
172 umask = 166,
173 prctl = 167,
174 getcpu = 168,
175 gettimeofday = 169,
176 settimeofday = 170,
177 adjtimex = 171,
178 getpid = 172,
179 getppid = 173,
180 getuid = 174,
181 geteuid = 175,
182 getgid = 176,
183 getegid = 177,
184 gettid = 178,
185 sysinfo = 179,
186 mq_open = 180,
187 mq_unlink = 181,
188 mq_timedsend = 182,
189 mq_timedreceive = 183,
190 mq_notify = 184,
191 mq_getsetattr = 185,
192 msgget = 186,
193 msgctl = 187,
194 msgrcv = 188,
195 msgsnd = 189,
196 semget = 190,
197 semctl = 191,
198 semtimedop = 192,
199 semop = 193,
200 shmget = 194,
201 shmctl = 195,
202 shmat = 196,
203 shmdt = 197,
204 socket = 198,
205 socketpair = 199,
206 bind = 200,
207 listen = 201,
208 accept = 202,
209 connect = 203,
210 getsockname = 204,
211 getpeername = 205,
212 sendto = 206,
213 recvfrom = 207,
214 setsockopt = 208,
215 getsockopt = 209,
216 shutdown = 210,
217 sendmsg = 211,
218 recvmsg = 212,
219 readahead = 213,
220 brk = 214,
221 munmap = 215,
222 mremap = 216,
223 add_key = 217,
224 request_key = 218,
225 keyctl = 219,
226 clone = 220,
227 execve = 221,
228 mmap = 222,
229 fadvise64 = 223,
230 swapon = 224,
231 swapoff = 225,
232 mprotect = 226,
233 msync = 227,
234 mlock = 228,
235 munlock = 229,
236 mlockall = 230,
237 munlockall = 231,
238 mincore = 232,
239 madvise = 233,
240 remap_file_pages = 234,
241 mbind = 235,
242 get_mempolicy = 236,
243 set_mempolicy = 237,
244 migrate_pages = 238,
245 move_pages = 239,
246 rt_tgsigqueueinfo = 240,
247 perf_event_open = 241,
248 accept4 = 242,
249 recvmmsg = 243,
249250
250pub const SYS_arch_specific_syscall = 244;
251pub const SYS_riscv_flush_icache = SYS_arch_specific_syscall + 15;
251 pub const arch_specific_syscall = 244;
252 riscv_flush_icache = arch_specific_syscall + 15,
252253
253pub const SYS_wait4 = 260;
254pub const SYS_prlimit64 = 261;
255pub const SYS_fanotify_init = 262;
256pub const SYS_fanotify_mark = 263;
257pub const SYS_name_to_handle_at = 264;
258pub const SYS_open_by_handle_at = 265;
259pub const SYS_clock_adjtime = 266;
260pub const SYS_syncfs = 267;
261pub const SYS_setns = 268;
262pub const SYS_sendmmsg = 269;
263pub const SYS_process_vm_readv = 270;
264pub const SYS_process_vm_writev = 271;
265pub const SYS_kcmp = 272;
266pub const SYS_finit_module = 273;
267pub const SYS_sched_setattr = 274;
268pub const SYS_sched_getattr = 275;
269pub const SYS_renameat2 = 276;
270pub const SYS_seccomp = 277;
271pub const SYS_getrandom = 278;
272pub const SYS_memfd_create = 279;
273pub const SYS_bpf = 280;
274pub const SYS_execveat = 281;
275pub const SYS_userfaultfd = 282;
276pub const SYS_membarrier = 283;
277pub const SYS_mlock2 = 284;
278pub const SYS_copy_file_range = 285;
279pub const SYS_preadv2 = 286;
280pub const SYS_pwritev2 = 287;
281pub const SYS_pkey_mprotect = 288;
282pub const SYS_pkey_alloc = 289;
283pub const SYS_pkey_free = 290;
284pub const SYS_statx = 291;
285pub const SYS_io_pgetevents = 292;
286pub const SYS_rseq = 293;
287pub const SYS_kexec_file_load = 294;
288pub const SYS_pidfd_send_signal = 424;
289pub const SYS_io_uring_setup = 425;
290pub const SYS_io_uring_enter = 426;
291pub const SYS_io_uring_register = 427;
292pub const SYS_open_tree = 428;
293pub const SYS_move_mount = 429;
294pub const SYS_fsopen = 430;
295pub const SYS_fsconfig = 431;
296pub const SYS_fsmount = 432;
297pub const SYS_fspick = 433;
298pub const SYS_pidfd_open = 434;
299pub const SYS_clone3 = 435;
300pub const SYS_openat2 = 437;
301pub const SYS_pidfd_getfd = 438;
254 wait4 = 260,
255 prlimit64 = 261,
256 fanotify_init = 262,
257 fanotify_mark = 263,
258 name_to_handle_at = 264,
259 open_by_handle_at = 265,
260 clock_adjtime = 266,
261 syncfs = 267,
262 setns = 268,
263 sendmmsg = 269,
264 process_vm_readv = 270,
265 process_vm_writev = 271,
266 kcmp = 272,
267 finit_module = 273,
268 sched_setattr = 274,
269 sched_getattr = 275,
270 renameat2 = 276,
271 seccomp = 277,
272 getrandom = 278,
273 memfd_create = 279,
274 bpf = 280,
275 execveat = 281,
276 userfaultfd = 282,
277 membarrier = 283,
278 mlock2 = 284,
279 copy_file_range = 285,
280 preadv2 = 286,
281 pwritev2 = 287,
282 pkey_mprotect = 288,
283 pkey_alloc = 289,
284 pkey_free = 290,
285 statx = 291,
286 io_pgetevents = 292,
287 rseq = 293,
288 kexec_file_load = 294,
289 pidfd_send_signal = 424,
290 io_uring_setup = 425,
291 io_uring_enter = 426,
292 io_uring_register = 427,
293 open_tree = 428,
294 move_mount = 429,
295 fsopen = 430,
296 fsconfig = 431,
297 fsmount = 432,
298 fspick = 433,
299 pidfd_open = 434,
300 clone3 = 435,
301 openat2 = 437,
302 pidfd_getfd = 438,
303
304 _,
305};
302306
303307pub const O_CREAT = 0o100;
304308pub const O_EXCL = 0o200;
lib/std/os/bits/linux/x86_64.zig+354-350
......@@ -14,356 +14,360 @@ const iovec_const = linux.iovec_const;
1414
1515pub const mode_t = usize;
1616
17pub const SYS_read = 0;
18pub const SYS_write = 1;
19pub const SYS_open = 2;
20pub const SYS_close = 3;
21pub const SYS_stat = 4;
22pub const SYS_fstat = 5;
23pub const SYS_lstat = 6;
24pub const SYS_poll = 7;
25pub const SYS_lseek = 8;
26pub const SYS_mmap = 9;
27pub const SYS_mprotect = 10;
28pub const SYS_munmap = 11;
29pub const SYS_brk = 12;
30pub const SYS_rt_sigaction = 13;
31pub const SYS_rt_sigprocmask = 14;
32pub const SYS_rt_sigreturn = 15;
33pub const SYS_ioctl = 16;
34pub const SYS_pread = 17;
35pub const SYS_pwrite = 18;
36pub const SYS_readv = 19;
37pub const SYS_writev = 20;
38pub const SYS_access = 21;
39pub const SYS_pipe = 22;
40pub const SYS_select = 23;
41pub const SYS_sched_yield = 24;
42pub const SYS_mremap = 25;
43pub const SYS_msync = 26;
44pub const SYS_mincore = 27;
45pub const SYS_madvise = 28;
46pub const SYS_shmget = 29;
47pub const SYS_shmat = 30;
48pub const SYS_shmctl = 31;
49pub const SYS_dup = 32;
50pub const SYS_dup2 = 33;
51pub const SYS_pause = 34;
52pub const SYS_nanosleep = 35;
53pub const SYS_getitimer = 36;
54pub const SYS_alarm = 37;
55pub const SYS_setitimer = 38;
56pub const SYS_getpid = 39;
57pub const SYS_sendfile = 40;
58pub const SYS_socket = 41;
59pub const SYS_connect = 42;
60pub const SYS_accept = 43;
61pub const SYS_sendto = 44;
62pub const SYS_recvfrom = 45;
63pub const SYS_sendmsg = 46;
64pub const SYS_recvmsg = 47;
65pub const SYS_shutdown = 48;
66pub const SYS_bind = 49;
67pub const SYS_listen = 50;
68pub const SYS_getsockname = 51;
69pub const SYS_getpeername = 52;
70pub const SYS_socketpair = 53;
71pub const SYS_setsockopt = 54;
72pub const SYS_getsockopt = 55;
73pub const SYS_clone = 56;
74pub const SYS_fork = 57;
75pub const SYS_vfork = 58;
76pub const SYS_execve = 59;
77pub const SYS_exit = 60;
78pub const SYS_wait4 = 61;
79pub const SYS_kill = 62;
80pub const SYS_uname = 63;
81pub const SYS_semget = 64;
82pub const SYS_semop = 65;
83pub const SYS_semctl = 66;
84pub const SYS_shmdt = 67;
85pub const SYS_msgget = 68;
86pub const SYS_msgsnd = 69;
87pub const SYS_msgrcv = 70;
88pub const SYS_msgctl = 71;
89pub const SYS_fcntl = 72;
90pub const SYS_flock = 73;
91pub const SYS_fsync = 74;
92pub const SYS_fdatasync = 75;
93pub const SYS_truncate = 76;
94pub const SYS_ftruncate = 77;
95pub const SYS_getdents = 78;
96pub const SYS_getcwd = 79;
97pub const SYS_chdir = 80;
98pub const SYS_fchdir = 81;
99pub const SYS_rename = 82;
100pub const SYS_mkdir = 83;
101pub const SYS_rmdir = 84;
102pub const SYS_creat = 85;
103pub const SYS_link = 86;
104pub const SYS_unlink = 87;
105pub const SYS_symlink = 88;
106pub const SYS_readlink = 89;
107pub const SYS_chmod = 90;
108pub const SYS_fchmod = 91;
109pub const SYS_chown = 92;
110pub const SYS_fchown = 93;
111pub const SYS_lchown = 94;
112pub const SYS_umask = 95;
113pub const SYS_gettimeofday = 96;
114pub const SYS_getrlimit = 97;
115pub const SYS_getrusage = 98;
116pub const SYS_sysinfo = 99;
117pub const SYS_times = 100;
118pub const SYS_ptrace = 101;
119pub const SYS_getuid = 102;
120pub const SYS_syslog = 103;
121pub const SYS_getgid = 104;
122pub const SYS_setuid = 105;
123pub const SYS_setgid = 106;
124pub const SYS_geteuid = 107;
125pub const SYS_getegid = 108;
126pub const SYS_setpgid = 109;
127pub const SYS_getppid = 110;
128pub const SYS_getpgrp = 111;
129pub const SYS_setsid = 112;
130pub const SYS_setreuid = 113;
131pub const SYS_setregid = 114;
132pub const SYS_getgroups = 115;
133pub const SYS_setgroups = 116;
134pub const SYS_setresuid = 117;
135pub const SYS_getresuid = 118;
136pub const SYS_setresgid = 119;
137pub const SYS_getresgid = 120;
138pub const SYS_getpgid = 121;
139pub const SYS_setfsuid = 122;
140pub const SYS_setfsgid = 123;
141pub const SYS_getsid = 124;
142pub const SYS_capget = 125;
143pub const SYS_capset = 126;
144pub const SYS_rt_sigpending = 127;
145pub const SYS_rt_sigtimedwait = 128;
146pub const SYS_rt_sigqueueinfo = 129;
147pub const SYS_rt_sigsuspend = 130;
148pub const SYS_sigaltstack = 131;
149pub const SYS_utime = 132;
150pub const SYS_mknod = 133;
151pub const SYS_uselib = 134;
152pub const SYS_personality = 135;
153pub const SYS_ustat = 136;
154pub const SYS_statfs = 137;
155pub const SYS_fstatfs = 138;
156pub const SYS_sysfs = 139;
157pub const SYS_getpriority = 140;
158pub const SYS_setpriority = 141;
159pub const SYS_sched_setparam = 142;
160pub const SYS_sched_getparam = 143;
161pub const SYS_sched_setscheduler = 144;
162pub const SYS_sched_getscheduler = 145;
163pub const SYS_sched_get_priority_max = 146;
164pub const SYS_sched_get_priority_min = 147;
165pub const SYS_sched_rr_get_interval = 148;
166pub const SYS_mlock = 149;
167pub const SYS_munlock = 150;
168pub const SYS_mlockall = 151;
169pub const SYS_munlockall = 152;
170pub const SYS_vhangup = 153;
171pub const SYS_modify_ldt = 154;
172pub const SYS_pivot_root = 155;
173pub const SYS__sysctl = 156;
174pub const SYS_prctl = 157;
175pub const SYS_arch_prctl = 158;
176pub const SYS_adjtimex = 159;
177pub const SYS_setrlimit = 160;
178pub const SYS_chroot = 161;
179pub const SYS_sync = 162;
180pub const SYS_acct = 163;
181pub const SYS_settimeofday = 164;
182pub const SYS_mount = 165;
183pub const SYS_umount2 = 166;
184pub const SYS_swapon = 167;
185pub const SYS_swapoff = 168;
186pub const SYS_reboot = 169;
187pub const SYS_sethostname = 170;
188pub const SYS_setdomainname = 171;
189pub const SYS_iopl = 172;
190pub const SYS_ioperm = 173;
191pub const SYS_create_module = 174;
192pub const SYS_init_module = 175;
193pub const SYS_delete_module = 176;
194pub const SYS_get_kernel_syms = 177;
195pub const SYS_query_module = 178;
196pub const SYS_quotactl = 179;
197pub const SYS_nfsservctl = 180;
198pub const SYS_getpmsg = 181;
199pub const SYS_putpmsg = 182;
200pub const SYS_afs_syscall = 183;
201pub const SYS_tuxcall = 184;
202pub const SYS_security = 185;
203pub const SYS_gettid = 186;
204pub const SYS_readahead = 187;
205pub const SYS_setxattr = 188;
206pub const SYS_lsetxattr = 189;
207pub const SYS_fsetxattr = 190;
208pub const SYS_getxattr = 191;
209pub const SYS_lgetxattr = 192;
210pub const SYS_fgetxattr = 193;
211pub const SYS_listxattr = 194;
212pub const SYS_llistxattr = 195;
213pub const SYS_flistxattr = 196;
214pub const SYS_removexattr = 197;
215pub const SYS_lremovexattr = 198;
216pub const SYS_fremovexattr = 199;
217pub const SYS_tkill = 200;
218pub const SYS_time = 201;
219pub const SYS_futex = 202;
220pub const SYS_sched_setaffinity = 203;
221pub const SYS_sched_getaffinity = 204;
222pub const SYS_set_thread_area = 205;
223pub const SYS_io_setup = 206;
224pub const SYS_io_destroy = 207;
225pub const SYS_io_getevents = 208;
226pub const SYS_io_submit = 209;
227pub const SYS_io_cancel = 210;
228pub const SYS_get_thread_area = 211;
229pub const SYS_lookup_dcookie = 212;
230pub const SYS_epoll_create = 213;
231pub const SYS_epoll_ctl_old = 214;
232pub const SYS_epoll_wait_old = 215;
233pub const SYS_remap_file_pages = 216;
234pub const SYS_getdents64 = 217;
235pub const SYS_set_tid_address = 218;
236pub const SYS_restart_syscall = 219;
237pub const SYS_semtimedop = 220;
238pub const SYS_fadvise64 = 221;
239pub const SYS_timer_create = 222;
240pub const SYS_timer_settime = 223;
241pub const SYS_timer_gettime = 224;
242pub const SYS_timer_getoverrun = 225;
243pub const SYS_timer_delete = 226;
244pub const SYS_clock_settime = 227;
245pub const SYS_clock_gettime = 228;
246pub const SYS_clock_getres = 229;
247pub const SYS_clock_nanosleep = 230;
248pub const SYS_exit_group = 231;
249pub const SYS_epoll_wait = 232;
250pub const SYS_epoll_ctl = 233;
251pub const SYS_tgkill = 234;
252pub const SYS_utimes = 235;
253pub const SYS_vserver = 236;
254pub const SYS_mbind = 237;
255pub const SYS_set_mempolicy = 238;
256pub const SYS_get_mempolicy = 239;
257pub const SYS_mq_open = 240;
258pub const SYS_mq_unlink = 241;
259pub const SYS_mq_timedsend = 242;
260pub const SYS_mq_timedreceive = 243;
261pub const SYS_mq_notify = 244;
262pub const SYS_mq_getsetattr = 245;
263pub const SYS_kexec_load = 246;
264pub const SYS_waitid = 247;
265pub const SYS_add_key = 248;
266pub const SYS_request_key = 249;
267pub const SYS_keyctl = 250;
268pub const SYS_ioprio_set = 251;
269pub const SYS_ioprio_get = 252;
270pub const SYS_inotify_init = 253;
271pub const SYS_inotify_add_watch = 254;
272pub const SYS_inotify_rm_watch = 255;
273pub const SYS_migrate_pages = 256;
274pub const SYS_openat = 257;
275pub const SYS_mkdirat = 258;
276pub const SYS_mknodat = 259;
277pub const SYS_fchownat = 260;
278pub const SYS_futimesat = 261;
279pub const SYS_newfstatat = 262;
280pub const SYS_fstatat = 262;
281pub const SYS_unlinkat = 263;
282pub const SYS_renameat = 264;
283pub const SYS_linkat = 265;
284pub const SYS_symlinkat = 266;
285pub const SYS_readlinkat = 267;
286pub const SYS_fchmodat = 268;
287pub const SYS_faccessat = 269;
288pub const SYS_pselect6 = 270;
289pub const SYS_ppoll = 271;
290pub const SYS_unshare = 272;
291pub const SYS_set_robust_list = 273;
292pub const SYS_get_robust_list = 274;
293pub const SYS_splice = 275;
294pub const SYS_tee = 276;
295pub const SYS_sync_file_range = 277;
296pub const SYS_vmsplice = 278;
297pub const SYS_move_pages = 279;
298pub const SYS_utimensat = 280;
299pub const SYS_epoll_pwait = 281;
300pub const SYS_signalfd = 282;
301pub const SYS_timerfd_create = 283;
302pub const SYS_eventfd = 284;
303pub const SYS_fallocate = 285;
304pub const SYS_timerfd_settime = 286;
305pub const SYS_timerfd_gettime = 287;
306pub const SYS_accept4 = 288;
307pub const SYS_signalfd4 = 289;
308pub const SYS_eventfd2 = 290;
309pub const SYS_epoll_create1 = 291;
310pub const SYS_dup3 = 292;
311pub const SYS_pipe2 = 293;
312pub const SYS_inotify_init1 = 294;
313pub const SYS_preadv = 295;
314pub const SYS_pwritev = 296;
315pub const SYS_rt_tgsigqueueinfo = 297;
316pub const SYS_perf_event_open = 298;
317pub const SYS_recvmmsg = 299;
318pub const SYS_fanotify_init = 300;
319pub const SYS_fanotify_mark = 301;
320pub const SYS_prlimit64 = 302;
321pub const SYS_name_to_handle_at = 303;
322pub const SYS_open_by_handle_at = 304;
323pub const SYS_clock_adjtime = 305;
324pub const SYS_syncfs = 306;
325pub const SYS_sendmmsg = 307;
326pub const SYS_setns = 308;
327pub const SYS_getcpu = 309;
328pub const SYS_process_vm_readv = 310;
329pub const SYS_process_vm_writev = 311;
330pub const SYS_kcmp = 312;
331pub const SYS_finit_module = 313;
332pub const SYS_sched_setattr = 314;
333pub const SYS_sched_getattr = 315;
334pub const SYS_renameat2 = 316;
335pub const SYS_seccomp = 317;
336pub const SYS_getrandom = 318;
337pub const SYS_memfd_create = 319;
338pub const SYS_kexec_file_load = 320;
339pub const SYS_bpf = 321;
340pub const SYS_execveat = 322;
341pub const SYS_userfaultfd = 323;
342pub const SYS_membarrier = 324;
343pub const SYS_mlock2 = 325;
344pub const SYS_copy_file_range = 326;
345pub const SYS_preadv2 = 327;
346pub const SYS_pwritev2 = 328;
347pub const SYS_pkey_mprotect = 329;
348pub const SYS_pkey_alloc = 330;
349pub const SYS_pkey_free = 331;
350pub const SYS_statx = 332;
351pub const SYS_io_pgetevents = 333;
352pub const SYS_rseq = 334;
353pub const SYS_pidfd_send_signal = 424;
354pub const SYS_io_uring_setup = 425;
355pub const SYS_io_uring_enter = 426;
356pub const SYS_io_uring_register = 427;
357pub const SYS_open_tree = 428;
358pub const SYS_move_mount = 429;
359pub const SYS_fsopen = 430;
360pub const SYS_fsconfig = 431;
361pub const SYS_fsmount = 432;
362pub const SYS_fspick = 433;
363pub const SYS_pidfd_open = 434;
364pub const SYS_clone3 = 435;
365pub const SYS_openat2 = 437;
366pub const SYS_pidfd_getfd = 438;
17pub const SYS = extern enum(usize) {
18 read = 0,
19 write = 1,
20 open = 2,
21 close = 3,
22 stat = 4,
23 fstat = 5,
24 lstat = 6,
25 poll = 7,
26 lseek = 8,
27 mmap = 9,
28 mprotect = 10,
29 munmap = 11,
30 brk = 12,
31 rt_sigaction = 13,
32 rt_sigprocmask = 14,
33 rt_sigreturn = 15,
34 ioctl = 16,
35 pread = 17,
36 pwrite = 18,
37 readv = 19,
38 writev = 20,
39 access = 21,
40 pipe = 22,
41 select = 23,
42 sched_yield = 24,
43 mremap = 25,
44 msync = 26,
45 mincore = 27,
46 madvise = 28,
47 shmget = 29,
48 shmat = 30,
49 shmctl = 31,
50 dup = 32,
51 dup2 = 33,
52 pause = 34,
53 nanosleep = 35,
54 getitimer = 36,
55 alarm = 37,
56 setitimer = 38,
57 getpid = 39,
58 sendfile = 40,
59 socket = 41,
60 connect = 42,
61 accept = 43,
62 sendto = 44,
63 recvfrom = 45,
64 sendmsg = 46,
65 recvmsg = 47,
66 shutdown = 48,
67 bind = 49,
68 listen = 50,
69 getsockname = 51,
70 getpeername = 52,
71 socketpair = 53,
72 setsockopt = 54,
73 getsockopt = 55,
74 clone = 56,
75 fork = 57,
76 vfork = 58,
77 execve = 59,
78 exit = 60,
79 wait4 = 61,
80 kill = 62,
81 uname = 63,
82 semget = 64,
83 semop = 65,
84 semctl = 66,
85 shmdt = 67,
86 msgget = 68,
87 msgsnd = 69,
88 msgrcv = 70,
89 msgctl = 71,
90 fcntl = 72,
91 flock = 73,
92 fsync = 74,
93 fdatasync = 75,
94 truncate = 76,
95 ftruncate = 77,
96 getdents = 78,
97 getcwd = 79,
98 chdir = 80,
99 fchdir = 81,
100 rename = 82,
101 mkdir = 83,
102 rmdir = 84,
103 creat = 85,
104 link = 86,
105 unlink = 87,
106 symlink = 88,
107 readlink = 89,
108 chmod = 90,
109 fchmod = 91,
110 chown = 92,
111 fchown = 93,
112 lchown = 94,
113 umask = 95,
114 gettimeofday = 96,
115 getrlimit = 97,
116 getrusage = 98,
117 sysinfo = 99,
118 times = 100,
119 ptrace = 101,
120 getuid = 102,
121 syslog = 103,
122 getgid = 104,
123 setuid = 105,
124 setgid = 106,
125 geteuid = 107,
126 getegid = 108,
127 setpgid = 109,
128 getppid = 110,
129 getpgrp = 111,
130 setsid = 112,
131 setreuid = 113,
132 setregid = 114,
133 getgroups = 115,
134 setgroups = 116,
135 setresuid = 117,
136 getresuid = 118,
137 setresgid = 119,
138 getresgid = 120,
139 getpgid = 121,
140 setfsuid = 122,
141 setfsgid = 123,
142 getsid = 124,
143 capget = 125,
144 capset = 126,
145 rt_sigpending = 127,
146 rt_sigtimedwait = 128,
147 rt_sigqueueinfo = 129,
148 rt_sigsuspend = 130,
149 sigaltstack = 131,
150 utime = 132,
151 mknod = 133,
152 uselib = 134,
153 personality = 135,
154 ustat = 136,
155 statfs = 137,
156 fstatfs = 138,
157 sysfs = 139,
158 getpriority = 140,
159 setpriority = 141,
160 sched_setparam = 142,
161 sched_getparam = 143,
162 sched_setscheduler = 144,
163 sched_getscheduler = 145,
164 sched_get_priority_max = 146,
165 sched_get_priority_min = 147,
166 sched_rr_get_interval = 148,
167 mlock = 149,
168 munlock = 150,
169 mlockall = 151,
170 munlockall = 152,
171 vhangup = 153,
172 modify_ldt = 154,
173 pivot_root = 155,
174 _sysctl = 156,
175 prctl = 157,
176 arch_prctl = 158,
177 adjtimex = 159,
178 setrlimit = 160,
179 chroot = 161,
180 sync = 162,
181 acct = 163,
182 settimeofday = 164,
183 mount = 165,
184 umount2 = 166,
185 swapon = 167,
186 swapoff = 168,
187 reboot = 169,
188 sethostname = 170,
189 setdomainname = 171,
190 iopl = 172,
191 ioperm = 173,
192 create_module = 174,
193 init_module = 175,
194 delete_module = 176,
195 get_kernel_syms = 177,
196 query_module = 178,
197 quotactl = 179,
198 nfsservctl = 180,
199 getpmsg = 181,
200 putpmsg = 182,
201 afs_syscall = 183,
202 tuxcall = 184,
203 security = 185,
204 gettid = 186,
205 readahead = 187,
206 setxattr = 188,
207 lsetxattr = 189,
208 fsetxattr = 190,
209 getxattr = 191,
210 lgetxattr = 192,
211 fgetxattr = 193,
212 listxattr = 194,
213 llistxattr = 195,
214 flistxattr = 196,
215 removexattr = 197,
216 lremovexattr = 198,
217 fremovexattr = 199,
218 tkill = 200,
219 time = 201,
220 futex = 202,
221 sched_setaffinity = 203,
222 sched_getaffinity = 204,
223 set_thread_area = 205,
224 io_setup = 206,
225 io_destroy = 207,
226 io_getevents = 208,
227 io_submit = 209,
228 io_cancel = 210,
229 get_thread_area = 211,
230 lookup_dcookie = 212,
231 epoll_create = 213,
232 epoll_ctl_old = 214,
233 epoll_wait_old = 215,
234 remap_file_pages = 216,
235 getdents64 = 217,
236 set_tid_address = 218,
237 restart_syscall = 219,
238 semtimedop = 220,
239 fadvise64 = 221,
240 timer_create = 222,
241 timer_settime = 223,
242 timer_gettime = 224,
243 timer_getoverrun = 225,
244 timer_delete = 226,
245 clock_settime = 227,
246 clock_gettime = 228,
247 clock_getres = 229,
248 clock_nanosleep = 230,
249 exit_group = 231,
250 epoll_wait = 232,
251 epoll_ctl = 233,
252 tgkill = 234,
253 utimes = 235,
254 vserver = 236,
255 mbind = 237,
256 set_mempolicy = 238,
257 get_mempolicy = 239,
258 mq_open = 240,
259 mq_unlink = 241,
260 mq_timedsend = 242,
261 mq_timedreceive = 243,
262 mq_notify = 244,
263 mq_getsetattr = 245,
264 kexec_load = 246,
265 waitid = 247,
266 add_key = 248,
267 request_key = 249,
268 keyctl = 250,
269 ioprio_set = 251,
270 ioprio_get = 252,
271 inotify_init = 253,
272 inotify_add_watch = 254,
273 inotify_rm_watch = 255,
274 migrate_pages = 256,
275 openat = 257,
276 mkdirat = 258,
277 mknodat = 259,
278 fchownat = 260,
279 futimesat = 261,
280 newfstatat = 262,
281 fstatat = 262,
282 unlinkat = 263,
283 renameat = 264,
284 linkat = 265,
285 symlinkat = 266,
286 readlinkat = 267,
287 fchmodat = 268,
288 faccessat = 269,
289 pselect6 = 270,
290 ppoll = 271,
291 unshare = 272,
292 set_robust_list = 273,
293 get_robust_list = 274,
294 splice = 275,
295 tee = 276,
296 sync_file_range = 277,
297 vmsplice = 278,
298 move_pages = 279,
299 utimensat = 280,
300 epoll_pwait = 281,
301 signalfd = 282,
302 timerfd_create = 283,
303 eventfd = 284,
304 fallocate = 285,
305 timerfd_settime = 286,
306 timerfd_gettime = 287,
307 accept4 = 288,
308 signalfd4 = 289,
309 eventfd2 = 290,
310 epoll_create1 = 291,
311 dup3 = 292,
312 pipe2 = 293,
313 inotify_init1 = 294,
314 preadv = 295,
315 pwritev = 296,
316 rt_tgsigqueueinfo = 297,
317 perf_event_open = 298,
318 recvmmsg = 299,
319 fanotify_init = 300,
320 fanotify_mark = 301,
321 prlimit64 = 302,
322 name_to_handle_at = 303,
323 open_by_handle_at = 304,
324 clock_adjtime = 305,
325 syncfs = 306,
326 sendmmsg = 307,
327 setns = 308,
328 getcpu = 309,
329 process_vm_readv = 310,
330 process_vm_writev = 311,
331 kcmp = 312,
332 finit_module = 313,
333 sched_setattr = 314,
334 sched_getattr = 315,
335 renameat2 = 316,
336 seccomp = 317,
337 getrandom = 318,
338 memfd_create = 319,
339 kexec_file_load = 320,
340 bpf = 321,
341 execveat = 322,
342 userfaultfd = 323,
343 membarrier = 324,
344 mlock2 = 325,
345 copy_file_range = 326,
346 preadv2 = 327,
347 pwritev2 = 328,
348 pkey_mprotect = 329,
349 pkey_alloc = 330,
350 pkey_free = 331,
351 statx = 332,
352 io_pgetevents = 333,
353 rseq = 334,
354 pidfd_send_signal = 424,
355 io_uring_setup = 425,
356 io_uring_enter = 426,
357 io_uring_register = 427,
358 open_tree = 428,
359 move_mount = 429,
360 fsopen = 430,
361 fsconfig = 431,
362 fsmount = 432,
363 fspick = 433,
364 pidfd_open = 434,
365 clone3 = 435,
366 openat2 = 437,
367 pidfd_getfd = 438,
368
369 _,
370};
367371
368372pub const O_CREAT = 0o100;
369373pub const O_EXCL = 0o200;
lib/std/os/linux.zig+227-227
......@@ -53,46 +53,46 @@ pub fn getErrno(r: usize) u12 {
5353}
5454
5555pub fn dup2(old: i32, new: i32) usize {
56 if (@hasDecl(@This(), "SYS_dup2")) {
57 return syscall2(SYS_dup2, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)));
56 if (@hasField(SYS, "dup2")) {
57 return syscall2(.dup2, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)));
5858 } else {
5959 if (old == new) {
6060 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);
6262 if (@bitCast(isize, rc) < 0) return rc;
6363 }
6464 return @intCast(usize, old);
6565 } 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);
6767 }
6868 }
6969}
7070
7171pub 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);
7373}
7474
7575pub fn chdir(path: [*:0]const u8) usize {
76 return syscall1(SYS_chdir, @ptrToInt(path));
76 return syscall1(.chdir, @ptrToInt(path));
7777}
7878
7979pub 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)));
8181}
8282
8383pub fn chroot(path: [*:0]const u8) usize {
84 return syscall1(SYS_chroot, @ptrToInt(path));
84 return syscall1(.chroot, @ptrToInt(path));
8585}
8686
8787pub 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));
8989}
9090
9191pub fn fork() usize {
92 if (@hasDecl(@This(), "SYS_fork")) {
93 return syscall0(SYS_fork);
92 if (@hasField(SYS, "fork")) {
93 return syscall0(.fork);
9494 } else {
95 return syscall2(SYS_clone, SIGCHLD, 0);
95 return syscall2(.clone, SIGCHLD, 0);
9696 }
9797}
9898
......@@ -102,7 +102,7 @@ pub fn fork() usize {
102102/// the compiler is not aware of how vfork affects control flow and you may
103103/// see different results in optimized builds.
104104pub inline fn vfork() usize {
105 return @call(.{ .modifier = .always_inline }, syscall0, .{SYS_vfork});
105 return @call(.{ .modifier = .always_inline }, syscall0, .{.vfork});
106106}
107107
108108pub fn futimens(fd: i32, times: *const [2]timespec) usize {
......@@ -110,24 +110,24 @@ pub fn futimens(fd: i32, times: *const [2]timespec) usize {
110110}
111111
112112pub 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);
114114}
115115
116116pub 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));
118118}
119119
120120pub 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));
122122}
123123
124124pub fn getcwd(buf: [*]u8, size: usize) usize {
125 return syscall2(SYS_getcwd, @ptrToInt(buf), size);
125 return syscall2(.getcwd, @ptrToInt(buf), size);
126126}
127127
128128pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize {
129129 return syscall3(
130 SYS_getdents,
130 .getdents,
131131 @bitCast(usize, @as(isize, fd)),
132132 @ptrToInt(dirp),
133133 std.math.min(len, maxInt(c_int)),
......@@ -136,7 +136,7 @@ pub fn getdents(fd: i32, dirp: [*]u8, len: usize) usize {
136136
137137pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize {
138138 return syscall3(
139 SYS_getdents64,
139 .getdents64,
140140 @bitCast(usize, @as(isize, fd)),
141141 @ptrToInt(dirp),
142142 std.math.min(len, maxInt(c_int)),
......@@ -144,61 +144,61 @@ pub fn getdents64(fd: i32, dirp: [*]u8, len: usize) usize {
144144}
145145
146146pub fn inotify_init1(flags: u32) usize {
147 return syscall1(SYS_inotify_init1, flags);
147 return syscall1(.inotify_init1, flags);
148148}
149149
150150pub 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);
152152}
153153
154154pub 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)));
156156}
157157
158158pub fn readlink(noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize {
159 if (@hasDecl(@This(), "SYS_readlink")) {
160 return syscall3(SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
159 if (@hasField(SYS, "readlink")) {
160 return syscall3(.readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
161161 } 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);
163163 }
164164}
165165
166166pub 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);
168168}
169169
170170pub fn mkdir(path: [*:0]const u8, mode: u32) usize {
171 if (@hasDecl(@This(), "SYS_mkdir")) {
172 return syscall2(SYS_mkdir, @ptrToInt(path), mode);
171 if (@hasField(SYS, "mkdir")) {
172 return syscall2(.mkdir, @ptrToInt(path), mode);
173173 } 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);
175175 }
176176}
177177
178178pub 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);
180180}
181181
182182pub 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);
184184}
185185
186186pub fn umount(special: [*:0]const u8) usize {
187 return syscall2(SYS_umount2, @ptrToInt(special), 0);
187 return syscall2(.umount2, @ptrToInt(special), 0);
188188}
189189
190190pub fn umount2(special: [*:0]const u8, flags: u32) usize {
191 return syscall2(SYS_umount2, @ptrToInt(special), flags);
191 return syscall2(.umount2, @ptrToInt(special), flags);
192192}
193193
194194pub 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")) {
196196 // Make sure the offset is also specified in multiples of page size
197197 if ((offset & (MMAP2_UNIT - 1)) != 0)
198198 return @bitCast(usize, @as(isize, -EINVAL));
199199
200200 return syscall6(
201 SYS_mmap2,
201 .mmap2,
202202 @ptrToInt(address),
203203 length,
204204 prot,
......@@ -208,7 +208,7 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of
208208 );
209209 } else {
210210 return syscall6(
211 SYS_mmap,
211 .mmap,
212212 @ptrToInt(address),
213213 length,
214214 prot,
......@@ -220,19 +220,19 @@ pub fn mmap(address: ?[*]u8, length: usize, prot: usize, flags: u32, fd: i32, of
220220}
221221
222222pub 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);
224224}
225225
226226pub fn munmap(address: [*]const u8, length: usize) usize {
227 return syscall2(SYS_munmap, @ptrToInt(address), length);
227 return syscall2(.munmap, @ptrToInt(address), length);
228228}
229229
230230pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {
231 if (@hasDecl(@This(), "SYS_poll")) {
232 return syscall3(SYS_poll, @ptrToInt(fds), n, @bitCast(u32, timeout));
231 if (@hasField(SYS, "poll")) {
232 return syscall3(.poll, @ptrToInt(fds), n, @bitCast(u32, timeout));
233233 } else {
234234 return syscall6(
235 SYS_ppoll,
235 .ppoll,
236236 @ptrToInt(fds),
237237 n,
238238 @ptrToInt(if (timeout >= 0)
......@@ -250,12 +250,12 @@ pub fn poll(fds: [*]pollfd, n: nfds_t, timeout: i32) usize {
250250}
251251
252252pub 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);
254254}
255255
256256pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize {
257257 return syscall5(
258 SYS_preadv,
258 .preadv,
259259 @bitCast(usize, @as(isize, fd)),
260260 @ptrToInt(iov),
261261 count,
......@@ -266,7 +266,7 @@ pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: u64) usize {
266266
267267pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: kernel_rwf) usize {
268268 return syscall6(
269 SYS_preadv2,
269 .preadv2,
270270 @bitCast(usize, @as(isize, fd)),
271271 @ptrToInt(iov),
272272 count,
......@@ -277,16 +277,16 @@ pub fn preadv2(fd: i32, iov: [*]const iovec, count: usize, offset: u64, flags: k
277277}
278278
279279pub 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);
281281}
282282
283283pub 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);
285285}
286286
287287pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) usize {
288288 return syscall5(
289 SYS_pwritev,
289 .pwritev,
290290 @bitCast(usize, @as(isize, fd)),
291291 @ptrToInt(iov),
292292 count,
......@@ -297,7 +297,7 @@ pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64) us
297297
298298pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, flags: kernel_rwf) usize {
299299 return syscall6(
300 SYS_pwritev2,
300 .pwritev2,
301301 @bitCast(usize, @as(isize, fd)),
302302 @ptrToInt(iov),
303303 count,
......@@ -308,30 +308,30 @@ pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, f
308308}
309309
310310pub fn rmdir(path: [*:0]const u8) usize {
311 if (@hasDecl(@This(), "SYS_rmdir")) {
312 return syscall1(SYS_rmdir, @ptrToInt(path));
311 if (@hasField(SYS, "rmdir")) {
312 return syscall1(.rmdir, @ptrToInt(path));
313313 } 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);
315315 }
316316}
317317
318318pub fn symlink(existing: [*:0]const u8, new: [*:0]const u8) usize {
319 if (@hasDecl(@This(), "SYS_symlink")) {
320 return syscall2(SYS_symlink, @ptrToInt(existing), @ptrToInt(new));
319 if (@hasField(SYS, "symlink")) {
320 return syscall2(.symlink, @ptrToInt(existing), @ptrToInt(new));
321321 } 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));
323323 }
324324}
325325
326326pub 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));
328328}
329329
330330pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
331 if (@hasDecl(@This(), "SYS_pread64")) {
331 if (@hasField(SYS, "pread64")) {
332332 if (require_aligned_register_pair) {
333333 return syscall6(
334 SYS_pread64,
334 .pread64,
335335 @bitCast(usize, @as(isize, fd)),
336336 @ptrToInt(buf),
337337 count,
......@@ -341,7 +341,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
341341 );
342342 } else {
343343 return syscall5(
344 SYS_pread64,
344 .pread64,
345345 @bitCast(usize, @as(isize, fd)),
346346 @ptrToInt(buf),
347347 count,
......@@ -351,7 +351,7 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
351351 }
352352 } else {
353353 return syscall4(
354 SYS_pread,
354 .pread,
355355 @bitCast(usize, @as(isize, fd)),
356356 @ptrToInt(buf),
357357 count,
......@@ -361,40 +361,40 @@ pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: u64) usize {
361361}
362362
363363pub fn access(path: [*:0]const u8, mode: u32) usize {
364 if (@hasDecl(@This(), "SYS_access")) {
365 return syscall2(SYS_access, @ptrToInt(path), mode);
364 if (@hasField(SYS, "access")) {
365 return syscall2(.access, @ptrToInt(path), mode);
366366 } 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);
368368 }
369369}
370370
371371pub 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);
373373}
374374
375375pub fn pipe(fd: *[2]i32) usize {
376376 if (comptime builtin.arch.isMIPS()) {
377377 return syscall_pipe(fd);
378 } else if (@hasDecl(@This(), "SYS_pipe")) {
379 return syscall1(SYS_pipe, @ptrToInt(fd));
378 } else if (@hasField(SYS, "pipe")) {
379 return syscall1(.pipe, @ptrToInt(fd));
380380 } else {
381 return syscall2(SYS_pipe2, @ptrToInt(fd), 0);
381 return syscall2(.pipe2, @ptrToInt(fd), 0);
382382 }
383383}
384384
385385pub fn pipe2(fd: *[2]i32, flags: u32) usize {
386 return syscall2(SYS_pipe2, @ptrToInt(fd), flags);
386 return syscall2(.pipe2, @ptrToInt(fd), flags);
387387}
388388
389389pub 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);
391391}
392392
393393pub fn ftruncate(fd: i32, length: u64) usize {
394 if (@hasDecl(@This(), "SYS_ftruncate64")) {
394 if (@hasField(SYS, "ftruncate64")) {
395395 if (require_aligned_register_pair) {
396396 return syscall4(
397 SYS_ftruncate64,
397 .ftruncate64,
398398 @bitCast(usize, @as(isize, fd)),
399399 0,
400400 @truncate(usize, length),
......@@ -402,7 +402,7 @@ pub fn ftruncate(fd: i32, length: u64) usize {
402402 );
403403 } else {
404404 return syscall3(
405 SYS_ftruncate64,
405 .ftruncate64,
406406 @bitCast(usize, @as(isize, fd)),
407407 @truncate(usize, length),
408408 @truncate(usize, length >> 32),
......@@ -410,7 +410,7 @@ pub fn ftruncate(fd: i32, length: u64) usize {
410410 }
411411 } else {
412412 return syscall2(
413 SYS_ftruncate,
413 .ftruncate,
414414 @bitCast(usize, @as(isize, fd)),
415415 @truncate(usize, length),
416416 );
......@@ -418,10 +418,10 @@ pub fn ftruncate(fd: i32, length: u64) usize {
418418}
419419
420420pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
421 if (@hasDecl(@This(), "SYS_pwrite64")) {
421 if (@hasField(SYS, "pwrite64")) {
422422 if (require_aligned_register_pair) {
423423 return syscall6(
424 SYS_pwrite64,
424 .pwrite64,
425425 @bitCast(usize, @as(isize, fd)),
426426 @ptrToInt(buf),
427427 count,
......@@ -431,7 +431,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
431431 );
432432 } else {
433433 return syscall5(
434 SYS_pwrite64,
434 .pwrite64,
435435 @bitCast(usize, @as(isize, fd)),
436436 @ptrToInt(buf),
437437 count,
......@@ -441,7 +441,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
441441 }
442442 } else {
443443 return syscall4(
444 SYS_pwrite,
444 .pwrite,
445445 @bitCast(usize, @as(isize, fd)),
446446 @ptrToInt(buf),
447447 count,
......@@ -451,19 +451,19 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
451451}
452452
453453pub fn rename(old: [*:0]const u8, new: [*:0]const u8) usize {
454 if (@hasDecl(@This(), "SYS_rename")) {
455 return syscall2(SYS_rename, @ptrToInt(old), @ptrToInt(new));
456 } else if (@hasDecl(@This(), "SYS_renameat")) {
457 return syscall4(SYS_renameat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new));
454 if (@hasField(SYS, "rename")) {
455 return syscall2(.rename, @ptrToInt(old), @ptrToInt(new));
456 } else if (@hasField(SYS, "renameat")) {
457 return syscall4(.renameat, @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(old), @bitCast(usize, @as(isize, AT_FDCWD)), @ptrToInt(new));
458458 } 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);
460460 }
461461}
462462
463463pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const u8) usize {
464 if (@hasDecl(@This(), "SYS_renameat")) {
464 if (@hasField(SYS, "renameat")) {
465465 return syscall4(
466 SYS_renameat,
466 .renameat,
467467 @bitCast(usize, @as(isize, oldfd)),
468468 @ptrToInt(oldpath),
469469 @bitCast(usize, @as(isize, newfd)),
......@@ -471,7 +471,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const
471471 );
472472 } else {
473473 return syscall5(
474 SYS_renameat2,
474 .renameat2,
475475 @bitCast(usize, @as(isize, oldfd)),
476476 @ptrToInt(oldpath),
477477 @bitCast(usize, @as(isize, newfd)),
......@@ -483,7 +483,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const
483483
484484pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]const u8, flags: u32) usize {
485485 return syscall5(
486 SYS_renameat2,
486 .renameat2,
487487 @bitCast(usize, @as(isize, oldfd)),
488488 @ptrToInt(oldpath),
489489 @bitCast(usize, @as(isize, newfd)),
......@@ -493,11 +493,11 @@ pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]c
493493}
494494
495495pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize {
496 if (@hasDecl(@This(), "SYS_open")) {
497 return syscall3(SYS_open, @ptrToInt(path), flags, perm);
496 if (@hasField(SYS, "open")) {
497 return syscall3(.open, @ptrToInt(path), flags, perm);
498498 } else {
499499 return syscall4(
500 SYS_openat,
500 .openat,
501501 @bitCast(usize, @as(isize, AT_FDCWD)),
502502 @ptrToInt(path),
503503 flags,
......@@ -507,32 +507,32 @@ pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize {
507507}
508508
509509pub fn create(path: [*:0]const u8, perm: usize) usize {
510 return syscall2(SYS_creat, @ptrToInt(path), perm);
510 return syscall2(.creat, @ptrToInt(path), perm);
511511}
512512
513513pub fn openat(dirfd: i32, path: [*:0]const u8, flags: u32, mode: usize) usize {
514514 // 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);
516516}
517517
518518/// See also `clone` (from the arch-specific include)
519519pub 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);
521521}
522522
523523/// See also `clone` (from the arch-specific include)
524524pub 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);
526526}
527527
528528pub fn close(fd: i32) usize {
529 return syscall1(SYS_close, @bitCast(usize, @as(isize, fd)));
529 return syscall1(.close, @bitCast(usize, @as(isize, fd)));
530530}
531531
532532/// Can only be called on 32 bit systems. For 64 bit see `lseek`.
533533pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize {
534534 return syscall5(
535 SYS__llseek,
535 ._llseek,
536536 @bitCast(usize, @as(isize, fd)),
537537 @truncate(usize, offset >> 32),
538538 @truncate(usize, offset),
......@@ -543,53 +543,53 @@ pub fn llseek(fd: i32, offset: u64, result: ?*u64, whence: usize) usize {
543543
544544/// Can only be called on 64 bit systems. For 32 bit see `llseek`.
545545pub 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);
547547}
548548
549549pub fn exit(status: i32) noreturn {
550 _ = syscall1(SYS_exit, @bitCast(usize, @as(isize, status)));
550 _ = syscall1(.exit, @bitCast(usize, @as(isize, status)));
551551 unreachable;
552552}
553553
554554pub 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)));
556556 unreachable;
557557}
558558
559559pub 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);
561561}
562562
563563pub 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)));
565565}
566566
567567pub 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)));
569569}
570570
571571pub 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)));
573573}
574574
575575pub fn unlink(path: [*:0]const u8) usize {
576 if (@hasDecl(@This(), "SYS_unlink")) {
577 return syscall1(SYS_unlink, @ptrToInt(path));
576 if (@hasField(SYS, "unlink")) {
577 return syscall1(.unlink, @ptrToInt(path));
578578 } 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);
580580 }
581581}
582582
583583pub 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);
585585}
586586
587587pub 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);
589589}
590590
591591pub 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);
593593}
594594
595595var 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 {
609609 }
610610 }
611611 }
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));
613613}
614614
615615fn 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 {
626626}
627627
628628pub 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));
630630}
631631
632632pub 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));
634634}
635635
636636pub fn gettimeofday(tv: *timeval, tz: *timezone) usize {
637 return syscall2(SYS_gettimeofday, @ptrToInt(tv), @ptrToInt(tz));
637 return syscall2(.gettimeofday, @ptrToInt(tv), @ptrToInt(tz));
638638}
639639
640640pub 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));
642642}
643643
644644pub 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));
646646}
647647
648648pub fn setuid(uid: u32) usize {
649 if (@hasDecl(@This(), "SYS_setuid32")) {
650 return syscall1(SYS_setuid32, uid);
649 if (@hasField(SYS, "setuid32")) {
650 return syscall1(.setuid32, uid);
651651 } else {
652 return syscall1(SYS_setuid, uid);
652 return syscall1(.setuid, uid);
653653 }
654654}
655655
656656pub fn setgid(gid: u32) usize {
657 if (@hasDecl(@This(), "SYS_setgid32")) {
658 return syscall1(SYS_setgid32, gid);
657 if (@hasField(SYS, "setgid32")) {
658 return syscall1(.setgid32, gid);
659659 } else {
660 return syscall1(SYS_setgid, gid);
660 return syscall1(.setgid, gid);
661661 }
662662}
663663
664664pub fn setreuid(ruid: u32, euid: u32) usize {
665 if (@hasDecl(@This(), "SYS_setreuid32")) {
666 return syscall2(SYS_setreuid32, ruid, euid);
665 if (@hasField(SYS, "setreuid32")) {
666 return syscall2(.setreuid32, ruid, euid);
667667 } else {
668 return syscall2(SYS_setreuid, ruid, euid);
668 return syscall2(.setreuid, ruid, euid);
669669 }
670670}
671671
672672pub fn setregid(rgid: u32, egid: u32) usize {
673 if (@hasDecl(@This(), "SYS_setregid32")) {
674 return syscall2(SYS_setregid32, rgid, egid);
673 if (@hasField(SYS, "setregid32")) {
674 return syscall2(.setregid32, rgid, egid);
675675 } else {
676 return syscall2(SYS_setregid, rgid, egid);
676 return syscall2(.setregid, rgid, egid);
677677 }
678678}
679679
680680pub fn getuid() u32 {
681 if (@hasDecl(@This(), "SYS_getuid32")) {
682 return @as(u32, syscall0(SYS_getuid32));
681 if (@hasField(SYS, "getuid32")) {
682 return @as(u32, syscall0(.getuid32));
683683 } else {
684 return @as(u32, syscall0(SYS_getuid));
684 return @as(u32, syscall0(.getuid));
685685 }
686686}
687687
688688pub fn getgid() u32 {
689 if (@hasDecl(@This(), "SYS_getgid32")) {
690 return @as(u32, syscall0(SYS_getgid32));
689 if (@hasField(SYS, "getgid32")) {
690 return @as(u32, syscall0(.getgid32));
691691 } else {
692 return @as(u32, syscall0(SYS_getgid));
692 return @as(u32, syscall0(.getgid));
693693 }
694694}
695695
696696pub fn geteuid() u32 {
697 if (@hasDecl(@This(), "SYS_geteuid32")) {
698 return @as(u32, syscall0(SYS_geteuid32));
697 if (@hasField(SYS, "geteuid32")) {
698 return @as(u32, syscall0(.geteuid32));
699699 } else {
700 return @as(u32, syscall0(SYS_geteuid));
700 return @as(u32, syscall0(.geteuid));
701701 }
702702}
703703
704704pub fn getegid() u32 {
705 if (@hasDecl(@This(), "SYS_getegid32")) {
706 return @as(u32, syscall0(SYS_getegid32));
705 if (@hasField(SYS, "getegid32")) {
706 return @as(u32, syscall0(.getegid32));
707707 } else {
708 return @as(u32, syscall0(SYS_getegid));
708 return @as(u32, syscall0(.getegid));
709709 }
710710}
711711
......@@ -718,63 +718,63 @@ pub fn setegid(egid: u32) usize {
718718}
719719
720720pub fn getresuid(ruid: *u32, euid: *u32, suid: *u32) usize {
721 if (@hasDecl(@This(), "SYS_getresuid32")) {
722 return syscall3(SYS_getresuid32, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));
721 if (@hasField(SYS, "getresuid32")) {
722 return syscall3(.getresuid32, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));
723723 } else {
724 return syscall3(SYS_getresuid, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));
724 return syscall3(.getresuid, @ptrToInt(ruid), @ptrToInt(euid), @ptrToInt(suid));
725725 }
726726}
727727
728728pub fn getresgid(rgid: *u32, egid: *u32, sgid: *u32) usize {
729 if (@hasDecl(@This(), "SYS_getresgid32")) {
730 return syscall3(SYS_getresgid32, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));
729 if (@hasField(SYS, "getresgid32")) {
730 return syscall3(.getresgid32, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));
731731 } else {
732 return syscall3(SYS_getresgid, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));
732 return syscall3(.getresgid, @ptrToInt(rgid), @ptrToInt(egid), @ptrToInt(sgid));
733733 }
734734}
735735
736736pub fn setresuid(ruid: u32, euid: u32, suid: u32) usize {
737 if (@hasDecl(@This(), "SYS_setresuid32")) {
738 return syscall3(SYS_setresuid32, ruid, euid, suid);
737 if (@hasField(SYS, "setresuid32")) {
738 return syscall3(.setresuid32, ruid, euid, suid);
739739 } else {
740 return syscall3(SYS_setresuid, ruid, euid, suid);
740 return syscall3(.setresuid, ruid, euid, suid);
741741 }
742742}
743743
744744pub fn setresgid(rgid: u32, egid: u32, sgid: u32) usize {
745 if (@hasDecl(@This(), "SYS_setresgid32")) {
746 return syscall3(SYS_setresgid32, rgid, egid, sgid);
745 if (@hasField(SYS, "setresgid32")) {
746 return syscall3(.setresgid32, rgid, egid, sgid);
747747 } else {
748 return syscall3(SYS_setresgid, rgid, egid, sgid);
748 return syscall3(.setresgid, rgid, egid, sgid);
749749 }
750750}
751751
752752pub fn getgroups(size: usize, list: *u32) usize {
753 if (@hasDecl(@This(), "SYS_getgroups32")) {
754 return syscall2(SYS_getgroups32, size, @ptrToInt(list));
753 if (@hasField(SYS, "getgroups32")) {
754 return syscall2(.getgroups32, size, @ptrToInt(list));
755755 } else {
756 return syscall2(SYS_getgroups, size, @ptrToInt(list));
756 return syscall2(.getgroups, size, @ptrToInt(list));
757757 }
758758}
759759
760760pub fn setgroups(size: usize, list: *const u32) usize {
761 if (@hasDecl(@This(), "SYS_setgroups32")) {
762 return syscall2(SYS_setgroups32, size, @ptrToInt(list));
761 if (@hasField(SYS, "setgroups32")) {
762 return syscall2(.setgroups32, size, @ptrToInt(list));
763763 } else {
764 return syscall2(SYS_setgroups, size, @ptrToInt(list));
764 return syscall2(.setgroups, size, @ptrToInt(list));
765765 }
766766}
767767
768768pub fn getpid() pid_t {
769 return @bitCast(pid_t, @truncate(u32, syscall0(SYS_getpid)));
769 return @bitCast(pid_t, @truncate(u32, syscall0(.getpid)));
770770}
771771
772772pub fn gettid() pid_t {
773 return @bitCast(pid_t, @truncate(u32, syscall0(SYS_gettid)));
773 return @bitCast(pid_t, @truncate(u32, syscall0(.gettid)));
774774}
775775
776776pub 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);
778778}
779779
780780pub 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
792792 var ksa_old: k_sigaction = undefined;
793793 const ksa_mask_size = @sizeOf(@TypeOf(ksa_old.mask));
794794 @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);
796796 const err = getErrno(result);
797797 if (err != 0) {
798798 return result;
......@@ -819,42 +819,42 @@ pub fn getsockname(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) us
819819 if (builtin.arch == .i386) {
820820 return socketcall(SC_getsockname, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });
821821 }
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));
823823}
824824
825825pub fn getpeername(fd: i32, noalias addr: *sockaddr, noalias len: *socklen_t) usize {
826826 if (builtin.arch == .i386) {
827827 return socketcall(SC_getpeername, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len) });
828828 }
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));
830830}
831831
832832pub fn socket(domain: u32, socket_type: u32, protocol: u32) usize {
833833 if (builtin.arch == .i386) {
834834 return socketcall(SC_socket, &[3]usize{ domain, socket_type, protocol });
835835 }
836 return syscall3(SYS_socket, domain, socket_type, protocol);
836 return syscall3(.socket, domain, socket_type, protocol);
837837}
838838
839839pub fn setsockopt(fd: i32, level: u32, optname: u32, optval: [*]const u8, optlen: socklen_t) usize {
840840 if (builtin.arch == .i386) {
841841 return socketcall(SC_setsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @intCast(usize, optlen) });
842842 }
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));
844844}
845845
846846pub fn getsockopt(fd: i32, level: u32, optname: u32, noalias optval: [*]u8, noalias optlen: *socklen_t) usize {
847847 if (builtin.arch == .i386) {
848848 return socketcall(SC_getsockopt, &[5]usize{ @bitCast(usize, @as(isize, fd)), level, optname, @ptrToInt(optval), @ptrToInt(optlen) });
849849 }
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));
851851}
852852
853853pub fn sendmsg(fd: i32, msg: *msghdr_const, flags: u32) usize {
854854 if (builtin.arch == .i386) {
855855 return socketcall(SC_sendmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags });
856856 }
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);
858858}
859859
860860pub 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
872872 // batch-send all messages up to the current message
873873 if (next_unsent < i) {
874874 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);
876876 if (getErrno(r) != 0) return next_unsent;
877877 if (r < batch_size) return next_unsent + r;
878878 }
......@@ -888,68 +888,68 @@ pub fn sendmmsg(fd: i32, msgvec: [*]mmsghdr_const, vlen: u32, flags: u32) usize
888888 }
889889 if (next_unsent < kvlen or next_unsent == 0) { // want to make sure at least one syscall occurs (e.g. to trigger MSG_EOR)
890890 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);
892892 if (getErrno(r) != 0) return r;
893893 return next_unsent + r;
894894 }
895895 return kvlen;
896896 }
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);
898898}
899899
900900pub fn connect(fd: i32, addr: *const c_void, len: socklen_t) usize {
901901 if (builtin.arch == .i386) {
902902 return socketcall(SC_connect, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), len });
903903 }
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);
905905}
906906
907907pub fn recvmsg(fd: i32, msg: *msghdr, flags: u32) usize {
908908 if (builtin.arch == .i386) {
909909 return socketcall(SC_recvmsg, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(msg), flags });
910910 }
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);
912912}
913913
914914pub fn recvfrom(fd: i32, noalias buf: [*]u8, len: usize, flags: u32, noalias addr: ?*sockaddr, noalias alen: ?*socklen_t) usize {
915915 if (builtin.arch == .i386) {
916916 return socketcall(SC_recvfrom, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @ptrToInt(alen) });
917917 }
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));
919919}
920920
921921pub fn shutdown(fd: i32, how: i32) usize {
922922 if (builtin.arch == .i386) {
923923 return socketcall(SC_shutdown, &[2]usize{ @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, how)) });
924924 }
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)));
926926}
927927
928928pub fn bind(fd: i32, addr: *const sockaddr, len: socklen_t) usize {
929929 if (builtin.arch == .i386) {
930930 return socketcall(SC_bind, &[3]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @intCast(usize, len) });
931931 }
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));
933933}
934934
935935pub fn listen(fd: i32, backlog: u32) usize {
936936 if (builtin.arch == .i386) {
937937 return socketcall(SC_listen, &[2]usize{ @bitCast(usize, @as(isize, fd)), backlog });
938938 }
939 return syscall2(SYS_listen, @bitCast(usize, @as(isize, fd)), backlog);
939 return syscall2(.listen, @bitCast(usize, @as(isize, fd)), backlog);
940940}
941941
942942pub fn sendto(fd: i32, buf: [*]const u8, len: usize, flags: u32, addr: ?*const sockaddr, alen: socklen_t) usize {
943943 if (builtin.arch == .i386) {
944944 return socketcall(SC_sendto, &[6]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), len, flags, @ptrToInt(addr), @intCast(usize, alen) });
945945 }
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));
947947}
948948
949949pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {
950 if (@hasDecl(@This(), "SYS_sendfile64")) {
950 if (@hasField(SYS, "sendfile64")) {
951951 return syscall4(
952 SYS_sendfile64,
952 .sendfile64,
953953 @bitCast(usize, @as(isize, outfd)),
954954 @bitCast(usize, @as(isize, infd)),
955955 @ptrToInt(offset),
......@@ -957,7 +957,7 @@ pub fn sendfile(outfd: i32, infd: i32, offset: ?*i64, count: usize) usize {
957957 );
958958 } else {
959959 return syscall4(
960 SYS_sendfile,
960 .sendfile,
961961 @bitCast(usize, @as(isize, outfd)),
962962 @bitCast(usize, @as(isize, infd)),
963963 @ptrToInt(offset),
......@@ -970,7 +970,7 @@ pub fn socketpair(domain: i32, socket_type: i32, protocol: i32, fd: [2]i32) usiz
970970 if (builtin.arch == .i386) {
971971 return socketcall(SC_socketpair, &[4]usize{ @intCast(usize, domain), @intCast(usize, socket_type), @intCast(usize, protocol), @ptrToInt(&fd[0]) });
972972 }
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]));
974974}
975975
976976pub 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:
984984 if (builtin.arch == .i386) {
985985 return socketcall(SC_accept4, &[4]usize{ @bitCast(usize, @as(isize, fd)), @ptrToInt(addr), @ptrToInt(len), flags });
986986 }
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);
988988}
989989
990990pub fn fstat(fd: i32, stat_buf: *Stat) usize {
991 if (@hasDecl(@This(), "SYS_fstat64")) {
992 return syscall2(SYS_fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));
991 if (@hasField(SYS, "fstat64")) {
992 return syscall2(.fstat64, @bitCast(usize, @as(isize, fd)), @ptrToInt(stat_buf));
993993 } 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));
995995 }
996996}
997997
998998pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize {
999 if (@hasDecl(@This(), "SYS_stat64")) {
1000 return syscall2(SYS_stat64, @ptrToInt(pathname), @ptrToInt(statbuf));
999 if (@hasField(SYS, "stat64")) {
1000 return syscall2(.stat64, @ptrToInt(pathname), @ptrToInt(statbuf));
10011001 } else {
1002 return syscall2(SYS_stat, @ptrToInt(pathname), @ptrToInt(statbuf));
1002 return syscall2(.stat, @ptrToInt(pathname), @ptrToInt(statbuf));
10031003 }
10041004}
10051005
10061006pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize {
1007 if (@hasDecl(@This(), "SYS_lstat64")) {
1008 return syscall2(SYS_lstat64, @ptrToInt(pathname), @ptrToInt(statbuf));
1007 if (@hasField(SYS, "lstat64")) {
1008 return syscall2(.lstat64, @ptrToInt(pathname), @ptrToInt(statbuf));
10091009 } else {
1010 return syscall2(SYS_lstat, @ptrToInt(pathname), @ptrToInt(statbuf));
1010 return syscall2(.lstat, @ptrToInt(pathname), @ptrToInt(statbuf));
10111011 }
10121012}
10131013
10141014pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usize {
1015 if (@hasDecl(@This(), "SYS_fstatat64")) {
1016 return syscall4(SYS_fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
1015 if (@hasField(SYS, "fstatat64")) {
1016 return syscall4(.fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags);
10171017 } 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);
10191019 }
10201020}
10211021
10221022pub 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")) {
10241024 return syscall5(
1025 SYS_statx,
1025 .statx,
10261026 @bitCast(usize, @as(isize, dirfd)),
10271027 @ptrToInt(path),
10281028 flags,
......@@ -1034,59 +1034,59 @@ pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *S
10341034}
10351035
10361036pub 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);
10381038}
10391039
10401040pub 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);
10421042}
10431043
10441044pub 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);
10461046}
10471047
10481048pub 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);
10501050}
10511051
10521052pub 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);
10541054}
10551055
10561056pub 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);
10581058}
10591059
10601060pub 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);
10621062}
10631063
10641064pub 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);
10661066}
10671067
10681068pub 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);
10701070}
10711071
10721072pub 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));
10741074}
10751075
10761076pub 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));
10781078}
10791079
10801080pub fn fremovexattr(fd: usize, name: [*:0]const u8) usize {
1081 return syscall2(SYS_fremovexattr, fd, @ptrToInt(name));
1081 return syscall2(.fremovexattr, fd, @ptrToInt(name));
10821082}
10831083
10841084pub fn sched_yield() usize {
1085 return syscall0(SYS_sched_yield);
1085 return syscall0(.sched_yield);
10861086}
10871087
10881088pub 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));
10901090 if (@bitCast(isize, rc) < 0) return rc;
10911091 if (rc < size) @memset(@ptrCast([*]u8, set) + rc, 0, size - rc);
10921092 return 0;
......@@ -1097,11 +1097,11 @@ pub fn epoll_create() usize {
10971097}
10981098
10991099pub fn epoll_create1(flags: usize) usize {
1100 return syscall1(SYS_epoll_create1, flags);
1100 return syscall1(.epoll_create1, flags);
11011101}
11021102
11031103pub 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));
11051105}
11061106
11071107pub 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
11101110
11111111pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeout: i32, sigmask: ?*sigset_t) usize {
11121112 return syscall6(
1113 SYS_epoll_pwait,
1113 .epoll_pwait,
11141114 @bitCast(usize, @as(isize, epoll_fd)),
11151115 @ptrToInt(events),
11161116 @intCast(usize, maxevents),
......@@ -1121,11 +1121,11 @@ pub fn epoll_pwait(epoll_fd: i32, events: [*]epoll_event, maxevents: u32, timeou
11211121}
11221122
11231123pub fn eventfd(count: u32, flags: u32) usize {
1124 return syscall2(SYS_eventfd2, count, flags);
1124 return syscall2(.eventfd2, count, flags);
11251125}
11261126
11271127pub 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);
11291129}
11301130
11311131pub const itimerspec = extern struct {
......@@ -1134,59 +1134,59 @@ pub const itimerspec = extern struct {
11341134};
11351135
11361136pub 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));
11381138}
11391139
11401140pub 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));
11421142}
11431143
11441144pub fn unshare(flags: usize) usize {
1145 return syscall1(SYS_unshare, flags);
1145 return syscall1(.unshare, flags);
11461146}
11471147
11481148pub 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));
11501150}
11511151
11521152pub 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));
11541154}
11551155
11561156pub 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));
11581158}
11591159
11601160pub fn uname(uts: *utsname) usize {
1161 return syscall1(SYS_uname, @ptrToInt(uts));
1161 return syscall1(.uname, @ptrToInt(uts));
11621162}
11631163
11641164pub 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));
11661166}
11671167
11681168pub 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);
11701170}
11711171
11721172pub 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);
11741174}
11751175
11761176pub 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);
11781178}
11791179
11801180pub 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));
11821182}
11831183
11841184pub 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));
11861186}
11871187
11881188pub 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));
11901190}
11911191
11921192test "" {
lib/std/os/linux/arm-eabi.zig+16-16
......@@ -1,36 +1,36 @@
11usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {
3pub fn syscall0(number: SYS) usize {
44 return asm volatile ("svc #0"
55 : [ret] "={r0}" (-> usize)
6 : [number] "{r7}" (number)
6 : [number] "{r7}" (@enumToInt(number))
77 : "memory"
88 );
99}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {
11pub fn syscall1(number: SYS, arg1: usize) usize {
1212 return asm volatile ("svc #0"
1313 : [ret] "={r0}" (-> usize)
14 : [number] "{r7}" (number),
14 : [number] "{r7}" (@enumToInt(number)),
1515 [arg1] "{r0}" (arg1)
1616 : "memory"
1717 );
1818}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {
20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
2121 return asm volatile ("svc #0"
2222 : [ret] "={r0}" (-> usize)
23 : [number] "{r7}" (number),
23 : [number] "{r7}" (@enumToInt(number)),
2424 [arg1] "{r0}" (arg1),
2525 [arg2] "{r1}" (arg2)
2626 : "memory"
2727 );
2828}
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 {
3131 return asm volatile ("svc #0"
3232 : [ret] "={r0}" (-> usize)
33 : [number] "{r7}" (number),
33 : [number] "{r7}" (@enumToInt(number)),
3434 [arg1] "{r0}" (arg1),
3535 [arg2] "{r1}" (arg2),
3636 [arg3] "{r2}" (arg3)
......@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
3838 );
3939}
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 {
4242 return asm volatile ("svc #0"
4343 : [ret] "={r0}" (-> usize)
44 : [number] "{r7}" (number),
44 : [number] "{r7}" (@enumToInt(number)),
4545 [arg1] "{r0}" (arg1),
4646 [arg2] "{r1}" (arg2),
4747 [arg3] "{r2}" (arg3),
......@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
5050 );
5151}
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 {
5454 return asm volatile ("svc #0"
5555 : [ret] "={r0}" (-> usize)
56 : [number] "{r7}" (number),
56 : [number] "{r7}" (@enumToInt(number)),
5757 [arg1] "{r0}" (arg1),
5858 [arg2] "{r1}" (arg2),
5959 [arg3] "{r2}" (arg3),
......@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
6464}
6565
6666pub fn syscall6(
67 number: usize,
67 number: SYS,
6868 arg1: usize,
6969 arg2: usize,
7070 arg3: usize,
......@@ -74,7 +74,7 @@ pub fn syscall6(
7474) usize {
7575 return asm volatile ("svc #0"
7676 : [ret] "={r0}" (-> usize)
77 : [number] "{r7}" (number),
77 : [number] "{r7}" (@enumToInt(number)),
7878 [arg1] "{r0}" (arg1),
7979 [arg2] "{r1}" (arg2),
8080 [arg3] "{r2}" (arg3),
......@@ -91,7 +91,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a
9191pub fn restore() callconv(.Naked) void {
9292 return asm volatile ("svc #0"
9393 :
94 : [number] "{r7}" (@as(usize, SYS_sigreturn))
94 : [number] "{r7}" (@enumToInt(SYS.sigreturn))
9595 : "memory"
9696 );
9797}
......@@ -99,7 +99,7 @@ pub fn restore() callconv(.Naked) void {
9999pub fn restore_rt() callconv(.Naked) void {
100100 return asm volatile ("svc #0"
101101 :
102 : [number] "{r7}" (@as(usize, SYS_rt_sigreturn))
102 : [number] "{r7}" (@enumToInt(SYS.rt_sigreturn))
103103 : "memory"
104104 );
105105}
lib/std/os/linux/arm64.zig+15-15
......@@ -1,36 +1,36 @@
11usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {
3pub fn syscall0(number: SYS) usize {
44 return asm volatile ("svc #0"
55 : [ret] "={x0}" (-> usize)
6 : [number] "{x8}" (number)
6 : [number] "{x8}" (@enumToInt(number))
77 : "memory", "cc"
88 );
99}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {
11pub fn syscall1(number: SYS, arg1: usize) usize {
1212 return asm volatile ("svc #0"
1313 : [ret] "={x0}" (-> usize)
14 : [number] "{x8}" (number),
14 : [number] "{x8}" (@enumToInt(number)),
1515 [arg1] "{x0}" (arg1)
1616 : "memory", "cc"
1717 );
1818}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {
20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
2121 return asm volatile ("svc #0"
2222 : [ret] "={x0}" (-> usize)
23 : [number] "{x8}" (number),
23 : [number] "{x8}" (@enumToInt(number)),
2424 [arg1] "{x0}" (arg1),
2525 [arg2] "{x1}" (arg2)
2626 : "memory", "cc"
2727 );
2828}
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 {
3131 return asm volatile ("svc #0"
3232 : [ret] "={x0}" (-> usize)
33 : [number] "{x8}" (number),
33 : [number] "{x8}" (@enumToInt(number)),
3434 [arg1] "{x0}" (arg1),
3535 [arg2] "{x1}" (arg2),
3636 [arg3] "{x2}" (arg3)
......@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
3838 );
3939}
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 {
4242 return asm volatile ("svc #0"
4343 : [ret] "={x0}" (-> usize)
44 : [number] "{x8}" (number),
44 : [number] "{x8}" (@enumToInt(number)),
4545 [arg1] "{x0}" (arg1),
4646 [arg2] "{x1}" (arg2),
4747 [arg3] "{x2}" (arg3),
......@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
5050 );
5151}
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 {
5454 return asm volatile ("svc #0"
5555 : [ret] "={x0}" (-> usize)
56 : [number] "{x8}" (number),
56 : [number] "{x8}" (@enumToInt(number)),
5757 [arg1] "{x0}" (arg1),
5858 [arg2] "{x1}" (arg2),
5959 [arg3] "{x2}" (arg3),
......@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
6464}
6565
6666pub fn syscall6(
67 number: usize,
67 number: SYS,
6868 arg1: usize,
6969 arg2: usize,
7070 arg3: usize,
......@@ -74,7 +74,7 @@ pub fn syscall6(
7474) usize {
7575 return asm volatile ("svc #0"
7676 : [ret] "={x0}" (-> usize)
77 : [number] "{x8}" (number),
77 : [number] "{x8}" (@enumToInt(number)),
7878 [arg1] "{x0}" (arg1),
7979 [arg2] "{x1}" (arg2),
8080 [arg3] "{x2}" (arg3),
......@@ -93,7 +93,7 @@ pub const restore = restore_rt;
9393pub fn restore_rt() callconv(.Naked) void {
9494 return asm volatile ("svc #0"
9595 :
96 : [number] "{x8}" (@as(usize, SYS_rt_sigreturn))
96 : [number] "{x8}" (@enumToInt(SYS.rt_sigreturn))
9797 : "memory", "cc"
9898 );
9999}
lib/std/os/linux/i386.zig+17-17
......@@ -1,36 +1,36 @@
11usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {
3pub fn syscall0(number: SYS) usize {
44 return asm volatile ("int $0x80"
55 : [ret] "={eax}" (-> usize)
6 : [number] "{eax}" (number)
6 : [number] "{eax}" (@enumToInt(number))
77 : "memory"
88 );
99}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {
11pub fn syscall1(number: SYS, arg1: usize) usize {
1212 return asm volatile ("int $0x80"
1313 : [ret] "={eax}" (-> usize)
14 : [number] "{eax}" (number),
14 : [number] "{eax}" (@enumToInt(number)),
1515 [arg1] "{ebx}" (arg1)
1616 : "memory"
1717 );
1818}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {
20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
2121 return asm volatile ("int $0x80"
2222 : [ret] "={eax}" (-> usize)
23 : [number] "{eax}" (number),
23 : [number] "{eax}" (@enumToInt(number)),
2424 [arg1] "{ebx}" (arg1),
2525 [arg2] "{ecx}" (arg2)
2626 : "memory"
2727 );
2828}
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 {
3131 return asm volatile ("int $0x80"
3232 : [ret] "={eax}" (-> usize)
33 : [number] "{eax}" (number),
33 : [number] "{eax}" (@enumToInt(number)),
3434 [arg1] "{ebx}" (arg1),
3535 [arg2] "{ecx}" (arg2),
3636 [arg3] "{edx}" (arg3)
......@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
3838 );
3939}
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 {
4242 return asm volatile ("int $0x80"
4343 : [ret] "={eax}" (-> usize)
44 : [number] "{eax}" (number),
44 : [number] "{eax}" (@enumToInt(number)),
4545 [arg1] "{ebx}" (arg1),
4646 [arg2] "{ecx}" (arg2),
4747 [arg3] "{edx}" (arg3),
......@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
5050 );
5151}
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 {
5454 return asm volatile ("int $0x80"
5555 : [ret] "={eax}" (-> usize)
56 : [number] "{eax}" (number),
56 : [number] "{eax}" (@enumToInt(number)),
5757 [arg1] "{ebx}" (arg1),
5858 [arg2] "{ecx}" (arg2),
5959 [arg3] "{edx}" (arg3),
......@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
6464}
6565
6666pub fn syscall6(
67 number: usize,
67 number: SYS,
6868 arg1: usize,
6969 arg2: usize,
7070 arg3: usize,
......@@ -84,7 +84,7 @@ pub fn syscall6(
8484 \\ pop %%ebp
8585 \\ add $4, %%esp
8686 : [ret] "={eax}" (-> usize)
87 : [number] "{eax}" (number),
87 : [number] "{eax}" (@enumToInt(number)),
8888 [arg1] "{ebx}" (arg1),
8989 [arg2] "{ecx}" (arg2),
9090 [arg3] "{edx}" (arg3),
......@@ -98,7 +98,7 @@ pub fn syscall6(
9898pub fn socketcall(call: usize, args: [*]usize) usize {
9999 return asm volatile ("int $0x80"
100100 : [ret] "={eax}" (-> usize)
101 : [number] "{eax}" (@as(usize, SYS_socketcall)),
101 : [number] "{eax}" (@enumToInt(SYS.socketcall)),
102102 [arg1] "{ebx}" (call),
103103 [arg2] "{ecx}" (@ptrToInt(args))
104104 : "memory"
......@@ -111,7 +111,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a
111111pub fn restore() callconv(.Naked) void {
112112 return asm volatile ("int $0x80"
113113 :
114 : [number] "{eax}" (@as(usize, SYS_sigreturn))
114 : [number] "{eax}" (@enumToInt(SYS.sigreturn))
115115 : "memory"
116116 );
117117}
......@@ -119,7 +119,7 @@ pub fn restore() callconv(.Naked) void {
119119pub fn restore_rt() callconv(.Naked) void {
120120 return asm volatile ("int $0x80"
121121 :
122 : [number] "{eax}" (@as(usize, SYS_rt_sigreturn))
122 : [number] "{eax}" (@enumToInt(SYS.rt_sigreturn))
123123 : "memory"
124124 );
125125}
lib/std/os/linux/mipsel.zig+17-17
......@@ -1,13 +1,13 @@
11usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {
3pub fn syscall0(number: SYS) usize {
44 return asm volatile (
55 \\ syscall
66 \\ blez $7, 1f
77 \\ subu $2, $0, $2
88 \\ 1:
99 : [ret] "={$2}" (-> usize)
10 : [number] "{$2}" (number)
10 : [number] "{$2}" (@enumToInt(number))
1111 : "memory", "cc", "$7"
1212 );
1313}
......@@ -26,46 +26,46 @@ pub fn syscall_pipe(fd: *[2]i32) usize {
2626 \\ sw $3, 4($4)
2727 \\ 2:
2828 : [ret] "={$2}" (-> usize)
29 : [number] "{$2}" (@as(usize, SYS_pipe))
29 : [number] "{$2}" (@enumToInt(SYS.pipe))
3030 : "memory", "cc", "$7"
3131 );
3232}
3333
34pub fn syscall1(number: usize, arg1: usize) usize {
34pub fn syscall1(number: SYS, arg1: usize) usize {
3535 return asm volatile (
3636 \\ syscall
3737 \\ blez $7, 1f
3838 \\ subu $2, $0, $2
3939 \\ 1:
4040 : [ret] "={$2}" (-> usize)
41 : [number] "{$2}" (number),
41 : [number] "{$2}" (@enumToInt(number)),
4242 [arg1] "{$4}" (arg1)
4343 : "memory", "cc", "$7"
4444 );
4545}
4646
47pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {
47pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
4848 return asm volatile (
4949 \\ syscall
5050 \\ blez $7, 1f
5151 \\ subu $2, $0, $2
5252 \\ 1:
5353 : [ret] "={$2}" (-> usize)
54 : [number] "{$2}" (number),
54 : [number] "{$2}" (@enumToInt(number)),
5555 [arg1] "{$4}" (arg1),
5656 [arg2] "{$5}" (arg2)
5757 : "memory", "cc", "$7"
5858 );
5959}
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 {
6262 return asm volatile (
6363 \\ syscall
6464 \\ blez $7, 1f
6565 \\ subu $2, $0, $2
6666 \\ 1:
6767 : [ret] "={$2}" (-> usize)
68 : [number] "{$2}" (number),
68 : [number] "{$2}" (@enumToInt(number)),
6969 [arg1] "{$4}" (arg1),
7070 [arg2] "{$5}" (arg2),
7171 [arg3] "{$6}" (arg3)
......@@ -73,14 +73,14 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
7373 );
7474}
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 {
7777 return asm volatile (
7878 \\ syscall
7979 \\ blez $7, 1f
8080 \\ subu $2, $0, $2
8181 \\ 1:
8282 : [ret] "={$2}" (-> usize)
83 : [number] "{$2}" (number),
83 : [number] "{$2}" (@enumToInt(number)),
8484 [arg1] "{$4}" (arg1),
8585 [arg2] "{$5}" (arg2),
8686 [arg3] "{$6}" (arg3),
......@@ -89,7 +89,7 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
8989 );
9090}
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 {
9393 return asm volatile (
9494 \\ .set noat
9595 \\ subu $sp, $sp, 24
......@@ -100,7 +100,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
100100 \\ subu $2, $0, $2
101101 \\ 1:
102102 : [ret] "={$2}" (-> usize)
103 : [number] "{$2}" (number),
103 : [number] "{$2}" (@enumToInt(number)),
104104 [arg1] "{$4}" (arg1),
105105 [arg2] "{$5}" (arg2),
106106 [arg3] "{$6}" (arg3),
......@@ -111,7 +111,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
111111}
112112
113113pub fn syscall6(
114 number: usize,
114 number: SYS,
115115 arg1: usize,
116116 arg2: usize,
117117 arg3: usize,
......@@ -130,7 +130,7 @@ pub fn syscall6(
130130 \\ subu $2, $0, $2
131131 \\ 1:
132132 : [ret] "={$2}" (-> usize)
133 : [number] "{$2}" (number),
133 : [number] "{$2}" (@enumToInt(number)),
134134 [arg1] "{$4}" (arg1),
135135 [arg2] "{$5}" (arg2),
136136 [arg3] "{$6}" (arg3),
......@@ -147,7 +147,7 @@ pub extern fn clone(func: extern fn (arg: usize) u8, stack: usize, flags: u32, a
147147pub fn restore() callconv(.Naked) void {
148148 return asm volatile ("syscall"
149149 :
150 : [number] "{$2}" (@as(usize, SYS_sigreturn))
150 : [number] "{$2}" (@enumToInt(SYS.sigreturn))
151151 : "memory", "cc", "$7"
152152 );
153153}
......@@ -155,7 +155,7 @@ pub fn restore() callconv(.Naked) void {
155155pub fn restore_rt() callconv(.Naked) void {
156156 return asm volatile ("syscall"
157157 :
158 : [number] "{$2}" (@as(usize, SYS_rt_sigreturn))
158 : [number] "{$2}" (@enumToInt(SYS.rt_sigreturn))
159159 : "memory", "cc", "$7"
160160 );
161161}
lib/std/os/linux/riscv64.zig+15-15
......@@ -1,36 +1,36 @@
11usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {
3pub fn syscall0(number: SYS) usize {
44 return asm volatile ("ecall"
55 : [ret] "={x10}" (-> usize)
6 : [number] "{x17}" (number)
6 : [number] "{x17}" (@enumToInt(number))
77 : "memory"
88 );
99}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {
11pub fn syscall1(number: SYS, arg1: usize) usize {
1212 return asm volatile ("ecall"
1313 : [ret] "={x10}" (-> usize)
14 : [number] "{x17}" (number),
14 : [number] "{x17}" (@enumToInt(number)),
1515 [arg1] "{x10}" (arg1)
1616 : "memory"
1717 );
1818}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {
20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
2121 return asm volatile ("ecall"
2222 : [ret] "={x10}" (-> usize)
23 : [number] "{x17}" (number),
23 : [number] "{x17}" (@enumToInt(number)),
2424 [arg1] "{x10}" (arg1),
2525 [arg2] "{x11}" (arg2)
2626 : "memory"
2727 );
2828}
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 {
3131 return asm volatile ("ecall"
3232 : [ret] "={x10}" (-> usize)
33 : [number] "{x17}" (number),
33 : [number] "{x17}" (@enumToInt(number)),
3434 [arg1] "{x10}" (arg1),
3535 [arg2] "{x11}" (arg2),
3636 [arg3] "{x12}" (arg3)
......@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
3838 );
3939}
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 {
4242 return asm volatile ("ecall"
4343 : [ret] "={x10}" (-> usize)
44 : [number] "{x17}" (number),
44 : [number] "{x17}" (@enumToInt(number)),
4545 [arg1] "{x10}" (arg1),
4646 [arg2] "{x11}" (arg2),
4747 [arg3] "{x12}" (arg3),
......@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
5050 );
5151}
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 {
5454 return asm volatile ("ecall"
5555 : [ret] "={x10}" (-> usize)
56 : [number] "{x17}" (number),
56 : [number] "{x17}" (@enumToInt(number)),
5757 [arg1] "{x10}" (arg1),
5858 [arg2] "{x11}" (arg2),
5959 [arg3] "{x12}" (arg3),
......@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
6464}
6565
6666pub fn syscall6(
67 number: usize,
67 number: SYS,
6868 arg1: usize,
6969 arg2: usize,
7070 arg3: usize,
......@@ -74,7 +74,7 @@ pub fn syscall6(
7474) usize {
7575 return asm volatile ("ecall"
7676 : [ret] "={x10}" (-> usize)
77 : [number] "{x17}" (number),
77 : [number] "{x17}" (@enumToInt(number)),
7878 [arg1] "{x10}" (arg1),
7979 [arg2] "{x11}" (arg2),
8080 [arg3] "{x12}" (arg3),
......@@ -92,7 +92,7 @@ pub const restore = restore_rt;
9292pub fn restore_rt() callconv(.Naked) void {
9393 return asm volatile ("ecall"
9494 :
95 : [number] "{x17}" (@as(usize, SYS_rt_sigreturn))
95 : [number] "{x17}" (@enumToInt(SYS.rt_sigreturn))
9696 : "memory"
9797 );
9898}
lib/std/os/linux/tls.zig+4-4
......@@ -122,7 +122,7 @@ pub fn setThreadPointer(addr: usize) void {
122122 .seg_not_present = 0,
123123 .useable = 1,
124124 };
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));
126126 assert(rc == 0);
127127
128128 const gdt_entry_number = user_desc.entry_number;
......@@ -135,7 +135,7 @@ pub fn setThreadPointer(addr: usize) void {
135135 );
136136 },
137137 .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);
139139 assert(rc == 0);
140140 },
141141 .aarch64 => {
......@@ -146,7 +146,7 @@ pub fn setThreadPointer(addr: usize) void {
146146 );
147147 },
148148 .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);
150150 assert(rc == 0);
151151 },
152152 .riscv64 => {
......@@ -157,7 +157,7 @@ pub fn setThreadPointer(addr: usize) void {
157157 );
158158 },
159159 .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);
161161 assert(rc == 0);
162162 },
163163 else => @compileError("Unsupported architecture"),
lib/std/os/linux/x86_64.zig+15-15
......@@ -1,36 +1,36 @@
11usingnamespace @import("../bits.zig");
22
3pub fn syscall0(number: usize) usize {
3pub fn syscall0(number: SYS) usize {
44 return asm volatile ("syscall"
55 : [ret] "={rax}" (-> usize)
6 : [number] "{rax}" (number)
6 : [number] "{rax}" (@enumToInt(number))
77 : "rcx", "r11", "memory"
88 );
99}
1010
11pub fn syscall1(number: usize, arg1: usize) usize {
11pub fn syscall1(number: SYS, arg1: usize) usize {
1212 return asm volatile ("syscall"
1313 : [ret] "={rax}" (-> usize)
14 : [number] "{rax}" (number),
14 : [number] "{rax}" (@enumToInt(number)),
1515 [arg1] "{rdi}" (arg1)
1616 : "rcx", "r11", "memory"
1717 );
1818}
1919
20pub fn syscall2(number: usize, arg1: usize, arg2: usize) usize {
20pub fn syscall2(number: SYS, arg1: usize, arg2: usize) usize {
2121 return asm volatile ("syscall"
2222 : [ret] "={rax}" (-> usize)
23 : [number] "{rax}" (number),
23 : [number] "{rax}" (@enumToInt(number)),
2424 [arg1] "{rdi}" (arg1),
2525 [arg2] "{rsi}" (arg2)
2626 : "rcx", "r11", "memory"
2727 );
2828}
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 {
3131 return asm volatile ("syscall"
3232 : [ret] "={rax}" (-> usize)
33 : [number] "{rax}" (number),
33 : [number] "{rax}" (@enumToInt(number)),
3434 [arg1] "{rdi}" (arg1),
3535 [arg2] "{rsi}" (arg2),
3636 [arg3] "{rdx}" (arg3)
......@@ -38,10 +38,10 @@ pub fn syscall3(number: usize, arg1: usize, arg2: usize, arg3: usize) usize {
3838 );
3939}
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 {
4242 return asm volatile ("syscall"
4343 : [ret] "={rax}" (-> usize)
44 : [number] "{rax}" (number),
44 : [number] "{rax}" (@enumToInt(number)),
4545 [arg1] "{rdi}" (arg1),
4646 [arg2] "{rsi}" (arg2),
4747 [arg3] "{rdx}" (arg3),
......@@ -50,10 +50,10 @@ pub fn syscall4(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
5050 );
5151}
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 {
5454 return asm volatile ("syscall"
5555 : [ret] "={rax}" (-> usize)
56 : [number] "{rax}" (number),
56 : [number] "{rax}" (@enumToInt(number)),
5757 [arg1] "{rdi}" (arg1),
5858 [arg2] "{rsi}" (arg2),
5959 [arg3] "{rdx}" (arg3),
......@@ -64,7 +64,7 @@ pub fn syscall5(number: usize, arg1: usize, arg2: usize, arg3: usize, arg4: usiz
6464}
6565
6666pub fn syscall6(
67 number: usize,
67 number: SYS,
6868 arg1: usize,
6969 arg2: usize,
7070 arg3: usize,
......@@ -74,7 +74,7 @@ pub fn syscall6(
7474) usize {
7575 return asm volatile ("syscall"
7676 : [ret] "={rax}" (-> usize)
77 : [number] "{rax}" (number),
77 : [number] "{rax}" (@enumToInt(number)),
7878 [arg1] "{rdi}" (arg1),
7979 [arg2] "{rsi}" (arg2),
8080 [arg3] "{rdx}" (arg3),
......@@ -93,7 +93,7 @@ pub const restore = restore_rt;
9393pub fn restore_rt() callconv(.Naked) void {
9494 return asm volatile ("syscall"
9595 :
96 : [number] "{rax}" (@as(usize, SYS_rt_sigreturn))
96 : [number] "{rax}" (@enumToInt(SYS.rt_sigreturn))
9797 : "rcx", "r11", "memory"
9898 );
9999}
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 {
5454 // sysarch(ARM_SYNC_ICACHE, &arg);
5555 @compileError("TODO: implement for NetBSD/FreeBSD");
5656 } 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);
5858 std.debug.assert(result == 0);
5959 } else {
6060 @compileError("no __clear_cache implementation available for this target");