authorgravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-10-17 18:09:44+03:00
committergravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-10-20 15:15:01+03:00
logafe26bbcbdfd7d6fc5ed141688dd9baeb2f1c104
treed2a5fa2e1769e2c6ff5dcad434ede5534c93b7f8
parent7a3f0a55d9a481f260935f26426ee4508d44cb18

System call numbers on FreeBSD are machine-independent

But e.g. sbrk is only removed in new architectures (aarch64, riscv), so keep it in x86_64

4 files changed, 530 insertions(+), 509 deletions(-)

CMakeLists.txt+1
......@@ -582,6 +582,7 @@ set(ZIG_STD_FILES
582582 "os/linux/arm64.zig"
583583 "os/freebsd/errno.zig"
584584 "os/freebsd/index.zig"
585 "os/freebsd/syscall.zig"
585586 "os/freebsd/x86_64.zig"
586587 "os/path.zig"
587588 "os/time.zig"
std/os/freebsd/index.zig+36-35
......@@ -4,6 +4,7 @@ const arch = switch (builtin.arch) {
44 builtin.Arch.x86_64 => @import("x86_64.zig"),
55 else => @compileError("unsupported arch"),
66};
7pub use @import("syscall.zig");
78pub use @import("errno.zig");
89
910pub const PATH_MAX = 1024;
......@@ -367,64 +368,64 @@ pub fn getErrno(r: usize) usize {
367368}
368369
369370pub fn dup2(old: i32, new: i32) usize {
370 return arch.syscall2(arch.SYS_dup2, @intCast(usize, old), @intCast(usize, new));
371 return arch.syscall2(SYS_dup2, @intCast(usize, old), @intCast(usize, new));
371372}
372373
373374pub fn chdir(path: [*]const u8) usize {
374 return arch.syscall1(arch.SYS_chdir, @ptrToInt(path));
375 return arch.syscall1(SYS_chdir, @ptrToInt(path));
375376}
376377
377378pub fn execve(path: [*]const u8, argv: [*]const ?[*]const u8, envp: [*]const ?[*]const u8) usize {
378 return arch.syscall3(arch.SYS_execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp));
379 return arch.syscall3(SYS_execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp));
379380}
380381
381382pub fn fork() usize {
382 return arch.syscall0(arch.SYS_fork);
383 return arch.syscall0(SYS_fork);
383384}
384385
385386pub fn getcwd(buf: [*]u8, size: usize) usize {
386 return arch.syscall2(arch.SYS___getcwd, @ptrToInt(buf), size);
387 return arch.syscall2(SYS___getcwd, @ptrToInt(buf), size);
387388}
388389
389390pub fn getdents(fd: i32, dirp: [*]u8, count: usize) usize {
390 return arch.syscall3(arch.SYS_getdents, @intCast(usize, fd), @ptrToInt(dirp), count);
391 return arch.syscall3(SYS_getdents, @intCast(usize, fd), @ptrToInt(dirp), count);
391392}
392393
393394pub fn isatty(fd: i32) bool {
394395 var wsz: winsize = undefined;
395 return arch.syscall3(arch.SYS_ioctl, @intCast(usize, fd), TIOCGWINSZ, @ptrToInt(&wsz)) == 0;
396 return arch.syscall3(SYS_ioctl, @intCast(usize, fd), TIOCGWINSZ, @ptrToInt(&wsz)) == 0;
396397}
397398
398399pub fn readlink(noalias path: [*]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize {
399 return arch.syscall3(arch.SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
400 return arch.syscall3(SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len);
400401}
401402
402403pub fn mkdir(path: [*]const u8, mode: u32) usize {
403 return arch.syscall2(arch.SYS_mkdir, @ptrToInt(path), mode);
404 return arch.syscall2(SYS_mkdir, @ptrToInt(path), mode);
404405}
405406
406407pub fn mmap(address: ?*u8, length: usize, prot: usize, flags: usize, fd: i32, offset: isize) usize {
407 return arch.syscall6(arch.SYS_mmap, @ptrToInt(address), length, prot, flags, @intCast(usize, fd), @bitCast(usize, offset));
408 return arch.syscall6(SYS_mmap, @ptrToInt(address), length, prot, flags, @intCast(usize, fd), @bitCast(usize, offset));
408409}
409410
410411pub fn munmap(address: usize, length: usize) usize {
411 return arch.syscall2(arch.SYS_munmap, address, length);
412 return arch.syscall2(SYS_munmap, address, length);
412413}
413414
414415pub fn read(fd: i32, buf: [*]u8, count: usize) usize {
415 return arch.syscall3(arch.SYS_read, @intCast(usize, fd), @ptrToInt(buf), count);
416 return arch.syscall3(SYS_read, @intCast(usize, fd), @ptrToInt(buf), count);
416417}
417418
418419pub fn rmdir(path: [*]const u8) usize {
419 return arch.syscall1(arch.SYS_rmdir, @ptrToInt(path));
420 return arch.syscall1(SYS_rmdir, @ptrToInt(path));
420421}
421422
422423pub fn symlink(existing: [*]const u8, new: [*]const u8) usize {
423 return arch.syscall2(arch.SYS_symlink, @ptrToInt(existing), @ptrToInt(new));
424 return arch.syscall2(SYS_symlink, @ptrToInt(existing), @ptrToInt(new));
424425}
425426
426427pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: usize) usize {
427 return arch.syscall4(arch.SYS_pread, usize(fd), @ptrToInt(buf), count, offset);
428 return arch.syscall4(SYS_pread, usize(fd), @ptrToInt(buf), count, offset);
428429}
429430
430431pub fn pipe(fd: *[2]i32) usize {
......@@ -432,80 +433,80 @@ pub fn pipe(fd: *[2]i32) usize {
432433}
433434
434435pub fn pipe2(fd: *[2]i32, flags: usize) usize {
435 return arch.syscall2(arch.SYS_pipe2, @ptrToInt(fd), flags);
436 return arch.syscall2(SYS_pipe2, @ptrToInt(fd), flags);
436437}
437438
438439pub fn write(fd: i32, buf: [*]const u8, count: usize) usize {
439 return arch.syscall3(arch.SYS_write, @intCast(usize, fd), @ptrToInt(buf), count);
440 return arch.syscall3(SYS_write, @intCast(usize, fd), @ptrToInt(buf), count);
440441}
441442
442443pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize {
443 return arch.syscall4(arch.SYS_pwrite, @intCast(usize, fd), @ptrToInt(buf), count, offset);
444 return arch.syscall4(SYS_pwrite, @intCast(usize, fd), @ptrToInt(buf), count, offset);
444445}
445446
446447pub fn rename(old: [*]const u8, new: [*]const u8) usize {
447 return arch.syscall2(arch.SYS_rename, @ptrToInt(old), @ptrToInt(new));
448 return arch.syscall2(SYS_rename, @ptrToInt(old), @ptrToInt(new));
448449}
449450
450451pub fn open(path: [*]const u8, flags: u32, perm: usize) usize {
451 return arch.syscall3(arch.SYS_open, @ptrToInt(path), flags, perm);
452 return arch.syscall3(SYS_open, @ptrToInt(path), flags, perm);
452453}
453454
454455pub fn create(path: [*]const u8, perm: usize) usize {
455 return arch.syscall2(arch.SYS_creat, @ptrToInt(path), perm);
456 return arch.syscall2(SYS_creat, @ptrToInt(path), perm);
456457}
457458
458459pub fn openat(dirfd: i32, path: [*]const u8, flags: usize, mode: usize) usize {
459 return arch.syscall4(arch.SYS_openat, @intCast(usize, dirfd), @ptrToInt(path), flags, mode);
460 return arch.syscall4(SYS_openat, @intCast(usize, dirfd), @ptrToInt(path), flags, mode);
460461}
461462
462463pub fn close(fd: i32) usize {
463 return arch.syscall1(arch.SYS_close, @intCast(usize, fd));
464 return arch.syscall1(SYS_close, @intCast(usize, fd));
464465}
465466
466467pub fn lseek(fd: i32, offset: isize, ref_pos: usize) usize {
467 return arch.syscall3(arch.SYS_lseek, @intCast(usize, fd), @bitCast(usize, offset), ref_pos);
468 return arch.syscall3(SYS_lseek, @intCast(usize, fd), @bitCast(usize, offset), ref_pos);
468469}
469470
470471pub fn exit(status: i32) noreturn {
471 _ = arch.syscall1(arch.SYS_exit, @bitCast(usize, isize(status)));
472 _ = arch.syscall1(SYS_exit, @bitCast(usize, isize(status)));
472473 unreachable;
473474}
474475
475476pub fn getrandom(buf: [*]u8, count: usize, flags: u32) usize {
476 return arch.syscall3(arch.SYS_getrandom, @ptrToInt(buf), count, @intCast(usize, flags));
477 return arch.syscall3(SYS_getrandom, @ptrToInt(buf), count, @intCast(usize, flags));
477478}
478479
479480pub fn kill(pid: i32, sig: i32) usize {
480 return arch.syscall2(arch.SYS_kill, @bitCast(usize, @intCast(isize, pid)), @intCast(usize, sig));
481 return arch.syscall2(SYS_kill, @bitCast(usize, @intCast(isize, pid)), @intCast(usize, sig));
481482}
482483
483484pub fn unlink(path: [*]const u8) usize {
484 return arch.syscall1(arch.SYS_unlink, @ptrToInt(path));
485 return arch.syscall1(SYS_unlink, @ptrToInt(path));
485486}
486487
487488pub fn waitpid(pid: i32, status: *i32, options: i32) usize {
488 return arch.syscall4(arch.SYS_wait4, @bitCast(usize, isize(pid)), @ptrToInt(status), @bitCast(usize, isize(options)), 0);
489 return arch.syscall4(SYS_wait4, @bitCast(usize, isize(pid)), @ptrToInt(status), @bitCast(usize, isize(options)), 0);
489490}
490491
491492pub fn nanosleep(req: *const timespec, rem: ?*timespec) usize {
492 return arch.syscall2(arch.SYS_nanosleep, @ptrToInt(req), @ptrToInt(rem));
493 return arch.syscall2(SYS_nanosleep, @ptrToInt(req), @ptrToInt(rem));
493494}
494495
495496pub fn setuid(uid: u32) usize {
496 return arch.syscall1(arch.SYS_setuid, uid);
497 return arch.syscall1(SYS_setuid, uid);
497498}
498499
499500pub fn setgid(gid: u32) usize {
500 return arch.syscall1(arch.SYS_setgid, gid);
501 return arch.syscall1(SYS_setgid, gid);
501502}
502503
503504pub fn setreuid(ruid: u32, euid: u32) usize {
504 return arch.syscall2(arch.SYS_setreuid, ruid, euid);
505 return arch.syscall2(SYS_setreuid, ruid, euid);
505506}
506507
507508pub fn setregid(rgid: u32, egid: u32) usize {
508 return arch.syscall2(arch.SYS_setregid, rgid, egid);
509 return arch.syscall2(SYS_setregid, rgid, egid);
509510}
510511
511512pub fn sigprocmask(flags: u32, noalias set: *const sigset_t, noalias oldset: ?*sigset_t) usize {
......@@ -567,5 +568,5 @@ pub const Stat = arch.Stat;
567568pub const timespec = arch.timespec;
568569
569570pub fn fstat(fd: i32, stat_buf: *Stat) usize {
570 return arch.syscall2(arch.SYS_fstat, @intCast(usize, fd), @ptrToInt(stat_buf));
571 return arch.syscall2(SYS_fstat, @intCast(usize, fd), @ptrToInt(stat_buf));
571572}
std/os/freebsd/syscall.zig created+493
......@@ -0,0 +1,493 @@
1pub const SYS_syscall = 0;
2pub const SYS_exit = 1;
3pub const SYS_fork = 2;
4pub const SYS_read = 3;
5pub const SYS_write = 4;
6pub const SYS_open = 5;
7pub const SYS_close = 6;
8pub const SYS_wait4 = 7;
9// 8 is old creat
10pub const SYS_link = 9;
11pub const SYS_unlink = 10;
12// 11 is obsolete execv
13pub const SYS_chdir = 12;
14pub const SYS_fchdir = 13;
15pub const SYS_freebsd11_mknod = 14;
16pub const SYS_chmod = 15;
17pub const SYS_chown = 16;
18pub const SYS_break = 17;
19// 18 is freebsd4 getfsstat
20// 19 is old lseek
21pub const SYS_getpid = 20;
22pub const SYS_mount = 21;
23pub const SYS_unmount = 22;
24pub const SYS_setuid = 23;
25pub const SYS_getuid = 24;
26pub const SYS_geteuid = 25;
27pub const SYS_ptrace = 26;
28pub const SYS_recvmsg = 27;
29pub const SYS_sendmsg = 28;
30pub const SYS_recvfrom = 29;
31pub const SYS_accept = 30;
32pub const SYS_getpeername = 31;
33pub const SYS_getsockname = 32;
34pub const SYS_access = 33;
35pub const SYS_chflags = 34;
36pub const SYS_fchflags = 35;
37pub const SYS_sync = 36;
38pub const SYS_kill = 37;
39// 38 is old stat
40pub const SYS_getppid = 39;
41// 40 is old lstat
42pub const SYS_dup = 41;
43pub const SYS_freebsd10_pipe = 42;
44pub const SYS_getegid = 43;
45pub const SYS_profil = 44;
46pub const SYS_ktrace = 45;
47// 46 is old sigaction
48pub const SYS_getgid = 47;
49// 48 is old sigprocmask
50pub const SYS_getlogin = 49;
51pub const SYS_setlogin = 50;
52pub const SYS_acct = 51;
53// 52 is old sigpending
54pub const SYS_sigaltstack = 53;
55pub const SYS_ioctl = 54;
56pub const SYS_reboot = 55;
57pub const SYS_revoke = 56;
58pub const SYS_symlink = 57;
59pub const SYS_readlink = 58;
60pub const SYS_execve = 59;
61pub const SYS_umask = 60;
62pub const SYS_chroot = 61;
63// 62 is old fstat
64// 63 is old getkerninfo
65// 64 is old getpagesize
66pub const SYS_msync = 65;
67pub const SYS_vfork = 66;
68// 67 is obsolete vread
69// 68 is obsolete vwrite
70// 69 is obsolete sbrk (still present on some platforms)
71pub const SYS_sstk = 70;
72// 71 is old mmap
73pub const SYS_vadvise = 72;
74pub const SYS_munmap = 73;
75pub const SYS_mprotect = 74;
76pub const SYS_madvise = 75;
77// 76 is obsolete vhangup
78// 77 is obsolete vlimit
79pub const SYS_mincore = 78;
80pub const SYS_getgroups = 79;
81pub const SYS_setgroups = 80;
82pub const SYS_getpgrp = 81;
83pub const SYS_setpgid = 82;
84pub const SYS_setitimer = 83;
85// 84 is old wait
86pub const SYS_swapon = 85;
87pub const SYS_getitimer = 86;
88// 87 is old gethostname
89// 88 is old sethostname
90pub const SYS_getdtablesize = 89;
91pub const SYS_dup2 = 90;
92pub const SYS_fcntl = 92;
93pub const SYS_select = 93;
94pub const SYS_fsync = 95;
95pub const SYS_setpriority = 96;
96pub const SYS_socket = 97;
97pub const SYS_connect = 98;
98// 99 is old accept
99pub const SYS_getpriority = 100;
100// 101 is old send
101// 102 is old recv
102// 103 is old sigreturn
103pub const SYS_bind = 104;
104pub const SYS_setsockopt = 105;
105pub const SYS_listen = 106;
106// 107 is obsolete vtimes
107// 108 is old sigvec
108// 109 is old sigblock
109// 110 is old sigsetmask
110// 111 is old sigsuspend
111// 112 is old sigstack
112// 113 is old recvmsg
113// 114 is old sendmsg
114// 115 is obsolete vtrace
115pub const SYS_gettimeofday = 116;
116pub const SYS_getrusage = 117;
117pub const SYS_getsockopt = 118;
118pub const SYS_readv = 120;
119pub const SYS_writev = 121;
120pub const SYS_settimeofday = 122;
121pub const SYS_fchown = 123;
122pub const SYS_fchmod = 124;
123// 125 is old recvfrom
124pub const SYS_setreuid = 126;
125pub const SYS_setregid = 127;
126pub const SYS_rename = 128;
127// 129 is old truncate
128// 130 is old ftruncate
129pub const SYS_flock = 131;
130pub const SYS_mkfifo = 132;
131pub const SYS_sendto = 133;
132pub const SYS_shutdown = 134;
133pub const SYS_socketpair = 135;
134pub const SYS_mkdir = 136;
135pub const SYS_rmdir = 137;
136pub const SYS_utimes = 138;
137// 139 is obsolete 4.2 sigreturn
138pub const SYS_adjtime = 140;
139// 141 is old getpeername
140// 142 is old gethostid
141// 143 is old sethostid
142// 144 is old getrlimit
143// 145 is old setrlimit
144// 146 is old killpg
145pub const SYS_setsid = 147;
146pub const SYS_quotactl = 148;
147// 149 is old quota
148// 150 is old getsockname
149pub const SYS_nlm_syscall = 154;
150pub const SYS_nfssvc = 155;
151// 156 is old getdirentries
152// 157 is freebsd4 statfs
153// 158 is freebsd4 fstatfs
154pub const SYS_lgetfh = 160;
155pub const SYS_getfh = 161;
156// 162 is freebsd4 getdomainname
157// 163 is freebsd4 setdomainname
158// 164 is freebsd4 uname
159pub const SYS_sysarch = 165;
160pub const SYS_rtprio = 166;
161pub const SYS_semsys = 169;
162pub const SYS_msgsys = 170;
163pub const SYS_shmsys = 171;
164// 173 is freebsd6 pread
165// 174 is freebsd6 pwrite
166pub const SYS_setfib = 175;
167pub const SYS_ntp_adjtime = 176;
168pub const SYS_setgid = 181;
169pub const SYS_setegid = 182;
170pub const SYS_seteuid = 183;
171// 184 is obsolete lfs_bmapv
172// 185 is obsolete lfs_markv
173// 186 is obsolete lfs_segclean
174// 187 is obsolete lfs_segwait
175pub const SYS_freebsd11_stat = 188;
176pub const SYS_freebsd11_fstat = 189;
177pub const SYS_freebsd11_lstat = 190;
178pub const SYS_pathconf = 191;
179pub const SYS_fpathconf = 192;
180pub const SYS_getrlimit = 194;
181pub const SYS_setrlimit = 195;
182pub const SYS_freebsd11_getdirentries = 196;
183// 197 is freebsd6 mmap
184pub const SYS___syscall = 198;
185// 199 is freebsd6 lseek
186// 200 is freebsd6 truncate
187// 201 is freebsd6 ftruncate
188pub const SYS___sysctl = 202;
189pub const SYS_mlock = 203;
190pub const SYS_munlock = 204;
191pub const SYS_undelete = 205;
192pub const SYS_futimes = 206;
193pub const SYS_getpgid = 207;
194pub const SYS_poll = 209;
195pub const SYS_freebsd7___semctl = 220;
196pub const SYS_semget = 221;
197pub const SYS_semop = 222;
198pub const SYS_freebsd7_msgctl = 224;
199pub const SYS_msgget = 225;
200pub const SYS_msgsnd = 226;
201pub const SYS_msgrcv = 227;
202pub const SYS_shmat = 228;
203pub const SYS_freebsd7_shmctl = 229;
204pub const SYS_shmdt = 230;
205pub const SYS_shmget = 231;
206pub const SYS_clock_gettime = 232;
207pub const SYS_clock_settime = 233;
208pub const SYS_clock_getres = 234;
209pub const SYS_ktimer_create = 235;
210pub const SYS_ktimer_delete = 236;
211pub const SYS_ktimer_settime = 237;
212pub const SYS_ktimer_gettime = 238;
213pub const SYS_ktimer_getoverrun = 239;
214pub const SYS_nanosleep = 240;
215pub const SYS_ffclock_getcounter = 241;
216pub const SYS_ffclock_setestimate = 242;
217pub const SYS_ffclock_getestimate = 243;
218pub const SYS_clock_nanosleep = 244;
219pub const SYS_clock_getcpuclockid2 = 247;
220pub const SYS_ntp_gettime = 248;
221pub const SYS_minherit = 250;
222pub const SYS_rfork = 251;
223// 252 is obsolete openbsd_poll
224pub const SYS_issetugid = 253;
225pub const SYS_lchown = 254;
226pub const SYS_aio_read = 255;
227pub const SYS_aio_write = 256;
228pub const SYS_lio_listio = 257;
229pub const SYS_freebsd11_getdents = 272;
230pub const SYS_lchmod = 274;
231// 275 is obsolete netbsd_lchown
232pub const SYS_lutimes = 276;
233// 277 is obsolete netbsd_msync
234pub const SYS_freebsd11_nstat = 278;
235pub const SYS_freebsd11_nfstat = 279;
236pub const SYS_freebsd11_nlstat = 280;
237pub const SYS_preadv = 289;
238pub const SYS_pwritev = 290;
239// 297 is freebsd4 fhstatfs
240pub const SYS_fhopen = 298;
241pub const SYS_freebsd11_fhstat = 299;
242pub const SYS_modnext = 300;
243pub const SYS_modstat = 301;
244pub const SYS_modfnext = 302;
245pub const SYS_modfind = 303;
246pub const SYS_kldload = 304;
247pub const SYS_kldunload = 305;
248pub const SYS_kldfind = 306;
249pub const SYS_kldnext = 307;
250pub const SYS_kldstat = 308;
251pub const SYS_kldfirstmod = 309;
252pub const SYS_getsid = 310;
253pub const SYS_setresuid = 311;
254pub const SYS_setresgid = 312;
255// 313 is obsolete signanosleep
256pub const SYS_aio_return = 314;
257pub const SYS_aio_suspend = 315;
258pub const SYS_aio_cancel = 316;
259pub const SYS_aio_error = 317;
260// 318 is freebsd6 aio_read
261// 319 is freebsd6 aio_write
262// 320 is freebsd6 lio_listio
263pub const SYS_yield = 321;
264// 322 is obsolete thr_sleep
265// 323 is obsolete thr_wakeup
266pub const SYS_mlockall = 324;
267pub const SYS_munlockall = 325;
268pub const SYS___getcwd = 326;
269pub const SYS_sched_setparam = 327;
270pub const SYS_sched_getparam = 328;
271pub const SYS_sched_setscheduler = 329;
272pub const SYS_sched_getscheduler = 330;
273pub const SYS_sched_yield = 331;
274pub const SYS_sched_get_priority_max = 332;
275pub const SYS_sched_get_priority_min = 333;
276pub const SYS_sched_rr_get_interval = 334;
277pub const SYS_utrace = 335;
278// 336 is freebsd4 sendfile
279pub const SYS_kldsym = 337;
280pub const SYS_jail = 338;
281pub const SYS_nnpfs_syscall = 339;
282pub const SYS_sigprocmask = 340;
283pub const SYS_sigsuspend = 341;
284// 342 is freebsd4 sigaction
285pub const SYS_sigpending = 343;
286// 344 is freebsd4 sigreturn
287pub const SYS_sigtimedwait = 345;
288pub const SYS_sigwaitinfo = 346;
289pub const SYS___acl_get_file = 347;
290pub const SYS___acl_set_file = 348;
291pub const SYS___acl_get_fd = 349;
292pub const SYS___acl_set_fd = 350;
293pub const SYS___acl_delete_file = 351;
294pub const SYS___acl_delete_fd = 352;
295pub const SYS___acl_aclcheck_file = 353;
296pub const SYS___acl_aclcheck_fd = 354;
297pub const SYS_extattrctl = 355;
298pub const SYS_extattr_set_file = 356;
299pub const SYS_extattr_get_file = 357;
300pub const SYS_extattr_delete_file = 358;
301pub const SYS_aio_waitcomplete = 359;
302pub const SYS_getresuid = 360;
303pub const SYS_getresgid = 361;
304pub const SYS_kqueue = 362;
305pub const SYS_freebsd11_kevent = 363;
306// 364 is obsolete __cap_get_proc
307// 365 is obsolete __cap_set_proc
308// 366 is obsolete __cap_get_fd
309// 367 is obsolete __cap_get_file
310// 368 is obsolete __cap_set_fd
311// 369 is obsolete __cap_set_file
312pub const SYS_extattr_set_fd = 371;
313pub const SYS_extattr_get_fd = 372;
314pub const SYS_extattr_delete_fd = 373;
315pub const SYS___setugid = 374;
316pub const SYS_eaccess = 376;
317pub const SYS_afs3_syscall = 377;
318pub const SYS_nmount = 378;
319// 379 is obsolete kse_exit
320// 380 is obsolete kse_wakeup
321// 381 is obsolete kse_create
322// 382 is obsolete kse_thr_interrupt
323// 383 is obsolete kse_release
324pub const SYS___mac_get_proc = 384;
325pub const SYS___mac_set_proc = 385;
326pub const SYS___mac_get_fd = 386;
327pub const SYS___mac_get_file = 387;
328pub const SYS___mac_set_fd = 388;
329pub const SYS___mac_set_file = 389;
330pub const SYS_kenv = 390;
331pub const SYS_lchflags = 391;
332pub const SYS_uuidgen = 392;
333pub const SYS_sendfile = 393;
334pub const SYS_mac_syscall = 394;
335pub const SYS_freebsd11_getfsstat = 395;
336pub const SYS_freebsd11_statfs = 396;
337pub const SYS_freebsd11_fstatfs = 397;
338pub const SYS_freebsd11_fhstatfs = 398;
339pub const SYS_ksem_close = 400;
340pub const SYS_ksem_post = 401;
341pub const SYS_ksem_wait = 402;
342pub const SYS_ksem_trywait = 403;
343pub const SYS_ksem_init = 404;
344pub const SYS_ksem_open = 405;
345pub const SYS_ksem_unlink = 406;
346pub const SYS_ksem_getvalue = 407;
347pub const SYS_ksem_destroy = 408;
348pub const SYS___mac_get_pid = 409;
349pub const SYS___mac_get_link = 410;
350pub const SYS___mac_set_link = 411;
351pub const SYS_extattr_set_link = 412;
352pub const SYS_extattr_get_link = 413;
353pub const SYS_extattr_delete_link = 414;
354pub const SYS___mac_execve = 415;
355pub const SYS_sigaction = 416;
356pub const SYS_sigreturn = 417;
357pub const SYS_getcontext = 421;
358pub const SYS_setcontext = 422;
359pub const SYS_swapcontext = 423;
360pub const SYS_swapoff = 424;
361pub const SYS___acl_get_link = 425;
362pub const SYS___acl_set_link = 426;
363pub const SYS___acl_delete_link = 427;
364pub const SYS___acl_aclcheck_link = 428;
365pub const SYS_sigwait = 429;
366pub const SYS_thr_create = 430;
367pub const SYS_thr_exit = 431;
368pub const SYS_thr_self = 432;
369pub const SYS_thr_kill = 433;
370pub const SYS_jail_attach = 436;
371pub const SYS_extattr_list_fd = 437;
372pub const SYS_extattr_list_file = 438;
373pub const SYS_extattr_list_link = 439;
374// 440 is obsolete kse_switchin
375pub const SYS_ksem_timedwait = 441;
376pub const SYS_thr_suspend = 442;
377pub const SYS_thr_wake = 443;
378pub const SYS_kldunloadf = 444;
379pub const SYS_audit = 445;
380pub const SYS_auditon = 446;
381pub const SYS_getauid = 447;
382pub const SYS_setauid = 448;
383pub const SYS_getaudit = 449;
384pub const SYS_setaudit = 450;
385pub const SYS_getaudit_addr = 451;
386pub const SYS_setaudit_addr = 452;
387pub const SYS_auditctl = 453;
388pub const SYS__umtx_op = 454;
389pub const SYS_thr_new = 455;
390pub const SYS_sigqueue = 456;
391pub const SYS_kmq_open = 457;
392pub const SYS_kmq_setattr = 458;
393pub const SYS_kmq_timedreceive = 459;
394pub const SYS_kmq_timedsend = 460;
395pub const SYS_kmq_notify = 461;
396pub const SYS_kmq_unlink = 462;
397pub const SYS_abort2 = 463;
398pub const SYS_thr_set_name = 464;
399pub const SYS_aio_fsync = 465;
400pub const SYS_rtprio_thread = 466;
401pub const SYS_sctp_peeloff = 471;
402pub const SYS_sctp_generic_sendmsg = 472;
403pub const SYS_sctp_generic_sendmsg_iov = 473;
404pub const SYS_sctp_generic_recvmsg = 474;
405pub const SYS_pread = 475;
406pub const SYS_pwrite = 476;
407pub const SYS_mmap = 477;
408pub const SYS_lseek = 478;
409pub const SYS_truncate = 479;
410pub const SYS_ftruncate = 480;
411pub const SYS_thr_kill2 = 481;
412pub const SYS_shm_open = 482;
413pub const SYS_shm_unlink = 483;
414pub const SYS_cpuset = 484;
415pub const SYS_cpuset_setid = 485;
416pub const SYS_cpuset_getid = 486;
417pub const SYS_cpuset_getaffinity = 487;
418pub const SYS_cpuset_setaffinity = 488;
419pub const SYS_faccessat = 489;
420pub const SYS_fchmodat = 490;
421pub const SYS_fchownat = 491;
422pub const SYS_fexecve = 492;
423pub const SYS_freebsd11_fstatat = 493;
424pub const SYS_futimesat = 494;
425pub const SYS_linkat = 495;
426pub const SYS_mkdirat = 496;
427pub const SYS_mkfifoat = 497;
428pub const SYS_freebsd11_mknodat = 498;
429pub const SYS_openat = 499;
430pub const SYS_readlinkat = 500;
431pub const SYS_renameat = 501;
432pub const SYS_symlinkat = 502;
433pub const SYS_unlinkat = 503;
434pub const SYS_posix_openpt = 504;
435pub const SYS_gssd_syscall = 505;
436pub const SYS_jail_get = 506;
437pub const SYS_jail_set = 507;
438pub const SYS_jail_remove = 508;
439pub const SYS_closefrom = 509;
440pub const SYS___semctl = 510;
441pub const SYS_msgctl = 511;
442pub const SYS_shmctl = 512;
443pub const SYS_lpathconf = 513;
444// 514 is obsolete cap_new
445pub const SYS___cap_rights_get = 515;
446pub const SYS_cap_enter = 516;
447pub const SYS_cap_getmode = 517;
448pub const SYS_pdfork = 518;
449pub const SYS_pdkill = 519;
450pub const SYS_pdgetpid = 520;
451pub const SYS_pselect = 522;
452pub const SYS_getloginclass = 523;
453pub const SYS_setloginclass = 524;
454pub const SYS_rctl_get_racct = 525;
455pub const SYS_rctl_get_rules = 526;
456pub const SYS_rctl_get_limits = 527;
457pub const SYS_rctl_add_rule = 528;
458pub const SYS_rctl_remove_rule = 529;
459pub const SYS_posix_fallocate = 530;
460pub const SYS_posix_fadvise = 531;
461pub const SYS_wait6 = 532;
462pub const SYS_cap_rights_limit = 533;
463pub const SYS_cap_ioctls_limit = 534;
464pub const SYS_cap_ioctls_get = 535;
465pub const SYS_cap_fcntls_limit = 536;
466pub const SYS_cap_fcntls_get = 537;
467pub const SYS_bindat = 538;
468pub const SYS_connectat = 539;
469pub const SYS_chflagsat = 540;
470pub const SYS_accept4 = 541;
471pub const SYS_pipe2 = 542;
472pub const SYS_aio_mlock = 543;
473pub const SYS_procctl = 544;
474pub const SYS_ppoll = 545;
475pub const SYS_futimens = 546;
476pub const SYS_utimensat = 547;
477// 548 is obsolete numa_getaffinity
478// 549 is obsolete numa_setaffinity
479pub const SYS_fdatasync = 550;
480pub const SYS_fstat = 551;
481pub const SYS_fstatat = 552;
482pub const SYS_fhstat = 553;
483pub const SYS_getdirentries = 554;
484pub const SYS_statfs = 555;
485pub const SYS_fstatfs = 556;
486pub const SYS_getfsstat = 557;
487pub const SYS_fhstatfs = 558;
488pub const SYS_mknodat = 559;
489pub const SYS_kevent = 560;
490pub const SYS_cpuset_getdomain = 561;
491pub const SYS_cpuset_setdomain = 562;
492pub const SYS_getrandom = 563;
493pub const SYS_MAXSYSCALL = 564;
std/os/freebsd/x86_64.zig-474
......@@ -2,481 +2,7 @@ const freebsd = @import("index.zig");
22const socklen_t = freebsd.socklen_t;
33const iovec = freebsd.iovec;
44
5pub const SYS_syscall = 0;
6pub const SYS_exit = 1;
7pub const SYS_fork = 2;
8pub const SYS_read = 3;
9pub const SYS_write = 4;
10pub const SYS_open = 5;
11pub const SYS_close = 6;
12pub const SYS_wait4 = 7;
13// 8 is old creat
14pub const SYS_link = 9;
15pub const SYS_unlink = 10;
16// 11 is obsolete execv
17pub const SYS_chdir = 12;
18pub const SYS_fchdir = 13;
19pub const SYS_freebsd11_mknod = 14;
20pub const SYS_chmod = 15;
21pub const SYS_chown = 16;
22pub const SYS_break = 17;
23// 18 is freebsd4 getfsstat
24// 19 is old lseek
25pub const SYS_getpid = 20;
26pub const SYS_mount = 21;
27pub const SYS_unmount = 22;
28pub const SYS_setuid = 23;
29pub const SYS_getuid = 24;
30pub const SYS_geteuid = 25;
31pub const SYS_ptrace = 26;
32pub const SYS_recvmsg = 27;
33pub const SYS_sendmsg = 28;
34pub const SYS_recvfrom = 29;
35pub const SYS_accept = 30;
36pub const SYS_getpeername = 31;
37pub const SYS_getsockname = 32;
38pub const SYS_access = 33;
39pub const SYS_chflags = 34;
40pub const SYS_fchflags = 35;
41pub const SYS_sync = 36;
42pub const SYS_kill = 37;
43// 38 is old stat
44pub const SYS_getppid = 39;
45// 40 is old lstat
46pub const SYS_dup = 41;
47pub const SYS_freebsd10_pipe = 42;
48pub const SYS_getegid = 43;
49pub const SYS_profil = 44;
50pub const SYS_ktrace = 45;
51// 46 is old sigaction
52pub const SYS_getgid = 47;
53// 48 is old sigprocmask
54pub const SYS_getlogin = 49;
55pub const SYS_setlogin = 50;
56pub const SYS_acct = 51;
57// 52 is old sigpending
58pub const SYS_sigaltstack = 53;
59pub const SYS_ioctl = 54;
60pub const SYS_reboot = 55;
61pub const SYS_revoke = 56;
62pub const SYS_symlink = 57;
63pub const SYS_readlink = 58;
64pub const SYS_execve = 59;
65pub const SYS_umask = 60;
66pub const SYS_chroot = 61;
67// 62 is old fstat
68// 63 is old getkerninfo
69// 64 is old getpagesize
70pub const SYS_msync = 65;
71pub const SYS_vfork = 66;
72// 67 is obsolete vread
73// 68 is obsolete vwrite
745pub const SYS_sbrk = 69;
75pub const SYS_sstk = 70;
76// 71 is old mmap
77pub const SYS_vadvise = 72;
78pub const SYS_munmap = 73;
79pub const SYS_mprotect = 74;
80pub const SYS_madvise = 75;
81// 76 is obsolete vhangup
82// 77 is obsolete vlimit
83pub const SYS_mincore = 78;
84pub const SYS_getgroups = 79;
85pub const SYS_setgroups = 80;
86pub const SYS_getpgrp = 81;
87pub const SYS_setpgid = 82;
88pub const SYS_setitimer = 83;
89// 84 is old wait
90pub const SYS_swapon = 85;
91pub const SYS_getitimer = 86;
92// 87 is old gethostname
93// 88 is old sethostname
94pub const SYS_getdtablesize = 89;
95pub const SYS_dup2 = 90;
96pub const SYS_fcntl = 92;
97pub const SYS_select = 93;
98pub const SYS_fsync = 95;
99pub const SYS_setpriority = 96;
100pub const SYS_socket = 97;
101pub const SYS_connect = 98;
102// 99 is old accept
103pub const SYS_getpriority = 100;
104// 101 is old send
105// 102 is old recv
106// 103 is old sigreturn
107pub const SYS_bind = 104;
108pub const SYS_setsockopt = 105;
109pub const SYS_listen = 106;
110// 107 is obsolete vtimes
111// 108 is old sigvec
112// 109 is old sigblock
113// 110 is old sigsetmask
114// 111 is old sigsuspend
115// 112 is old sigstack
116// 113 is old recvmsg
117// 114 is old sendmsg
118// 115 is obsolete vtrace
119pub const SYS_gettimeofday = 116;
120pub const SYS_getrusage = 117;
121pub const SYS_getsockopt = 118;
122pub const SYS_readv = 120;
123pub const SYS_writev = 121;
124pub const SYS_settimeofday = 122;
125pub const SYS_fchown = 123;
126pub const SYS_fchmod = 124;
127// 125 is old recvfrom
128pub const SYS_setreuid = 126;
129pub const SYS_setregid = 127;
130pub const SYS_rename = 128;
131// 129 is old truncate
132// 130 is old ftruncate
133pub const SYS_flock = 131;
134pub const SYS_mkfifo = 132;
135pub const SYS_sendto = 133;
136pub const SYS_shutdown = 134;
137pub const SYS_socketpair = 135;
138pub const SYS_mkdir = 136;
139pub const SYS_rmdir = 137;
140pub const SYS_utimes = 138;
141// 139 is obsolete 4.2 sigreturn
142pub const SYS_adjtime = 140;
143// 141 is old getpeername
144// 142 is old gethostid
145// 143 is old sethostid
146// 144 is old getrlimit
147// 145 is old setrlimit
148// 146 is old killpg
149pub const SYS_setsid = 147;
150pub const SYS_quotactl = 148;
151// 149 is old quota
152// 150 is old getsockname
153pub const SYS_nlm_syscall = 154;
154pub const SYS_nfssvc = 155;
155// 156 is old getdirentries
156// 157 is freebsd4 statfs
157// 158 is freebsd4 fstatfs
158pub const SYS_lgetfh = 160;
159pub const SYS_getfh = 161;
160// 162 is freebsd4 getdomainname
161// 163 is freebsd4 setdomainname
162// 164 is freebsd4 uname
163pub const SYS_sysarch = 165;
164pub const SYS_rtprio = 166;
165pub const SYS_semsys = 169;
166pub const SYS_msgsys = 170;
167pub const SYS_shmsys = 171;
168// 173 is freebsd6 pread
169// 174 is freebsd6 pwrite
170pub const SYS_setfib = 175;
171pub const SYS_ntp_adjtime = 176;
172pub const SYS_setgid = 181;
173pub const SYS_setegid = 182;
174pub const SYS_seteuid = 183;
175pub const SYS_freebsd11_stat = 188;
176pub const SYS_freebsd11_fstat = 189;
177pub const SYS_freebsd11_lstat = 190;
178pub const SYS_pathconf = 191;
179pub const SYS_fpathconf = 192;
180pub const SYS_getrlimit = 194;
181pub const SYS_setrlimit = 195;
182pub const SYS_freebsd11_getdirentries = 196;
183// 197 is freebsd6 mmap
184pub const SYS___syscall = 198;
185// 199 is freebsd6 lseek
186// 200 is freebsd6 truncate
187// 201 is freebsd6 ftruncate
188pub const SYS___sysctl = 202;
189pub const SYS_mlock = 203;
190pub const SYS_munlock = 204;
191pub const SYS_undelete = 205;
192pub const SYS_futimes = 206;
193pub const SYS_getpgid = 207;
194pub const SYS_poll = 209;
195pub const SYS_freebsd7___semctl = 220;
196pub const SYS_semget = 221;
197pub const SYS_semop = 222;
198pub const SYS_freebsd7_msgctl = 224;
199pub const SYS_msgget = 225;
200pub const SYS_msgsnd = 226;
201pub const SYS_msgrcv = 227;
202pub const SYS_shmat = 228;
203pub const SYS_freebsd7_shmctl = 229;
204pub const SYS_shmdt = 230;
205pub const SYS_shmget = 231;
206pub const SYS_clock_gettime = 232;
207pub const SYS_clock_settime = 233;
208pub const SYS_clock_getres = 234;
209pub const SYS_ktimer_create = 235;
210pub const SYS_ktimer_delete = 236;
211pub const SYS_ktimer_settime = 237;
212pub const SYS_ktimer_gettime = 238;
213pub const SYS_ktimer_getoverrun = 239;
214pub const SYS_nanosleep = 240;
215pub const SYS_ffclock_getcounter = 241;
216pub const SYS_ffclock_setestimate = 242;
217pub const SYS_ffclock_getestimate = 243;
218pub const SYS_clock_nanosleep = 244;
219pub const SYS_clock_getcpuclockid2 = 247;
220pub const SYS_ntp_gettime = 248;
221pub const SYS_minherit = 250;
222pub const SYS_rfork = 251;
223// 252 is obsolete openbsd_poll
224pub const SYS_issetugid = 253;
225pub const SYS_lchown = 254;
226pub const SYS_aio_read = 255;
227pub const SYS_aio_write = 256;
228pub const SYS_lio_listio = 257;
229pub const SYS_freebsd11_getdents = 272;
230pub const SYS_lchmod = 274;
231pub const SYS_netbsd_lchown = 275;
232pub const SYS_lutimes = 276;
233pub const SYS_netbsd_msync = 277;
234pub const SYS_freebsd11_nstat = 278;
235pub const SYS_freebsd11_nfstat = 279;
236pub const SYS_freebsd11_nlstat = 280;
237pub const SYS_preadv = 289;
238pub const SYS_pwritev = 290;
239// 297 is freebsd4 fhstatfs
240pub const SYS_fhopen = 298;
241pub const SYS_freebsd11_fhstat = 299;
242pub const SYS_modnext = 300;
243pub const SYS_modstat = 301;
244pub const SYS_modfnext = 302;
245pub const SYS_modfind = 303;
246pub const SYS_kldload = 304;
247pub const SYS_kldunload = 305;
248pub const SYS_kldfind = 306;
249pub const SYS_kldnext = 307;
250pub const SYS_kldstat = 308;
251pub const SYS_kldfirstmod = 309;
252pub const SYS_getsid = 310;
253pub const SYS_setresuid = 311;
254pub const SYS_setresgid = 312;
255// 313 is obsolete signanosleep
256pub const SYS_aio_return = 314;
257pub const SYS_aio_suspend = 315;
258pub const SYS_aio_cancel = 316;
259pub const SYS_aio_error = 317;
260// 318 is freebsd6 aio_read
261// 319 is freebsd6 aio_write
262// 320 is freebsd6 lio_listio
263pub const SYS_yield = 321;
264// 322 is obsolete thr_sleep
265// 323 is obsolete thr_wakeup
266pub const SYS_mlockall = 324;
267pub const SYS_munlockall = 325;
268pub const SYS___getcwd = 326;
269pub const SYS_sched_setparam = 327;
270pub const SYS_sched_getparam = 328;
271pub const SYS_sched_setscheduler = 329;
272pub const SYS_sched_getscheduler = 330;
273pub const SYS_sched_yield = 331;
274pub const SYS_sched_get_priority_max = 332;
275pub const SYS_sched_get_priority_min = 333;
276pub const SYS_sched_rr_get_interval = 334;
277pub const SYS_utrace = 335;
278// 336 is freebsd4 sendfile
279pub const SYS_kldsym = 337;
280pub const SYS_jail = 338;
281pub const SYS_nnpfs_syscall = 339;
282pub const SYS_sigprocmask = 340;
283pub const SYS_sigsuspend = 341;
284// 342 is freebsd4 sigaction
285pub const SYS_sigpending = 343;
286// 344 is freebsd4 sigreturn
287pub const SYS_sigtimedwait = 345;
288pub const SYS_sigwaitinfo = 346;
289pub const SYS___acl_get_file = 347;
290pub const SYS___acl_set_file = 348;
291pub const SYS___acl_get_fd = 349;
292pub const SYS___acl_set_fd = 350;
293pub const SYS___acl_delete_file = 351;
294pub const SYS___acl_delete_fd = 352;
295pub const SYS___acl_aclcheck_file = 353;
296pub const SYS___acl_aclcheck_fd = 354;
297pub const SYS_extattrctl = 355;
298pub const SYS_extattr_set_file = 356;
299pub const SYS_extattr_get_file = 357;
300pub const SYS_extattr_delete_file = 358;
301pub const SYS_aio_waitcomplete = 359;
302pub const SYS_getresuid = 360;
303pub const SYS_getresgid = 361;
304pub const SYS_kqueue = 362;
305pub const SYS_freebsd11_kevent = 363;
306pub const SYS_extattr_set_fd = 371;
307pub const SYS_extattr_get_fd = 372;
308pub const SYS_extattr_delete_fd = 373;
309pub const SYS___setugid = 374;
310pub const SYS_eaccess = 376;
311pub const SYS_afs3_syscall = 377;
312pub const SYS_nmount = 378;
313pub const SYS___mac_get_proc = 384;
314pub const SYS___mac_set_proc = 385;
315pub const SYS___mac_get_fd = 386;
316pub const SYS___mac_get_file = 387;
317pub const SYS___mac_set_fd = 388;
318pub const SYS___mac_set_file = 389;
319pub const SYS_kenv = 390;
320pub const SYS_lchflags = 391;
321pub const SYS_uuidgen = 392;
322pub const SYS_sendfile = 393;
323pub const SYS_mac_syscall = 394;
324pub const SYS_freebsd11_getfsstat = 395;
325pub const SYS_freebsd11_statfs = 396;
326pub const SYS_freebsd11_fstatfs = 397;
327pub const SYS_freebsd11_fhstatfs = 398;
328pub const SYS_ksem_close = 400;
329pub const SYS_ksem_post = 401;
330pub const SYS_ksem_wait = 402;
331pub const SYS_ksem_trywait = 403;
332pub const SYS_ksem_init = 404;
333pub const SYS_ksem_open = 405;
334pub const SYS_ksem_unlink = 406;
335pub const SYS_ksem_getvalue = 407;
336pub const SYS_ksem_destroy = 408;
337pub const SYS___mac_get_pid = 409;
338pub const SYS___mac_get_link = 410;
339pub const SYS___mac_set_link = 411;
340pub const SYS_extattr_set_link = 412;
341pub const SYS_extattr_get_link = 413;
342pub const SYS_extattr_delete_link = 414;
343pub const SYS___mac_execve = 415;
344pub const SYS_sigaction = 416;
345pub const SYS_sigreturn = 417;
346pub const SYS_getcontext = 421;
347pub const SYS_setcontext = 422;
348pub const SYS_swapcontext = 423;
349pub const SYS_swapoff = 424;
350pub const SYS___acl_get_link = 425;
351pub const SYS___acl_set_link = 426;
352pub const SYS___acl_delete_link = 427;
353pub const SYS___acl_aclcheck_link = 428;
354pub const SYS_sigwait = 429;
355pub const SYS_thr_create = 430;
356pub const SYS_thr_exit = 431;
357pub const SYS_thr_self = 432;
358pub const SYS_thr_kill = 433;
359pub const SYS_jail_attach = 436;
360pub const SYS_extattr_list_fd = 437;
361pub const SYS_extattr_list_file = 438;
362pub const SYS_extattr_list_link = 439;
363pub const SYS_ksem_timedwait = 441;
364pub const SYS_thr_suspend = 442;
365pub const SYS_thr_wake = 443;
366pub const SYS_kldunloadf = 444;
367pub const SYS_audit = 445;
368pub const SYS_auditon = 446;
369pub const SYS_getauid = 447;
370pub const SYS_setauid = 448;
371pub const SYS_getaudit = 449;
372pub const SYS_setaudit = 450;
373pub const SYS_getaudit_addr = 451;
374pub const SYS_setaudit_addr = 452;
375pub const SYS_auditctl = 453;
376pub const SYS__umtx_op = 454;
377pub const SYS_thr_new = 455;
378pub const SYS_sigqueue = 456;
379pub const SYS_kmq_open = 457;
380pub const SYS_kmq_setattr = 458;
381pub const SYS_kmq_timedreceive = 459;
382pub const SYS_kmq_timedsend = 460;
383pub const SYS_kmq_notify = 461;
384pub const SYS_kmq_unlink = 462;
385pub const SYS_abort2 = 463;
386pub const SYS_thr_set_name = 464;
387pub const SYS_aio_fsync = 465;
388pub const SYS_rtprio_thread = 466;
389pub const SYS_sctp_peeloff = 471;
390pub const SYS_sctp_generic_sendmsg = 472;
391pub const SYS_sctp_generic_sendmsg_iov = 473;
392pub const SYS_sctp_generic_recvmsg = 474;
393pub const SYS_pread = 475;
394pub const SYS_pwrite = 476;
395pub const SYS_mmap = 477;
396pub const SYS_lseek = 478;
397pub const SYS_truncate = 479;
398pub const SYS_ftruncate = 480;
399pub const SYS_thr_kill2 = 481;
400pub const SYS_shm_open = 482;
401pub const SYS_shm_unlink = 483;
402pub const SYS_cpuset = 484;
403pub const SYS_cpuset_setid = 485;
404pub const SYS_cpuset_getid = 486;
405pub const SYS_cpuset_getaffinity = 487;
406pub const SYS_cpuset_setaffinity = 488;
407pub const SYS_faccessat = 489;
408pub const SYS_fchmodat = 490;
409pub const SYS_fchownat = 491;
410pub const SYS_fexecve = 492;
411pub const SYS_freebsd11_fstatat = 493;
412pub const SYS_futimesat = 494;
413pub const SYS_linkat = 495;
414pub const SYS_mkdirat = 496;
415pub const SYS_mkfifoat = 497;
416pub const SYS_freebsd11_mknodat = 498;
417pub const SYS_openat = 499;
418pub const SYS_readlinkat = 500;
419pub const SYS_renameat = 501;
420pub const SYS_symlinkat = 502;
421pub const SYS_unlinkat = 503;
422pub const SYS_posix_openpt = 504;
423pub const SYS_gssd_syscall = 505;
424pub const SYS_jail_get = 506;
425pub const SYS_jail_set = 507;
426pub const SYS_jail_remove = 508;
427pub const SYS_closefrom = 509;
428pub const SYS___semctl = 510;
429pub const SYS_msgctl = 511;
430pub const SYS_shmctl = 512;
431pub const SYS_lpathconf = 513;
432// 514 is obsolete cap_new
433pub const SYS___cap_rights_get = 515;
434pub const SYS_cap_enter = 516;
435pub const SYS_cap_getmode = 517;
436pub const SYS_pdfork = 518;
437pub const SYS_pdkill = 519;
438pub const SYS_pdgetpid = 520;
439pub const SYS_pselect = 522;
440pub const SYS_getloginclass = 523;
441pub const SYS_setloginclass = 524;
442pub const SYS_rctl_get_racct = 525;
443pub const SYS_rctl_get_rules = 526;
444pub const SYS_rctl_get_limits = 527;
445pub const SYS_rctl_add_rule = 528;
446pub const SYS_rctl_remove_rule = 529;
447pub const SYS_posix_fallocate = 530;
448pub const SYS_posix_fadvise = 531;
449pub const SYS_wait6 = 532;
450pub const SYS_cap_rights_limit = 533;
451pub const SYS_cap_ioctls_limit = 534;
452pub const SYS_cap_ioctls_get = 535;
453pub const SYS_cap_fcntls_limit = 536;
454pub const SYS_cap_fcntls_get = 537;
455pub const SYS_bindat = 538;
456pub const SYS_connectat = 539;
457pub const SYS_chflagsat = 540;
458pub const SYS_accept4 = 541;
459pub const SYS_pipe2 = 542;
460pub const SYS_aio_mlock = 543;
461pub const SYS_procctl = 544;
462pub const SYS_ppoll = 545;
463pub const SYS_futimens = 546;
464pub const SYS_utimensat = 547;
465pub const SYS_numa_getaffinity = 548;
466pub const SYS_numa_setaffinity = 549;
467pub const SYS_fdatasync = 550;
468pub const SYS_fstat = 551;
469pub const SYS_fstatat = 552;
470pub const SYS_fhstat = 553;
471pub const SYS_getdirentries = 554;
472pub const SYS_statfs = 555;
473pub const SYS_fstatfs = 556;
474pub const SYS_getfsstat = 557;
475pub const SYS_fhstatfs = 558;
476pub const SYS_mknodat = 559;
477pub const SYS_kevent = 560;
478pub const SYS_MAXSYSCALL = 561;
479pub const SYS_getrandom = 563;
4806
4817pub const O_CREAT = 0o100;
4828pub const O_EXCL = 0o200;