diff --git a/Makefile b/Makefile
index 0588a571..e26ef97d 100644
--- a/Makefile
+++ b/Makefile
@@ -61,7 +61,7 @@
# build/config.mk
SHELL = /bin/sh
-HOSTS ?= freebsd openbsd alpine
+HOSTS ?= freebsd openbsd rhel7 rhel5 xnu win10
SANITY := $(shell build/sanitycheck $$PPID)
GNUMAKEFLAGS += --output-sync
diff --git a/build/bootstrap/ar.com b/build/bootstrap/ar.com
index 1fb0cca7..c83de357 100755
Binary files a/build/bootstrap/ar.com and b/build/bootstrap/ar.com differ
diff --git a/build/bootstrap/mkdeps.com b/build/bootstrap/mkdeps.com
index 94651402..43a322ae 100755
Binary files a/build/bootstrap/mkdeps.com and b/build/bootstrap/mkdeps.com differ
diff --git a/build/bootstrap/package.com b/build/bootstrap/package.com
index bf8771aa..9f1ed4ca 100755
Binary files a/build/bootstrap/package.com and b/build/bootstrap/package.com differ
diff --git a/build/bootstrap/zipobj.com b/build/bootstrap/zipobj.com
index 954167aa..ca951ab2 100755
Binary files a/build/bootstrap/zipobj.com and b/build/bootstrap/zipobj.com differ
diff --git a/build/definitions.mk b/build/definitions.mk
index 5430b644..68da4bf7 100644
--- a/build/definitions.mk
+++ b/build/definitions.mk
@@ -153,6 +153,7 @@ MATHEMATICAL = \
DEFAULT_CPPFLAGS = \
-DIMAGE_BASE_VIRTUAL=$(IMAGE_BASE_VIRTUAL) \
-nostdinc \
+ -iquote - \
-iquote .
DEFAULT_CFLAGS = \
diff --git a/build/rle.py b/build/rle.py
index 5c484886..cb8e0713 100644
--- a/build/rle.py
+++ b/build/rle.py
@@ -1,3 +1,6 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
# OVERVIEW
#
# Run Length Decoder Scratch Pad
diff --git a/examples/bigmem.c b/examples/bigmem.c
deleted file mode 100644
index c311ab3b..00000000
--- a/examples/bigmem.c
+++ /dev/null
@@ -1,102 +0,0 @@
-#if 0
-/*─────────────────────────────────────────────────────────────────╗
-│ To the extent possible under law, Justine Tunney has waived │
-│ all copyright and related or neighboring rights to this file, │
-│ as it is written in the following disclaimers: │
-│ • http://unlicense.org/ │
-│ • http://creativecommons.org/publicdomain/zero/1.0/ │
-╚─────────────────────────────────────────────────────────────────*/
-#endif
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/copyfile.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/calls/struct/stat.h"
-#include "libc/log/check.h"
-#include "libc/macros.h"
-#include "libc/runtime/gc.h"
-#include "libc/runtime/runtime.h"
-#include "libc/stdio/stdio.h"
-#include "libc/str/str.h"
-#include "libc/sysv/consts/auxv.h"
-#include "libc/sysv/consts/clock.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/sysv/consts/madv.h"
-#include "libc/sysv/consts/map.h"
-#include "libc/sysv/consts/o.h"
-#include "libc/sysv/consts/prot.h"
-#include "libc/time/time.h"
-#include "libc/x/x.h"
-
-/**
- * @fileoverview Overcommit tutorial.
- * You can allocate memory like a central banker prints money.
- */
-
-/* #define kHugeAmount (10LU * 1024LU * 1024LU * 1024LU * 1024LU) */
-#define kHugeAmount (1LU * 1024LU * 1024LU * 1024LU)
-
-int copyfile2(const char *frompath, const char *topath, bool dontoverwrite) {
- struct stat st;
- ssize_t transferred;
- int rc, fromfd, tofd;
- int64_t inoffset, outoffset;
- rc = -1;
- if ((fromfd = open(frompath, O_RDONLY | O_DIRECT, 0)) != -1) {
- if (fstat(fromfd, &st) != -1 &&
- (tofd =
- open(topath,
- O_WRONLY | O_CREAT | O_DIRECT | (dontoverwrite ? O_EXCL : 0),
- st.st_mode & 0777)) != -1) {
- inoffset = 0;
- outoffset = 0;
- while (st.st_size &&
- (transferred = copy_file_range(fromfd, &inoffset, tofd, &outoffset,
- st.st_size, 0)) != -1) {
- st.st_size -= transferred;
- }
- if (!st.st_size) rc = 0;
- rc |= close(tofd);
- }
- rc |= close(fromfd);
- }
- return rc;
-}
-
-int main(int argc, char *argv[]) {
- int fd, pid;
- size_t size;
- long double t1, t2;
- const char *core, *core2, *core3;
- volatile unsigned char *mem;
- size = ROUNDUP(kHugeAmount, PAGESIZE);
- core = gc(xasprintf("%s.%s", getauxval(AT_EXECFN), "core"));
- core2 = gc(xasprintf("%s.%s", getauxval(AT_EXECFN), "core2"));
- core3 = gc(xasprintf("%s.%s", getauxval(AT_EXECFN), "core3"));
- CHECK_NE(-1, (fd = open(core, O_RDWR | O_CREAT | O_TRUNC | O_CLOEXEC, 0600)));
- CHECK_NE(-1, ftruncate(fd, size));
- CHECK_NE(MAP_FAILED,
- (mem = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)));
- strcpy(&mem[0], "hello\n\n\n\n\n\n\n\n\n\n");
- strcpy(&mem[kHugeAmount / 2], "hello\n\n\n\n\n\n\n\n\n\n");
- CHECK_NE(-1, munmap(mem, size));
- CHECK_NE(-1,
- (pid = spawnve(
- 0, (int[3]){STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO},
- "o/examples/stat.com",
- (char *const[]){"o/examples/stat.com", core, NULL}, environ)));
- CHECK_NE(-1, waitpid(pid, NULL, 0));
- CHECK_NE(-1, close(fd));
-
- t1 = dtime(CLOCK_REALTIME);
- CHECK_NE(-1, copyfile(core, core2, 0));
- t2 = dtime(CLOCK_REALTIME);
- printf("%.6Lf\n", t2 - t1);
-
- t1 = dtime(CLOCK_REALTIME);
- CHECK_NE(-1, copyfile2(core, core3, false));
- t2 = dtime(CLOCK_REALTIME);
- printf("%.6Lf\n", t2 - t1);
-
- /* CHECK_NE(-1, unlink(core)); */
- return 0;
-}
diff --git a/examples/crashreport.c b/examples/crashreport.c
index dc39c2b1..2c837214 100644
--- a/examples/crashreport.c
+++ b/examples/crashreport.c
@@ -8,6 +8,7 @@
╚─────────────────────────────────────────────────────────────────*/
#endif
#include "libc/bits/pushpop.h"
+#include "libc/calls/calls.h"
#include "libc/calls/ucontext.h"
#include "libc/log/log.h"
#include "libc/math.h"
@@ -42,48 +43,52 @@ int main(int argc, char *argv[]) {
showcrashreports();
res = 0;
- asm volatile(
- "mov\t$0x1111111111111111,%rax\n\t"
- "mov\t$0x3333333333333333,%rcx\n\t"
- "mov\t$0x4444444444444444,%rdx\n\t"
- "mov\t$0x8888888888888888,%r8\n\t"
- "mov\t$0x9999999999999999,%r9d\n\t"
- "mov\t$0xaaaaaaaaaaaaaaaa,%r10d\n\t"
- "mov\t$0xbbbbbbbbbbbbbbbb,%r11d\n\t"
- "mov\t$0x0000000000000000,%rax\n\t"
- "movd\t%rax,%xmm0\n\t"
- "mov\t$0x1111111111111111,%rax\n\t"
- "movd\t%rax,%xmm1\n\t"
- "mov\t$0x2222222222222222,%rax\n\t"
- "movd\t%rax,%xmm2\n\t"
- "mov\t$0x3333333333333333,%rax\n\t"
- "movd\t%rax,%xmm3\n\t"
- "mov\t$0x4444444444444444,%rax\n\t"
- "movd\t%rax,%xmm4\n\t"
- "mov\t$0x5555555555555555,%rax\n\t"
- "movd\t%rax,%xmm5\n\t"
- "mov\t$0x6666666666666666,%rax\n\t"
- "movd\t%rax,%xmm6\n\t"
- "mov\t$0x7777777777777777,%rax\n\t"
- "movd\t%rax,%xmm7\n\t"
- "mov\t$0x8888888888888888,%rax\n\t"
- "movd\t%rax,%xmm8\n\t"
- "mov\t$0x9999999999999999,%rax\n\t"
- "movd\t%rax,%xmm9\n\t"
- "mov\t$0xaaaaaaaaaaaaaaaa,%rax\n\t"
- "movd\t%rax,%xmm10\n\t"
- "mov\t$0xbbbbbbbbbbbbbbbb,%rax\n\t"
- "movd\t%rax,%xmm11\n\t"
- "mov\t$0xcccccccccccccccc,%rax\n\t"
- "movd\t%rax,%xmm12\n\t"
- "mov\t$0xdddddddddddddddd,%rax\n\t"
- "movd\t%rax,%xmm13\n\t"
- "mov\t$0xeeeeeeeeeeeeeeee,%rax\n\t"
- "movd\t%rax,%xmm14\n\t"
- "mov\t$0xffffffffffffffff,%rax\n\t"
- "movd\t%rax,%xmm15\n\t"
- "fldlg2\n\t");
+ asm volatile("mov\t$0x1111111111111111,%rax\n\t"
+ "mov\t$0x3333333333333333,%rcx\n\t"
+ "mov\t$0x4444444444444444,%rdx\n\t"
+ "mov\t$0x8888888888888888,%r8\n\t"
+ "mov\t$0x9999999999999999,%r9d\n\t"
+ "mov\t$0xaaaaaaaaaaaaaaaa,%r10d\n\t"
+ "mov\t$0xbbbbbbbbbbbbbbbb,%r11d\n\t"
+ "mov\t$0x0000000000000000,%rax\n\t"
+ "movd\t%rax,%xmm0\n\t"
+ "mov\t$0x1111111111111111,%rax\n\t"
+ "push\t%rax\n\t"
+ "push\t%rax\n\t"
+ "movdqu\t(%rsp),%xmm1\n\t"
+ "pop\t%rax\n\t"
+ "pop\t%rax\n\t"
+ "mov\t$0x2222222222220022,%rax\n\t"
+ "movd\t%rax,%xmm2\n\t"
+ "mov\t$0x3333333333333333,%rax\n\t"
+ "movd\t%rax,%xmm3\n\t"
+ "mov\t$0x4444444444444444,%rax\n\t"
+ "movd\t%rax,%xmm4\n\t"
+ "mov\t$0x5555555555555555,%rax\n\t"
+ "movd\t%rax,%xmm5\n\t"
+ "mov\t$0x6666666666666666,%rax\n\t"
+ "movd\t%rax,%xmm6\n\t"
+ "mov\t$0x7777777777777777,%rax\n\t"
+ "movd\t%rax,%xmm7\n\t"
+ "mov\t$0x8888888888888888,%rax\n\t"
+ "movd\t%rax,%xmm8\n\t"
+ "mov\t$0x9999999999999999,%rax\n\t"
+ "movd\t%rax,%xmm9\n\t"
+ "mov\t$0xaaaaaaaaaaaaaaaa,%rax\n\t"
+ "movd\t%rax,%xmm10\n\t"
+ "mov\t$0xbbbbbbbbbbbbbbbb,%rax\n\t"
+ "movd\t%rax,%xmm11\n\t"
+ "mov\t$0xcccccccccccccccc,%rax\n\t"
+ "movd\t%rax,%xmm12\n\t"
+ "mov\t$0xdddddddddddddddd,%rax\n\t"
+ "movd\t%rax,%xmm13\n\t"
+ "mov\t$0xeeeeeeeeeeeeeeee,%rax\n\t"
+ "movd\t%rax,%xmm14\n\t"
+ "mov\t$0xffffffffffffffff,%rax\n\t"
+ "movd\t%rax,%xmm15\n\t"
+ "fldpi\n\t");
res = *(int *)(intptr_t)boo / boo;
+
return res;
}
diff --git a/examples/echo.c b/examples/echo.c
new file mode 100644
index 00000000..b1f75777
--- /dev/null
+++ b/examples/echo.c
@@ -0,0 +1,29 @@
+#if 0
+/*─────────────────────────────────────────────────────────────────╗
+│ To the extent possible under law, Justine Tunney has waived │
+│ all copyright and related or neighboring rights to this file, │
+│ as it is written in the following disclaimers: │
+│ • http://unlicense.org/ │
+│ • http://creativecommons.org/publicdomain/zero/1.0/ │
+╚─────────────────────────────────────────────────────────────────*/
+#endif
+#include "libc/stdio/stdio.h"
+#include "libc/str/str.h"
+
+int main(int argc, char *argv[]) {
+ int i, j;
+ bool wantnewline;
+ if (argc > 1 && !strcmp(argv[1], "-n")) {
+ i = 2;
+ wantnewline = false;
+ } else {
+ i = 1;
+ wantnewline = true;
+ }
+ for (j = 0; i + j < argc; ++j) {
+ if (j) fputc(' ', stdout);
+ fputs(argv[i + j], stdout);
+ }
+ if (wantnewline) fputc('\n', stdout);
+ return 0;
+}
diff --git a/examples/exec.c b/examples/exec.c
new file mode 100644
index 00000000..4ec8d952
--- /dev/null
+++ b/examples/exec.c
@@ -0,0 +1,17 @@
+#if 0
+/*─────────────────────────────────────────────────────────────────╗
+│ To the extent possible under law, Justine Tunney has waived │
+│ all copyright and related or neighboring rights to this file, │
+│ as it is written in the following disclaimers: │
+│ • http://unlicense.org/ │
+│ • http://creativecommons.org/publicdomain/zero/1.0/ │
+╚─────────────────────────────────────────────────────────────────*/
+#endif
+#include "libc/calls/calls.h"
+#include "libc/runtime/runtime.h"
+
+int main(int argc, char *argv[]) {
+ if (argc < 2) return 1;
+ execv(argv[1], argv + 1);
+ abort();
+}
diff --git a/examples/fork.c b/examples/fork.c
new file mode 100644
index 00000000..4208e1f8
--- /dev/null
+++ b/examples/fork.c
@@ -0,0 +1,18 @@
+#if 0
+/*─────────────────────────────────────────────────────────────────╗
+│ To the extent possible under law, Justine Tunney has waived │
+│ all copyright and related or neighboring rights to this file, │
+│ as it is written in the following disclaimers: │
+│ • http://unlicense.org/ │
+│ • http://creativecommons.org/publicdomain/zero/1.0/ │
+╚─────────────────────────────────────────────────────────────────*/
+#endif
+#include "libc/calls/calls.h"
+#include "libc/stdio/stdio.h"
+
+int main(int argc, char *argv[]) {
+ int pid;
+ pid = fork();
+ fprintf(stderr, "fork returned %d\n", pid);
+ return 0;
+}
diff --git a/examples/hostname.c b/examples/hostname.c
new file mode 100644
index 00000000..998a08cc
--- /dev/null
+++ b/examples/hostname.c
@@ -0,0 +1,19 @@
+#if 0
+/*─────────────────────────────────────────────────────────────────╗
+│ To the extent possible under law, Justine Tunney has waived │
+│ all copyright and related or neighboring rights to this file, │
+│ as it is written in the following disclaimers: │
+│ • http://unlicense.org/ │
+│ • http://creativecommons.org/publicdomain/zero/1.0/ │
+╚─────────────────────────────────────────────────────────────────*/
+#endif
+#include "libc/calls/calls.h"
+#include "libc/log/check.h"
+#include "libc/stdio/stdio.h"
+
+int main(int argc, char *argv[]) {
+ char hostname[254];
+ CHECK_NE(-1, gethostname(hostname, sizeof(hostname)));
+ puts(hostname);
+ return 0;
+}
diff --git a/examples/nesemu1.cc b/examples/nesemu1.cc
index 31843283..6cc6a69f 100644
--- a/examples/nesemu1.cc
+++ b/examples/nesemu1.cc
@@ -15,7 +15,6 @@
#include "libc/bits/bits.h"
#include "libc/bits/safemacros.h"
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/calls/struct/itimerval.h"
#include "libc/calls/struct/winsize.h"
#include "libc/errno.h"
@@ -148,7 +147,6 @@ struct ZipGames {
static int frame_;
static int drain_;
static int playfd_;
-static int devnull_;
static int playpid_;
static bool exited_;
static bool timeout_;
@@ -308,21 +306,6 @@ void GetTermSize(void) {
WriteStringNow("\e[0m\e[H\e[J");
}
-bool TrySpeaker(const char* prog, char* const* args) {
- int rc;
- int fds[3];
- fds[0] = -1;
- fds[1] = devnull_;
- fds[2] = devnull_;
- if ((rc = spawnve(0, fds, prog, args, environ)) != -1) {
- playpid_ = rc;
- playfd_ = fds[0];
- return true;
- } else {
- return false;
- }
-}
-
void IoInit(void) {
GetTermSize();
xsigaction(SIGINT, (void*)OnCtrlC, 0, 0, NULL);
@@ -1700,6 +1683,8 @@ char* GetLine(void) {
int PlayGame(const char* romfile, const char* opt_tasfile) {
FILE* fp;
+ int devnull;
+ int pipefds[2];
inputfn_ = opt_tasfile;
if (!(fp = fopen(romfile, "rb"))) {
@@ -1716,13 +1701,23 @@ int PlayGame(const char* romfile, const char* opt_tasfile) {
// open speaker
// todo: this needs plenty of work
- devnull_ = open("/dev/null", O_WRONLY);
if ((ffplay_ = commandvenv("FFPLAY", "ffplay"))) {
- const char* args[] = {
- "ffplay", "-nodisp", "-loglevel", "quiet", "-fflags", "nobuffer", "-ac",
- "1", "-ar", "1789773", "-f", "s16le", "pipe:", NULL,
- };
- TrySpeaker(ffplay_, (char* const*)args);
+ devnull = open("/dev/null", O_WRONLY | O_CLOEXEC);
+ pipe2(pipefds, O_CLOEXEC);
+ if (!(playpid_ = vfork())) {
+ const char* const args[] = {
+ "ffplay", "-nodisp", "-loglevel", "quiet", "-fflags",
+ "nobuffer", "-ac", "1", "-ar", "1789773",
+ "-f", "s16le", "pipe:", NULL,
+ };
+ dup2(pipefds[0], 0);
+ dup2(devnull, 1);
+ dup2(devnull, 2);
+ execv(ffplay_, (char* const*)args);
+ abort();
+ }
+ close(pipefds[0]);
+ playfd_ = pipefds[1];
} else {
fputs("\nWARNING\n\
\n\
diff --git a/examples/rusage.c b/examples/rusage.c
index a466859a..47bd9deb 100644
--- a/examples/rusage.c
+++ b/examples/rusage.c
@@ -8,7 +8,6 @@
╚─────────────────────────────────────────────────────────────────*/
#endif
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/calls/struct/rusage.h"
#include "libc/log/check.h"
#include "libc/log/log.h"
@@ -23,26 +22,30 @@ void Show(const char *name, long measurement, const char *unit) {
fprintf(stderr, "%-*s%,*d %s\n", 32, name, 32, measurement, unit);
}
-long TvToUs(struct timeval tv) {
- return 1000000l * tv.tv_usec + tv.tv_sec;
+long TvToNs(struct timeval tv) {
+ return tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
}
int main(int argc, char *argv[]) {
- const char *exe;
int pid, wstatus;
long double ts1, ts2;
struct rusage rusage;
- char pathbuf[PATH_MAX];
+ if (argc < 2) {
+ fprintf(stderr, "Usage: %s PROG [ARGS...]\n", argv[0]);
+ return 1;
+ }
memset(&rusage, -1, sizeof(rusage));
CHECK_GT(argc, 1);
- CHECK_NOTNULL((exe = commandv(argv[1], pathbuf)));
ts1 = nowl();
- CHECK_NE(-1, (pid = spawnve(0, NULL, exe, &argv[1], environ)));
+ if (!(pid = vfork())) {
+ execvp(argv[1], argv + 1);
+ abort();
+ }
CHECK_NE(-1, wait4(pid, &wstatus, 0, &rusage));
ts2 = nowl();
Show("wall time", lroundl((ts2 - ts1) * 1e9l), "ns");
- Show("user time", TvToUs(rusage.ru_utime), "µs");
- Show("sys time", TvToUs(rusage.ru_stime), "µs");
+ Show("user time", TvToNs(rusage.ru_utime), "ns");
+ Show("sys time", TvToNs(rusage.ru_stime), "ns");
Show("maximum resident set size", rusage.ru_maxrss, "");
Show("integral shared memory size", rusage.ru_ixrss, "");
Show("integral unshared data size", rusage.ru_idrss, "");
@@ -57,5 +60,9 @@ int main(int argc, char *argv[]) {
Show("signals received", rusage.ru_nsignals, "");
Show("voluntary context switches", rusage.ru_nvcsw, "");
Show("involuntary context switches", rusage.ru_nivcsw, "");
- return WEXITSTATUS(wstatus);
+ if (WIFEXITED(wstatus)) {
+ return WEXITSTATUS(wstatus);
+ } else {
+ return 128 + WTERMSIG(wstatus);
+ }
}
diff --git a/examples/spawn.c b/examples/spawn.c
new file mode 100644
index 00000000..4669547d
--- /dev/null
+++ b/examples/spawn.c
@@ -0,0 +1,23 @@
+#if 0
+/*─────────────────────────────────────────────────────────────────╗
+│ To the extent possible under law, Justine Tunney has waived │
+│ all copyright and related or neighboring rights to this file, │
+│ as it is written in the following disclaimers: │
+│ • http://unlicense.org/ │
+│ • http://creativecommons.org/publicdomain/zero/1.0/ │
+╚─────────────────────────────────────────────────────────────────*/
+#endif
+#include "libc/calls/calls.h"
+#include "libc/runtime/runtime.h"
+
+int main(int argc, char *argv[]) {
+ int pid, wstatus;
+ if (argc < 2) return 1;
+ pid = fork();
+ if (!pid) {
+ execv(argv[1], argv + 1);
+ abort();
+ }
+ waitpid(pid, &wstatus, 0);
+ return WEXITSTATUS(wstatus);
+}
diff --git a/examples/subprocess.c b/examples/subprocess.c
deleted file mode 100644
index 7ad61210..00000000
--- a/examples/subprocess.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#if 0
-/*─────────────────────────────────────────────────────────────────╗
-│ To the extent possible under law, Justine Tunney has waived │
-│ all copyright and related or neighboring rights to this file, │
-│ as it is written in the following disclaimers: │
-│ • http://unlicense.org/ │
-│ • http://creativecommons.org/publicdomain/zero/1.0/ │
-╚─────────────────────────────────────────────────────────────────*/
-#endif
-#include "libc/alg/alg.h"
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/fmt/conv.h"
-#include "libc/limits.h"
-#include "libc/log/check.h"
-#include "libc/runtime/gc.h"
-#include "libc/stdio/stdio.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/x/x.h"
-
-const char kProgram[] = "o/default/examples/hello.com";
-
-int main(int argc, char *argv[]) {
- /**
- * Runs make if hello.com doesn't exist.
- *
- * 1. gc() automates calling free() on return.
- * 2. xasprintf("foo %s", "bar") is our version of "foo %s" % ("bar")
- * 3. Demonstrates correct escaping for bourne shell
- */
- if (!fileexists(kProgram)) {
- system(gc(xasprintf("%s '%s'", "make -j4",
- gc(replacestr(kProgram, "'", "'\"'\"'")))));
- }
-
- /**
- * Our version of subprocess.Popen
- * 1. Doesn't require fork() so pain-free on NT
- * 2. Google checks are like assert() but better
- */
- ssize_t transferred;
- int child, wstatus, procfds[3] = {STDIN_FILENO, -1, STDERR_FILENO};
- CHECK_NE(-1,
- (child = spawnve(0, procfds, /* run w/o shell */ kProgram,
- (char *const[]){/* argv[0] */ basename(kProgram),
- /* argv[1] */ "boop",
- /* sentinel */ NULL},
- environ)));
- printf("%s %s: ", kProgram, "says");
- fflush(stdout);
- for (;;) {
- transferred = copyfd(procfds[1], NULL, fileno(stdout), NULL, INT_MAX, 0);
- CHECK_NE(-1, transferred);
- if (!transferred) break;
- }
- CHECK_NE(-1, waitpid(child, &wstatus, 0));
- CHECK_EQ(0, WEXITSTATUS(wstatus));
-
- return 0;
-}
diff --git a/examples/system.c b/examples/system.c
new file mode 100644
index 00000000..bf730a57
--- /dev/null
+++ b/examples/system.c
@@ -0,0 +1,15 @@
+#if 0
+/*─────────────────────────────────────────────────────────────────╗
+│ To the extent possible under law, Justine Tunney has waived │
+│ all copyright and related or neighboring rights to this file, │
+│ as it is written in the following disclaimers: │
+│ • http://unlicense.org/ │
+│ • http://creativecommons.org/publicdomain/zero/1.0/ │
+╚─────────────────────────────────────────────────────────────────*/
+#endif
+#include "libc/stdio/stdio.h"
+
+int main(int argc, char *argv[]) {
+ system("notepad");
+ return 0;
+}
diff --git a/libc/alg/alg.h b/libc/alg/alg.h
index e8f9d7fc..39fb1633 100644
--- a/libc/alg/alg.h
+++ b/libc/alg/alg.h
@@ -21,13 +21,6 @@ void qsort_r(void *, size_t, size_t,
int tarjan(int, const int (*)[2], int, int[], int[], int *)
paramsnonnull((2, 4)) nocallback nothrow;
-void *memmem(const void *, size_t, const void *, size_t)
- paramsnonnull() nothrow nocallback nosideeffect;
-void *memmem16(const void *, size_t, const void *, size_t)
- paramsnonnull() nothrow nocallback nosideeffect;
-void *wmemmem(const void *, size_t, const void *, size_t)
- paramsnonnull() nothrow nocallback nosideeffect;
-
#define __algalloc returnspointerwithnoaliases nothrow nocallback nodiscard
char *replacestr(const char *, const char *, const char *)
diff --git a/libc/alg/replacestr.c b/libc/alg/replacestr.c
index 845c0a59..81717b56 100644
--- a/libc/alg/replacestr.c
+++ b/libc/alg/replacestr.c
@@ -29,7 +29,7 @@
* @return newly allocated memory that must be free()'d or NULL w/ errno
* @error ENOMEM, EINVAL
*/
-char *(replacestr)(const char *s, const char *needle, const char *replacement) {
+char *replacestr(const char *s, const char *needle, const char *replacement) {
char *p1, *p2, *res_p;
size_t left, nlen, rlen, res_i, res_n;
if (*needle) {
diff --git a/libc/bits/likely.h b/libc/bits/likely.h
new file mode 100644
index 00000000..78e3dfc7
--- /dev/null
+++ b/libc/bits/likely.h
@@ -0,0 +1,9 @@
+#ifndef COSMOPOLITAN_LIBC_BITS_LIKELY_H_
+#define COSMOPOLITAN_LIBC_BITS_LIKELY_H_
+#if !(__ASSEMBLER__ + __LINKER__ + 0)
+
+#define likely(expr) __builtin_expect(!!(expr), 1)
+#define unlikely(expr) __builtin_expect(!!(expr), 0)
+
+#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
+#endif /* COSMOPOLITAN_LIBC_BITS_LIKELY_H_ */
diff --git a/libc/calls/access.c b/libc/calls/access.c
index 590e7b31..2f5db766 100644
--- a/libc/calls/access.c
+++ b/libc/calls/access.c
@@ -29,7 +29,6 @@
* @param mode can be R_OK, W_OK, X_OK, F_OK
* @return 0 if ok, or -1 and sets errno
* @asyncsignalsafe
- * @syscall
*/
int access(const char *path, int mode) {
char16_t path16[PATH_MAX];
diff --git a/libc/calls/atfork.c b/libc/calls/atfork.c
index 46b48b39..3e047554 100644
--- a/libc/calls/atfork.c
+++ b/libc/calls/atfork.c
@@ -29,9 +29,10 @@ static struct AtFork {
} g_atfork;
/**
- * Registers function to be called when PID changes.
+ * Registers function to be called by fork() in child.
*
* @return 0 on success, or -1 w/ errno
+ * @note vfork() won't invoke callbacks
*/
int atfork(void *fn, void *arg) {
if (g_atfork.i == ARRAYLEN(g_atfork.p)) return enomem();
@@ -40,9 +41,9 @@ int atfork(void *fn, void *arg) {
}
/**
- * Triggers atfork() callbacks.
+ * Triggers callbacks registered by atfork().
*
- * Only fork() should call this.
+ * @note only fork() should call this
*/
void __onfork(void) {
size_t i;
diff --git a/libc/calls/calls.h b/libc/calls/calls.h
index 08e8179f..dd34dbdf 100644
--- a/libc/calls/calls.h
+++ b/libc/calls/calls.h
@@ -43,7 +43,7 @@
#define WEXITSTATUS(s) (((s)&0xff00) >> 8)
#define WIFCONTINUED(s) ((s) == 0xffff)
#define WIFEXITED(s) (!WTERMSIG(s))
-#define WIFSIGNALED(s) (((s)&0xffff) - 1U < 0xffu)
+#define WIFSIGNALED(s) (((s)&0xffff) - 1u < 0xffu)
#define WIFSTOPPED(s) ((short)((((s)&0xffff) * 0x10001) >> 8) > 0x7f00)
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WTERMSIG(s) ((s)&0x7f)
@@ -148,8 +148,8 @@ int openanon(char *, unsigned) nodiscard;
int openat(int, const char *, int, ...);
int pause(void);
int personality(uint64_t);
-int pipe(int[hasatleast 2]) nodiscard;
-int pipe2(int[hasatleast 2], int) nodiscard;
+int pipe(int[hasatleast 2]);
+int pipe2(int[hasatleast 2], int);
int posix_fadvise(int, uint64_t, uint64_t, int);
int posix_fallocate(int, int64_t, int64_t);
int posix_madvise(void *, uint64_t, int);
@@ -226,6 +226,10 @@ uint32_t getsid(int) nosideeffect;
uint32_t gettid(void) nosideeffect;
uint32_t getuid(void) nosideeffect;
uint32_t umask(int32_t);
+long ptrace(int, int, void *, void *);
+int chroot(const char *);
+int prctl();
+int sysctl(const int *, unsigned, void *, size_t *, void *, size_t);
#define getcwd(BUF, SIZE) \
(__builtin_constant_p(BUF) && (&(BUF)[0] == NULL) ? get_current_dir_name() \
diff --git a/libc/calls/calls.mk b/libc/calls/calls.mk
index ec2baa72..7511494d 100644
--- a/libc/calls/calls.mk
+++ b/libc/calls/calls.mk
@@ -74,6 +74,15 @@ o/$(MODE)/libc/calls/ntcontext2linux.o: \
OVERRIDE_COPTS += \
-O3
+o/$(MODE)/libc/calls/execl.o \
+o/$(MODE)/libc/calls/execle.o \
+o/$(MODE)/libc/calls/execlp.o \
+o/$(MODE)/libc/calls/execve-nt.o \
+o/$(MODE)/libc/calls/execve-sysv.o \
+o/$(MODE)/libc/calls/mkntenvblock.o: \
+ OVERRIDE_CPPFLAGS += \
+ -DSTACK_FRAME_UNLIMITED
+
LIBC_CALLS_LIBS = $(foreach x,$(LIBC_CALLS_ARTIFACTS),$($(x)))
LIBC_CALLS_SRCS = $(foreach x,$(LIBC_CALLS_ARTIFACTS),$($(x)_SRCS))
LIBC_CALLS_HDRS = $(foreach x,$(LIBC_CALLS_ARTIFACTS),$($(x)_HDRS))
diff --git a/libc/calls/close.c b/libc/calls/close.c
index 48646479..3b7b83c0 100644
--- a/libc/calls/close.c
+++ b/libc/calls/close.c
@@ -32,7 +32,7 @@
*
* @return 0 on success, or -1 w/ errno
* @asyncsignalsafe
- * @syscall
+ * @vforksafe
*/
int close(int fd) {
int rc;
@@ -52,7 +52,7 @@ int close(int fd) {
} else {
rc = ebadf();
}
- if (fd < g_fds.n) {
+ if (!__vforked && fd < g_fds.n) {
g_fds.p[fd].kind = kFdEmpty;
g_fds.f = MIN(g_fds.f, fd);
}
diff --git a/libc/calls/commandv.c b/libc/calls/commandv.c
index 113be578..316bf19c 100644
--- a/libc/calls/commandv.c
+++ b/libc/calls/commandv.c
@@ -19,79 +19,41 @@
#include "libc/bits/progn.internal.h"
#include "libc/bits/safemacros.h"
#include "libc/calls/calls.h"
-#include "libc/dce.h"
-#include "libc/errno.h"
-#include "libc/fmt/conv.h"
-#include "libc/nt/ntdll.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
-#include "libc/sysv/consts/ok.h"
#include "libc/sysv/errfuns.h"
-static int accessexe(char pathname[hasatleast PATH_MAX], size_t len,
- const char *ext) {
- len = stpcpy(&pathname[len], ext) - &pathname[0];
- if (isexecutable(pathname)) {
- return len;
- } else {
- return -1;
- }
-}
-
-static int accesscmd(char pathname[hasatleast PATH_MAX], const char *path,
- const char *name, size_t namelen) { /* cf. %PATHEXT% */
- int rc;
- char *p;
- bool hasdot;
- size_t pathlen, len;
- pathlen = strlen(path);
+static bool AccessCommand(char path[hasatleast PATH_MAX], const char *name,
+ size_t namelen, size_t pathlen) {
if (pathlen + 1 + namelen + 1 + 4 + 1 > PATH_MAX) return -1;
- p = mempcpy(pathname, path, pathlen);
- if (pathlen && pathname[pathlen - 1] != '/') *p++ = '/';
- p = mempcpy(p, name, namelen);
- len = p - &pathname[0];
- hasdot = !!memchr(basename(name), '.', namelen);
- if ((hasdot && (rc = accessexe(pathname, len, "")) != -1) ||
- (!hasdot &&
- ((rc = accessexe(pathname, len, ".com")) != -1 ||
- (IsWindows() && (rc = accessexe(pathname, len, ".exe")) != -1) ||
- (!IsWindows() && (rc = accessexe(pathname, len, "")) != -1)))) {
- return rc;
- } else {
- return -1;
+ if (pathlen && (path[pathlen - 1] != '/' && path[pathlen - 1] != '\\')) {
+ path[pathlen++] = '/';
}
+ memcpy(path + pathlen, name, namelen + 1);
+ if (isexecutable(path)) return true;
+ memcpy(path + pathlen + namelen, ".com", 5);
+ if (isexecutable(path)) return true;
+ memcpy(path + pathlen + namelen, ".exe", 5);
+ if (isexecutable(path)) return true;
+ return false;
}
-static int searchcmdpath(char pathname[hasatleast PATH_MAX], const char *name,
- size_t namelen) {
- int rc;
- char *path, *pathtok, ep[PATH_MAX];
- rc = -1;
- if (!memccpy(ep,
- firstnonnull(emptytonull(getenv("PATH")),
- "/bin:/usr/local/bin:/usr/bin"),
- '\0', sizeof(ep))) {
- return enomem();
- }
- pathtok = ep;
- while ((path = strsep(&pathtok, IsWindows() ? ";" : ":"))) {
- if (strchr(path, '=')) continue;
- if ((rc = accesscmd(pathname, path, name, namelen)) != -1) {
- break;
+static bool SearchPath(char path[hasatleast PATH_MAX], const char *name,
+ size_t namelen) {
+ size_t i;
+ const char *p;
+ p = firstnonnull(emptytonull(getenv("PATH")), "/bin:/usr/local/bin:/usr/bin");
+ for (;; p += i) {
+ while (*p == ':' || *p == ';') ++p;
+ if (!*p) break;
+ for (i = 0; i < PATH_MAX && p[i] && p[i] != ':' && p[i] != ';'; ++i) {
+ path[i] = p[i];
+ }
+ if (AccessCommand(path, name, namelen, i)) {
+ return true;
}
}
- return rc;
-}
-
-static char *mkcmdquery(const char *name, size_t namelen,
- char scratch[hasatleast PATH_MAX]) {
- char *p;
- if (namelen + 1 + 1 > PATH_MAX) return NULL;
- p = mempcpy(scratch, name, namelen);
- *p++ = '=';
- *p++ = '\0';
- if (IsWindows() || IsXnu()) strntolower(scratch, namelen);
- return &scratch[0];
+ return false;
}
/**
@@ -100,20 +62,27 @@ static char *mkcmdquery(const char *name, size_t namelen,
* @return execve()'able path, or NULL w/ errno
* @errno ENOENT, EACCES, ENOMEM
* @see free(), execvpe()
+ * @asyncsignalsafe
+ * @vforksafe
*/
char *commandv(const char *name, char pathbuf[hasatleast PATH_MAX]) {
char *p;
- size_t len;
+ size_t namelen;
int rc, olderr;
+ if (!(namelen = strlen(name))) return PROGN(enoent(), NULL);
+ if (namelen + 1 > PATH_MAX) return PROGN(enametoolong(), NULL);
+ if (name[0] == '/' || name[0] == '\\') {
+ memcpy(pathbuf, name, namelen + 1);
+ return pathbuf;
+ }
olderr = errno;
- if (!(len = strlen(name))) return PROGN(enoent(), NULL);
- if (memchr(name, '=', len)) return PROGN(einval(), NULL);
if ((IsWindows() &&
- ((rc = accesscmd(pathbuf, kNtSystemDirectory, name, len)) != -1 ||
- (rc = accesscmd(pathbuf, kNtWindowsDirectory, name, len)) != -1)) ||
- (rc = accesscmd(pathbuf, "", name, len)) != -1 ||
- (!strpbrk(name, "/\\") &&
- (rc = searchcmdpath(pathbuf, name, len)) != -1)) {
+ (AccessCommand(pathbuf, name, namelen,
+ stpcpy(pathbuf, kNtSystemDirectory) - pathbuf) ||
+ AccessCommand(pathbuf, name, namelen,
+ stpcpy(pathbuf, kNtWindowsDirectory) - pathbuf))) ||
+ AccessCommand(strcpy(pathbuf, ""), name, namelen, 0) ||
+ SearchPath(pathbuf, name, namelen)) {
errno = olderr;
return pathbuf;
} else {
diff --git a/libc/calls/dup-nt.c b/libc/calls/dup-nt.c
index 81f1c80e..33b4abae 100644
--- a/libc/calls/dup-nt.c
+++ b/libc/calls/dup-nt.c
@@ -29,6 +29,7 @@
* Implements dup(), dup2(), and dup3() for Windows NT.
*/
textwindows int dup$nt(int oldfd, int newfd, int flags) {
+ int64_t proc;
if (!__isfdkind(oldfd, kFdFile)) return ebadf();
if (newfd == -1) {
if ((newfd = __getemptyfd()) == -1) {
@@ -41,9 +42,9 @@ textwindows int dup$nt(int oldfd, int newfd, int flags) {
} else {
return -1;
}
- if (DuplicateHandle(GetCurrentProcess(), g_fds.p[oldfd].handle,
- GetCurrentProcess(), &g_fds.p[newfd].handle, 0, true,
- kNtDuplicateSameAccess)) {
+ proc = GetCurrentProcess();
+ if (DuplicateHandle(proc, g_fds.p[oldfd].handle, proc, &g_fds.p[newfd].handle,
+ 0, true, kNtDuplicateSameAccess)) {
g_fds.p[newfd].kind = g_fds.p[oldfd].kind;
g_fds.p[newfd].flags = flags;
return newfd;
diff --git a/libc/calls/dup.c b/libc/calls/dup.c
index 61d173c3..998c5175 100644
--- a/libc/calls/dup.c
+++ b/libc/calls/dup.c
@@ -26,7 +26,7 @@
* @param fd remains open afterwards
* @return some arbitrary new number for fd
* @asyncsignalsafe
- * @syscall
+ * @vforksafe
*/
nodiscard int dup(int fd) {
if (!IsWindows()) {
diff --git a/libc/calls/dup2.c b/libc/calls/dup2.c
index c0e3659b..9a21a8bc 100644
--- a/libc/calls/dup2.c
+++ b/libc/calls/dup2.c
@@ -28,7 +28,7 @@
* unless it's equal to oldfd, in which case dup2() is a no-op
* @return new file descriptor, or -1 w/ errno
* @asyncsignalsafe
- * @syscall
+ * @vforksafe
*/
int dup2(int oldfd, int newfd) {
if (oldfd == newfd) return newfd;
diff --git a/libc/calls/dup3-sysv.c b/libc/calls/dup3-sysv.c
index ab5b8131..14248411 100644
--- a/libc/calls/dup3-sysv.c
+++ b/libc/calls/dup3-sysv.c
@@ -31,16 +31,11 @@ int32_t dup3$sysv(int32_t oldfd, int32_t newfd, int flags) {
if ((fd == -1 && errno == ENOSYS) || fd == __NR_dup3_linux) {
demodernize = true;
errno = olderr;
- goto OldSkool;
+ } else {
+ return fd;
}
- } else if (demodernize) {
- goto OldSkool;
- } else {
- fd = __dup3$sysv(oldfd, newfd, flags);
+ } else if (!demodernize) {
+ return __dup3$sysv(oldfd, newfd, flags);
}
- return fd;
-OldSkool:
- fd = dup2$sysv(oldfd, newfd);
- if (flags) fd = fixupnewfd$sysv(fd, flags);
- return fd;
+ return fixupnewfd$sysv(dup2$sysv(oldfd, newfd), flags);
}
diff --git a/libc/calls/hefty/execl.c b/libc/calls/execl.c
similarity index 86%
rename from libc/calls/hefty/execl.c
rename to libc/calls/execl.c
index 6d1712fd..fc7e6321 100644
--- a/libc/calls/hefty/execl.c
+++ b/libc/calls/execl.c
@@ -16,10 +16,9 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/mem/mem.h"
-#include "libc/runtime/runtime.h"
-#include "libc/calls/hefty/mkvarargv.h"
#include "libc/calls/calls.h"
+#include "libc/mem/alloca.h"
+#include "libc/runtime/runtime.h"
/**
* Executes program, with current environment.
@@ -31,16 +30,23 @@
* @param arg[1,n-2] optionally specify program arguments
* @param arg[n-1] is NULL
* @return doesn't return on success, otherwise -1 w/ errno
- * @notasyncsignalsafe (TODO)
+ * @asyncsignalsafe
+ * @vforksafe
*/
int execl(const char *exe, const char *arg, ... /*, NULL*/) {
- va_list va;
- void *argv;
+ int i;
+ char **argv;
+ va_list va, vb;
+ va_copy(vb, va);
va_start(va, arg);
- if ((argv = mkvarargv(arg, va))) {
- execve(exe, argv, environ);
- free(argv);
- }
+ for (i = 0; va_arg(va, const char *); ++i) donothing;
va_end(va);
- return -1;
+ argv = alloca((i + 2) * sizeof(char *));
+ va_start(vb, arg);
+ argv[0] = arg;
+ for (i = 1;; ++i) {
+ if (!(argv[i] = va_arg(vb, const char *))) break;
+ }
+ va_end(vb);
+ return execv(exe, argv);
}
diff --git a/libc/calls/hefty/execle.c b/libc/calls/execle.c
similarity index 85%
rename from libc/calls/hefty/execle.c
rename to libc/calls/execle.c
index ae0c58c7..fddd3021 100644
--- a/libc/calls/hefty/execle.c
+++ b/libc/calls/execle.c
@@ -17,8 +17,7 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/mkvarargv.h"
-#include "libc/mem/mem.h"
+#include "libc/mem/alloca.h"
/**
* Executes program, with custom environment.
@@ -31,17 +30,25 @@
* @param arg[n-2] is NULL
* @param arg[n-1] is a pointer to a ["key=val",...,NULL] array
* @return doesn't return on success, otherwise -1 w/ errno
- * @notasyncsignalsafe (TODO)
+ * @asyncsignalsafe
+ * @vforksafe
*/
int execle(const char *exe, const char *arg,
... /*, NULL, char *const envp[] */) {
- va_list va;
- void *argv;
+ int i;
+ va_list va, vb;
+ char **argv, **envp;
+ va_copy(vb, va);
va_start(va, arg);
- if ((argv = mkvarargv(arg, va))) {
- execve(exe, argv, va_arg(va, char *const *));
- free(argv);
- }
+ for (i = 0; va_arg(va, const char *); ++i) donothing;
+ envp = va_arg(va, char **);
va_end(va);
- return -1;
+ argv = alloca((i + 2) * sizeof(char *));
+ va_start(vb, arg);
+ argv[0] = arg;
+ for (i = 1;; ++i) {
+ if (!(argv[i] = va_arg(vb, const char *))) break;
+ }
+ va_end(vb);
+ return execve(exe, argv, envp);
}
diff --git a/libc/calls/hefty/execlp.c b/libc/calls/execlp.c
similarity index 83%
rename from libc/calls/hefty/execlp.c
rename to libc/calls/execlp.c
index 3c9c6e41..3e36c809 100644
--- a/libc/calls/hefty/execlp.c
+++ b/libc/calls/execlp.c
@@ -17,8 +17,7 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/mkvarargv.h"
-#include "libc/mem/mem.h"
+#include "libc/mem/alloca.h"
#include "libc/runtime/runtime.h"
/**
@@ -31,20 +30,26 @@
* @param arg[1,n-2] optionally specify program arguments
* @param arg[n-1] is NULL
* @return doesn't return on success, otherwise -1 w/ errno
- * @notasyncsignalsafe
+ * @asyncsignalsafe
+ * @vforksafe
*/
int execlp(const char *prog, const char *arg, ... /*, NULL*/) {
+ int i;
char *exe;
+ char **argv;
+ va_list va, vb;
char pathbuf[PATH_MAX];
- if ((exe = commandv(prog, pathbuf))) {
- va_list va;
- void *argv;
- va_start(va, arg);
- if ((argv = mkvarargv(arg, va))) {
- execve(exe, argv, environ);
- free(argv);
- }
- va_end(va);
+ if (!(exe = commandv(prog, pathbuf))) return -1;
+ va_copy(vb, va);
+ va_start(va, arg);
+ for (i = 0; va_arg(va, const char *); ++i) donothing;
+ va_end(va);
+ argv = alloca((i + 2) * sizeof(char *));
+ va_start(vb, arg);
+ argv[0] = arg;
+ for (i = 1;; ++i) {
+ if (!(argv[i] = va_arg(vb, const char *))) break;
}
- return -1;
+ va_end(vb);
+ return execv(exe, argv);
}
diff --git a/libc/calls/hefty/execv.c b/libc/calls/execv.c
similarity index 99%
rename from libc/calls/hefty/execv.c
rename to libc/calls/execv.c
index b55bd8e2..ddf79ee2 100644
--- a/libc/calls/hefty/execv.c
+++ b/libc/calls/execv.c
@@ -16,12 +16,13 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/runtime/runtime.h"
#include "libc/calls/calls.h"
+#include "libc/runtime/runtime.h"
/**
* Replaces process with specific program, using default environment.
* @asyncsignalsafe
+ * @vforksafe
*/
int execv(const char *exe, char *const argv[]) {
return execve(exe, argv, environ);
diff --git a/libc/calls/hefty/execve-nt.c b/libc/calls/execve-nt.c
similarity index 88%
rename from libc/calls/hefty/execve-nt.c
rename to libc/calls/execve-nt.c
index 6483e0c4..d22e027d 100644
--- a/libc/calls/hefty/execve-nt.c
+++ b/libc/calls/execve-nt.c
@@ -16,9 +16,9 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/calls/hefty/internal.h"
-#include "libc/calls/hefty/ntspawn.h"
#include "libc/calls/internal.h"
+#include "libc/calls/ntspawn.h"
+#include "libc/mem/alloca.h"
#include "libc/nt/accounting.h"
#include "libc/nt/enum/startf.h"
#include "libc/nt/enum/status.h"
@@ -27,13 +27,12 @@
#include "libc/nt/struct/startupinfo.h"
#include "libc/nt/synchronization.h"
#include "libc/str/str.h"
-#include "libc/sysv/consts/fileno.h"
#include "libc/sysv/consts/o.h"
-#include "libc/sysv/consts/sock.h"
textwindows int execve$nt(const char *program, char *const argv[],
char *const envp[]) {
- int i;
+ int rc;
+ size_t i;
uint32_t dwExitCode;
struct NtStartupInfo startinfo;
struct NtProcessInformation procinfo;
@@ -48,20 +47,18 @@ textwindows int execve$nt(const char *program, char *const argv[],
close(i);
}
}
- if (ntspawn(program, argv, envp, NULL, NULL, true, 0, NULL, &startinfo,
- &procinfo) == -1) {
- return -1;
- }
+ for (i = 0; argv[i];) ++i;
+ i = (i + 1) * sizeof(char *);
+ argv = memcpy(alloca(i), argv, i);
+ memcpy(argv, &program, sizeof(program));
+ rc = ntspawn(argv, envp, NULL, NULL, true, 0, NULL, &startinfo, &procinfo);
+ if (rc == -1) return -1;
CloseHandle(procinfo.hThread);
- for (i = 0; i < g_fds.n; ++i) {
- if (g_fds.p[i].kind != kFdEmpty) {
- close(i);
- }
- }
do {
WaitForSingleObject(procinfo.hProcess, -1);
dwExitCode = kNtStillActive;
GetExitCodeProcess(procinfo.hProcess, &dwExitCode);
} while (dwExitCode == kNtStillActive);
+ CloseHandle(procinfo.hProcess);
ExitProcess(dwExitCode);
}
diff --git a/test/libc/calls/hefty/sortenvp_test.c b/libc/calls/execve-sysv.c
similarity index 69%
rename from test/libc/calls/hefty/sortenvp_test.c
rename to libc/calls/execve-sysv.c
index 9badcfd9..6d99f393 100644
--- a/test/libc/calls/hefty/sortenvp_test.c
+++ b/libc/calls/execve-sysv.c
@@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
@@ -16,17 +16,24 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/runtime/gc.h"
-#include "libc/calls/hefty/ntspawn.h"
-#include "libc/testlib/testlib.h"
+#include "libc/bits/safemacros.h"
+#include "libc/calls/calls.h"
+#include "libc/calls/internal.h"
+#include "libc/errno.h"
+#include "libc/mem/alloca.h"
+#include "libc/paths.h"
+#include "libc/str/str.h"
-TEST(sortenvp, test) {
- char *envp[] = {"u=b", "c=d", "韩=非", "uh=d", "hduc=d", NULL};
- char **sortedenvp = gc(sortenvp(envp));
- EXPECT_STREQ("c=d", sortedenvp[0]);
- EXPECT_STREQ("hduc=d", sortedenvp[1]);
- EXPECT_STREQ("u=b", sortedenvp[2]);
- EXPECT_STREQ("uh=d", sortedenvp[3]);
- EXPECT_STREQ("韩=非", sortedenvp[4]);
- EXPECT_EQ(NULL, sortedenvp[5]);
+int execve$sysv(const char *prog, char *const argv[], char *const envp[]) {
+ size_t i, n;
+ char **shargs, bash[PATH_MAX];
+ if (__execve$sysv(prog, argv, envp) != -1) return 0;
+ if (errno != ENOEXEC) return -1;
+ for (i = 0; argv[i];) ++i;
+ shargs = alloca((i + 2) * sizeof(char *));
+ memcpy(shargs + 2, argv + 1, i * sizeof(char *));
+ shargs[0] = !IsFreebsd() ? _PATH_BSHELL
+ : firstnonnull(commandv("bash", bash), _PATH_BSHELL);
+ shargs[1] = prog;
+ return __execve$sysv(shargs[0], shargs, envp);
}
diff --git a/libc/calls/hefty/execve.c b/libc/calls/execve.c
similarity index 98%
rename from libc/calls/hefty/execve.c
rename to libc/calls/execve.c
index fd753046..0b292d4a 100644
--- a/libc/calls/hefty/execve.c
+++ b/libc/calls/execve.c
@@ -17,7 +17,6 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/internal.h"
#include "libc/calls/internal.h"
#include "libc/dce.h"
@@ -32,6 +31,7 @@
* @param envp[n-1] is NULL
* @return doesn't return, or -1 w/ errno
* @asyncsignalsafe
+ * @vforksafe
*/
int execve(const char *program, char *const argv[], char *const envp[]) {
if (!IsWindows()) {
diff --git a/libc/calls/hefty/execvp.c b/libc/calls/execvp.c
similarity index 98%
rename from libc/calls/hefty/execvp.c
rename to libc/calls/execvp.c
index 15b8910d..99c63e41 100644
--- a/libc/calls/hefty/execvp.c
+++ b/libc/calls/execvp.c
@@ -16,12 +16,13 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/runtime/runtime.h"
#include "libc/calls/calls.h"
+#include "libc/runtime/runtime.h"
/**
* Replaces process, with path search, using default environment.
- * @notasyncsignalsafe
+ * @asyncsignalsafe
+ * @vforksafe
*/
int execvp(const char *file, char *const argv[]) {
return execvpe(file, argv, environ);
diff --git a/libc/calls/hefty/execvpe.c b/libc/calls/execvpe.c
similarity index 95%
rename from libc/calls/hefty/execvpe.c
rename to libc/calls/execvpe.c
index 7de35cb6..ac7abb89 100644
--- a/libc/calls/hefty/execvpe.c
+++ b/libc/calls/execvpe.c
@@ -28,13 +28,12 @@
* @param argv is [file,argv₁..argvₙ₋₁,NULL]
* @param envp is ["key=val",...,NULL]
* @return doesn't return on success, otherwise -1 w/ errno
- * @notasyncsignalsafe
+ * @asyncsignalsafe
+ * @vforksafe
*/
int execvpe(const char *prog, char *const argv[], char *const *envp) {
char *exe;
char pathbuf[PATH_MAX];
- if ((exe = commandv(prog, pathbuf))) {
- execve(exe, argv, envp);
- }
- return -1;
+ if (!(exe = commandv(prog, pathbuf))) return -1;
+ return execve(exe, argv, envp);
}
diff --git a/libc/calls/faccessat-nt.c b/libc/calls/faccessat-nt.c
index e8cfcac4..a5068f27 100644
--- a/libc/calls/faccessat-nt.c
+++ b/libc/calls/faccessat-nt.c
@@ -16,7 +16,6 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/calls/hefty/internal.h"
#include "libc/calls/internal.h"
#include "libc/sysv/consts/at.h"
#include "libc/sysv/errfuns.h"
diff --git a/libc/calls/faccessat.c b/libc/calls/faccessat.c
index 02d9d14b..1cb94485 100644
--- a/libc/calls/faccessat.c
+++ b/libc/calls/faccessat.c
@@ -17,7 +17,6 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/internal.h"
#include "libc/calls/internal.h"
#include "libc/dce.h"
#include "libc/sysv/consts/at.h"
diff --git a/libc/calls/fallocate.c b/libc/calls/fallocate.c
index 6af86b27..622641b1 100644
--- a/libc/calls/fallocate.c
+++ b/libc/calls/fallocate.c
@@ -36,6 +36,7 @@
* @param mode can be 0, FALLOC_xxx
* @param length is how much physical space to reserve / commit
* @return 0 on success, or -1 w/ errno
+ * @note limited availability on rhel5 and openbsd
* @see ftruncate()
* @syscall
*/
@@ -68,7 +69,7 @@ int fallocate(int fd, int32_t mode, int64_t offset, int64_t length) {
*/
return ftruncate$nt(fd, length);
} else {
- return eopnotsupp();
+ return enosys();
}
} else {
return enosys();
diff --git a/libc/calls/fcntl-nt.c b/libc/calls/fcntl-nt.c
index 9f95cdd2..cd45e4b7 100644
--- a/libc/calls/fcntl-nt.c
+++ b/libc/calls/fcntl-nt.c
@@ -25,27 +25,30 @@
textwindows int fcntl$nt(int fd, int cmd, unsigned arg) {
uint32_t flags;
- if (!__isfdkind(fd, kFdFile)) return ebadf();
- switch (cmd) {
- case F_GETFL:
- return g_fds.p[fd].flags;
- case F_SETFL:
- return (g_fds.p[fd].flags = arg);
- case F_GETFD:
- if (g_fds.p[fd].flags & O_CLOEXEC) {
- return FD_CLOEXEC;
- } else {
- return 0;
- }
- case F_SETFD:
- if (arg & O_CLOEXEC) {
- g_fds.p[fd].flags |= O_CLOEXEC;
- return FD_CLOEXEC;
- } else {
- g_fds.p[fd].flags &= ~O_CLOEXEC;
- return 0;
- }
- default:
- return 0; /* TODO(jart): Implement me. */
+ if (__isfdkind(fd, kFdFile) || __isfdkind(fd, kFdSocket)) {
+ switch (cmd) {
+ case F_GETFL:
+ return g_fds.p[fd].flags;
+ case F_SETFL:
+ return (g_fds.p[fd].flags = arg);
+ case F_GETFD:
+ if (g_fds.p[fd].flags & O_CLOEXEC) {
+ return FD_CLOEXEC;
+ } else {
+ return 0;
+ }
+ case F_SETFD:
+ if (arg & O_CLOEXEC) {
+ g_fds.p[fd].flags |= O_CLOEXEC;
+ return FD_CLOEXEC;
+ } else {
+ g_fds.p[fd].flags &= ~O_CLOEXEC;
+ return 0;
+ }
+ default:
+ return 0; /* TODO(jart): Implement me. */
+ }
+ } else {
+ return ebadf();
}
}
diff --git a/libc/calls/fixupnewfd.c b/libc/calls/fixupnewfd.c
index 551699b4..579a5cf0 100644
--- a/libc/calls/fixupnewfd.c
+++ b/libc/calls/fixupnewfd.c
@@ -27,9 +27,9 @@
*/
int fixupnewfd$sysv(int fd, int flags) {
if (fd != -1) {
- if (flags & O_CLOEXEC) fcntl$sysv(fd, F_SETFD, FD_CLOEXEC);
- fcntl$sysv(fd, F_SETFL,
- (fcntl$sysv(fd, F_GETFL, 0) ^ (flags & O_NONBLOCK)));
+ if (flags & O_CLOEXEC) {
+ fcntl$sysv(fd, F_SETFD, FD_CLOEXEC);
+ }
}
return fd;
}
diff --git a/libc/calls/fstat-nt.c b/libc/calls/fstat-nt.c
index 9d6af983..179b93cb 100644
--- a/libc/calls/fstat-nt.c
+++ b/libc/calls/fstat-nt.c
@@ -46,7 +46,6 @@ textwindows int fstat$nt(int64_t handle, struct stat *st) {
break;
case kNtFileTypeDisk:
if (GetFileInformationByHandle(handle, &wst)) {
- dprintf(1, "handle = %ld\n", handle);
st->st_mode =
(S_IRUSR | S_IXUSR |
(!(wst.dwFileAttributes & kNtFileAttributeReadonly) ? S_IWUSR
diff --git a/libc/calls/gethostname.c b/libc/calls/gethostname.c
index 80f5e377..006c6dd3 100644
--- a/libc/calls/gethostname.c
+++ b/libc/calls/gethostname.c
@@ -20,6 +20,7 @@
#include "libc/calls/internal.h"
#include "libc/calls/struct/utsname.h"
#include "libc/dce.h"
+#include "libc/errno.h"
#include "libc/macros.h"
#include "libc/nt/enum/computernameformat.h"
#include "libc/nt/errors.h"
@@ -28,6 +29,9 @@
#include "libc/str/str.h"
#include "libc/sysv/errfuns.h"
+#define CTL_KERN 1
+#define KERN_HOSTNAME 10
+
/**
* Returns name of host system, e.g.
*
@@ -35,18 +39,35 @@
* ^^^^^^^^^^^^
*/
int gethostname(char *name, size_t len) {
- uint32_t nSize;
- char16_t name16[256];
- struct utsname u;
if (len < 1) return einval();
if (!name) return efault();
if (!IsWindows()) {
- if (uname(&u) == -1) return -1;
- if (!memccpy(name, u.nodename, '\0', len)) {
+ if (IsBsd()) {
+ char *p;
+ int cmd[2];
+ char buf[254];
+ size_t buflen;
+ cmd[0] = CTL_KERN;
+ cmd[1] = KERN_HOSTNAME;
+ buflen = sizeof(buf);
+ if (sysctl(cmd, 2, buf, &buflen, NULL, 0) == -1) {
+ if (errno == ENOMEM) errno = ENAMETOOLONG;
+ return -1;
+ }
+ strncpy(name, buf, len);
name[len - 1] = '\0';
+ if ((p = strchr(name, '.'))) *p = '\0';
+ return 0;
+ } else {
+ struct utsname u;
+ if (uname(&u) == -1) return -1;
+ memccpy(name, u.nodename, '\0', len);
+ name[len - 1] = '\0';
+ return 0;
}
- return 0;
} else {
+ uint32_t nSize;
+ char16_t name16[256];
nSize = ARRAYLEN(name16);
if (GetComputerNameEx(kNtComputerNameDnsHostname, name16, &nSize)) {
tprecode16to8(name, len, name16);
diff --git a/libc/calls/gettid.c b/libc/calls/gettid.c
index 60fc063c..9ce70c89 100644
--- a/libc/calls/gettid.c
+++ b/libc/calls/gettid.c
@@ -26,8 +26,8 @@
* @asyncsignalsafe
*/
uint32_t gettid(void) {
+ uint32_t res;
if (!IsWindows()) {
- uint32_t res;
res = gettid$sysv();
if (res <= 0) {
res = getpid();
diff --git a/libc/calls/growfds.c b/libc/calls/growfds.c
index 3cbf2d32..d1503801 100644
--- a/libc/calls/growfds.c
+++ b/libc/calls/growfds.c
@@ -20,19 +20,21 @@
#include "libc/bits/weaken.h"
#include "libc/calls/internal.h"
#include "libc/mem/mem.h"
+#include "libc/str/str.h"
#include "libc/sysv/errfuns.h"
int __ensurefds(int fd) {
- size_t i, n;
+ size_t n;
struct Fd *p;
if (fd < g_fds.n) return fd;
- if (weaken(realloc)) {
- if ((p = weaken(realloc)(
- g_fds.p != g_fds.__init_p ? g_fds.p : NULL,
- (n = MAX(fd + 1, (i = g_fds.n) << 1)) * sizeof(*p)))) {
- do {
- p[i++].kind = kFdEmpty;
- } while (i < n);
+ if (weaken(malloc)) {
+ n = MAX(fd + 1, g_fds.n + (g_fds.n << 1));
+ if ((p = weaken(malloc)(n * sizeof(*p)))) {
+ memcpy(p, g_fds.p, g_fds.n * sizeof(*p));
+ memset(p + g_fds.n, 0, (n - g_fds.n) * sizeof(*p));
+ if (g_fds.p != g_fds.__init_p && weaken(free)) {
+ weaken(free)(g_fds.p);
+ }
g_fds.p = p;
g_fds.n = n;
return fd;
diff --git a/libc/calls/hefty/dirstream.c b/libc/calls/hefty/dirstream.c
index 31753179..e282d6d2 100644
--- a/libc/calls/hefty/dirstream.c
+++ b/libc/calls/hefty/dirstream.c
@@ -32,14 +32,19 @@
#include "libc/sysv/consts/o.h"
#include "libc/sysv/errfuns.h"
-struct dirent$freebsd {
- uint32_t d_fileno;
- uint16_t d_reclen;
- uint8_t d_type;
- uint8_t d_namlen;
- char d_name[256];
-};
+/**
+ * @fileoverview Directory Streams for Linux+Mac+Windows+FreeBSD+OpenBSD.
+ *
+ * System interfaces for listing the contents of file system directories
+ * are famously incompatible across platforms. Most native projects that
+ * have been around a long time implement wrappers for this. Normally it
+ * will only be for DOS or Windows support. So this is the first time it
+ * has been done for five platforms, having a remarkably tiny footprint.
+ */
+/**
+ * Directory stream object.
+ */
struct dirstream {
int64_t tell;
int64_t fd;
@@ -57,6 +62,17 @@ struct dirstream {
};
};
+/**
+ * FreeBSD getdents() and XNU getdirentries() ABI.
+ */
+struct dirent$bsd {
+ uint32_t d_fileno;
+ uint16_t d_reclen;
+ uint8_t d_type;
+ uint8_t d_namlen;
+ char d_name[256];
+};
+
static textwindows noinline DIR *opendir$nt(const char *name) {
int len;
DIR *res;
@@ -132,17 +148,14 @@ static textwindows noinline struct dirent *readdir$nt(DIR *dir) {
DIR *opendir(const char *name) {
int fd;
DIR *res;
- if (!IsWindows() && !IsXnu()) {
+ if (!IsWindows()) {
res = NULL;
if ((fd = open(name, O_RDONLY | O_DIRECTORY | O_CLOEXEC)) != -1) {
if (!(res = fdopendir(fd))) close(fd);
}
return res;
- } else if (IsWindows()) {
- return opendir$nt(name);
} else {
- enosys(); /* TODO(jart): Implement me! */
- return NULL;
+ return opendir$nt(name);
}
}
@@ -156,7 +169,7 @@ DIR *opendir(const char *name) {
*/
DIR *fdopendir(int fd) {
DIR *dir;
- if (!IsWindows() && !IsXnu()) {
+ if (!IsWindows()) {
if ((dir = calloc(1, sizeof(*dir)))) {
dir->fd = fd;
return dir;
@@ -168,7 +181,7 @@ DIR *fdopendir(int fd) {
}
/**
- * Reads next entry from DIR.
+ * Reads next entry from directory stream.
*
* This API doesn't define any particular ordering.
*
@@ -178,31 +191,30 @@ DIR *fdopendir(int fd) {
*/
struct dirent *readdir(DIR *dir) {
int rc;
+ long basep;
struct dirent *ent;
- struct dirent$freebsd *freebsd;
+ struct dirent$bsd *bsd;
if (!IsWindows()) {
if (dir->buf_pos >= dir->buf_end) {
- if (!(rc = getdents(dir->fd, dir->buf,
- sizeof(dir->buf) - sizeof(dir->ent.d_name))) ||
- rc == -1) {
- return NULL;
- }
+ basep = dir->tell; /* <- what does xnu do */
+ rc = getdents(dir->fd, dir->buf, sizeof(dir->buf) - 256, &basep);
+ if (!rc || rc == -1) return NULL;
dir->buf_pos = 0;
dir->buf_end = rc;
}
- if (IsLinux()) {
+ if (IsLinux() || IsOpenbsd()) {
ent = (struct dirent *)(dir->buf + dir->buf_pos);
dir->buf_pos += ent->d_reclen;
dir->tell = ent->d_off;
} else {
- freebsd = (struct dirent$freebsd *)(dir->buf + dir->buf_pos);
- dir->buf_pos += freebsd->d_reclen;
+ bsd = (struct dirent$bsd *)(dir->buf + dir->buf_pos);
+ dir->buf_pos += bsd->d_reclen;
ent = &dir->ent;
- ent->d_ino = freebsd->d_fileno;
- ent->d_off = dir->tell++;
- ent->d_reclen = freebsd->d_reclen;
- ent->d_type = freebsd->d_type;
- memcpy(ent->d_name, freebsd->d_name, freebsd->d_namlen + 1);
+ ent->d_ino = bsd->d_fileno;
+ ent->d_off = IsXnu() ? (dir->tell = basep) : dir->tell++;
+ ent->d_reclen = bsd->d_reclen;
+ ent->d_type = bsd->d_type;
+ memcpy(ent->d_name, bsd->d_name, bsd->d_namlen + 1);
}
return ent;
} else {
diff --git a/libc/calls/hefty/fork-nt.c b/libc/calls/hefty/fork-nt.c
index 1fca62df..a511e879 100644
--- a/libc/calls/hefty/fork-nt.c
+++ b/libc/calls/hefty/fork-nt.c
@@ -17,18 +17,24 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/assert.h"
+#include "libc/bits/weaken.h"
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/ntspawn.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/calls/internal.h"
+#include "libc/calls/ntspawn.h"
#include "libc/fmt/itoa.h"
+#include "libc/nexgen32e/nt2sysv.h"
#include "libc/nt/enum/filemapflags.h"
#include "libc/nt/enum/pageflags.h"
#include "libc/nt/enum/startf.h"
+#include "libc/nt/enum/wt.h"
#include "libc/nt/ipc.h"
#include "libc/nt/memory.h"
#include "libc/nt/process.h"
#include "libc/nt/runtime.h"
+#include "libc/nt/signals.h"
+#include "libc/nt/synchronization.h"
+#include "libc/nt/thread.h"
+#include "libc/runtime/directmap.h"
#include "libc/runtime/memtrack.h"
#include "libc/runtime/runtime.h"
#include "libc/str/str.h"
@@ -71,9 +77,11 @@ textwindows void WinMainForked(void) {
jmp_buf jb;
char16_t *p;
uint64_t size;
+ uint32_t i, varlen;
+ struct DirectMap dm;
char16_t var[21 + 1 + 21 + 1];
- uint32_t i, varlen, protect, access, oldprot;
varlen = GetEnvironmentVariable(u"_FORK", var, ARRAYLEN(var));
+ SetEnvironmentVariable(u"_FORK", NULL);
if (!varlen || varlen >= ARRAYLEN(var)) return;
p = var;
h = ParseInt(&p);
@@ -84,39 +92,27 @@ textwindows void WinMainForked(void) {
ReadAll(h, &_mmi.p[i], sizeof(_mmi.p[i]));
addr = (void *)((uint64_t)_mmi.p[i].x << 16);
size = ((uint64_t)(_mmi.p[i].y - _mmi.p[i].x) << 16) + FRAMESIZE;
- switch (_mmi.p[i].prot & (PROT_READ | PROT_WRITE | PROT_EXEC)) {
- case PROT_READ | PROT_WRITE | PROT_EXEC:
- protect = kNtPageExecuteReadwrite;
- access = kNtFileMapRead | kNtFileMapWrite | kNtFileMapExecute;
- break;
- case PROT_READ | PROT_WRITE:
- protect = kNtPageReadwrite;
- access = kNtFileMapRead | kNtFileMapWrite;
- break;
- case PROT_READ:
- protect = kNtPageReadonly;
- access = kNtFileMapRead;
- break;
- default:
- protect = kNtPageNoaccess;
- access = 0;
- break;
- }
if (_mmi.p[i].flags & MAP_PRIVATE) {
- MapViewOfFileExNuma((_mmi.p[i].h = CreateFileMappingNuma(
- -1, NULL, kNtPageExecuteReadwrite, 0, size, NULL,
- kNtNumaNoPreferredNode)),
- kNtFileMapRead | kNtFileMapWrite | kNtFileMapExecute,
- 0, 0, size, addr, kNtNumaNoPreferredNode);
+ CloseHandle(_mmi.p[i].h);
+ _mmi.p[i].h =
+ __mmap$nt(addr, size, PROT_READ | PROT_WRITE | PROT_EXEC, -1, 0)
+ .maphandle;
ReadAll(h, addr, size);
- VirtualProtect(addr, size, protect, &oldprot);
} else {
- MapViewOfFileExNuma(_mmi.p[i].h, access, 0, 0, size, addr,
- kNtNumaNoPreferredNode);
+ MapViewOfFileExNuma(
+ _mmi.p[i].h,
+ (_mmi.p[i].prot & PROT_WRITE)
+ ? kNtFileMapWrite | kNtFileMapExecute | kNtFileMapRead
+ : kNtFileMapExecute | kNtFileMapRead,
+ 0, 0, size, addr, kNtNumaNoPreferredNode);
}
}
ReadAll(h, _edata, _end - _edata);
CloseHandle(h);
+ unsetenv("_FORK");
+ if (weaken(__wincrash$nt)) {
+ AddVectoredExceptionHandler(1, (void *)weaken(__wincrash$nt));
+ }
longjmp(jb, 1);
}
@@ -141,13 +137,18 @@ textwindows int fork$nt(void) {
startinfo.hStdInput = g_fds.p[0].handle;
startinfo.hStdOutput = g_fds.p[1].handle;
startinfo.hStdError = g_fds.p[2].handle;
- if (ntspawn(g_argv[0], g_argv, environ, &kNtIsInheritable, NULL, true, 0,
- NULL, &startinfo, &procinfo) != -1) {
+ if (ntspawn(g_argv, environ, &kNtIsInheritable, NULL, true, 0, NULL,
+ &startinfo, &procinfo) != -1) {
CloseHandle(reader);
CloseHandle(procinfo.hThread);
- g_fds.p[pid].kind = kFdProcess;
- g_fds.p[pid].handle = procinfo.hProcess;
- g_fds.p[pid].flags = O_CLOEXEC;
+ if (weaken(g_sighandrvas) &&
+ weaken(g_sighandrvas)[SIGCHLD] == SIG_IGN) {
+ CloseHandle(procinfo.hProcess);
+ } else {
+ g_fds.p[pid].kind = kFdProcess;
+ g_fds.p[pid].handle = procinfo.hProcess;
+ g_fds.p[pid].flags = O_CLOEXEC;
+ }
WriteAll(writer, jb, sizeof(jb));
WriteAll(writer, &_mmi.i, sizeof(_mmi.i));
for (i = 0; i < _mmi.i; ++i) {
diff --git a/libc/calls/hefty/internal.h b/libc/calls/hefty/internal.h
deleted file mode 100644
index e3e86cd0..00000000
--- a/libc/calls/hefty/internal.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifndef COSMOPOLITAN_LIBC_CALLS_HEFTY_INTERNAL_H_
-#define COSMOPOLITAN_LIBC_CALLS_HEFTY_INTERNAL_H_
-#if !(__ASSEMBLER__ + __LINKER__ + 0)
-COSMOPOLITAN_C_START_
-
-int faccessat$nt(int, const char *, int, uint32_t) hidden;
-int execve$nt(const char *, char *const[], char *const[]) hidden;
-int spawnve$nt(unsigned, int[3], const char *, char *const[],
- char *const[]) hidden;
-int spawnve$sysv(unsigned, int[3], const char *, char *const[],
- char *const[]) hidden;
-
-COSMOPOLITAN_C_END_
-#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
-#endif /* COSMOPOLITAN_LIBC_CALLS_HEFTY_INTERNAL_H_ */
diff --git a/libc/calls/hefty/mkvarargv.h b/libc/calls/hefty/mkvarargv.h
deleted file mode 100644
index 9a45b48f..00000000
--- a/libc/calls/hefty/mkvarargv.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef COSMOPOLITAN_LIBC_CALLS_HEFTY_MKVARARGV_H_
-#define COSMOPOLITAN_LIBC_CALLS_HEFTY_MKVARARGV_H_
-#include "libc/alg/arraylist2.internal.h"
-#if !(__ASSEMBLER__ + __LINKER__ + 0)
-COSMOPOLITAN_C_START_
-
-/**
- * Turns variadic program arguments into array.
- *
- * This is a support function for execl(), execlp(), spawnl(), etc.
- *
- * @note type signatures are fubar for these functions
- */
-forceinline void *mkvarargv(const char *arg1, va_list va) {
- size_t i, n;
- const char **p, *arg;
- i = 0;
- n = 0;
- p = NULL;
- arg = arg1;
- do {
- if (APPEND(&p, &i, &n, &arg) == -1) {
- free(p);
- return NULL;
- }
- } while ((arg = va_arg(va, const char *)));
- return p;
-}
-
-COSMOPOLITAN_C_END_
-#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
-#endif /* COSMOPOLITAN_LIBC_CALLS_HEFTY_MKVARARGV_H_ */
diff --git a/libc/calls/hefty/ntspawn.h b/libc/calls/hefty/ntspawn.h
deleted file mode 100644
index 519f638a..00000000
--- a/libc/calls/hefty/ntspawn.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef COSMOPOLITAN_LIBC_CALLS_HEFTY_NTSPAWN_H_
-#define COSMOPOLITAN_LIBC_CALLS_HEFTY_NTSPAWN_H_
-#if !(__ASSEMBLER__ + __LINKER__ + 0)
-COSMOPOLITAN_C_START_
-
-struct NtProcessInformation;
-struct NtSecurityAttributes;
-struct NtStartupInfo;
-
-char **sortenvp(char *const[]) hidden nodiscard paramsnonnull();
-char16_t *mkntcmdline(char *const[]) hidden nodiscard paramsnonnull();
-char16_t *mkntenvblock(char *const[]) hidden nodiscard paramsnonnull();
-int ntspawn(const char *, char *const[], char *const[],
- struct NtSecurityAttributes *, struct NtSecurityAttributes *,
- bool32, uint32_t, const char16_t *, const struct NtStartupInfo *,
- struct NtProcessInformation *) paramsnonnull((1, 2, 3, 9)) hidden;
-
-COSMOPOLITAN_C_END_
-#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
-#endif /* COSMOPOLITAN_LIBC_CALLS_HEFTY_NTSPAWN_H_ */
diff --git a/libc/calls/hefty/sortenvp.c b/libc/calls/hefty/sortenvp.c
deleted file mode 100644
index a402a2b1..00000000
--- a/libc/calls/hefty/sortenvp.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
-│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
-╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
-│ │
-│ Permission to use, copy, modify, and/or distribute this software for │
-│ any purpose with or without fee is hereby granted, provided that the │
-│ above copyright notice and this permission notice appear in all copies. │
-│ │
-│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
-│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
-│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
-│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
-│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
-│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
-│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
-│ PERFORMANCE OF THIS SOFTWARE. │
-╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
-#include "libc/alg/arraylist.internal.h"
-#include "libc/calls/hefty/ntspawn.h"
-#include "libc/dce.h"
-#include "libc/str/str.h"
-
-static int CompareStrings(const char *l, const char *r) {
- size_t i = 0;
- while (l[i] == r[i] && r[i]) ++i;
- return (l[i] & 0xff) - (r[i] & 0xff);
-}
-
-static void SortStrings(char **a, size_t n) {
- char *t;
- size_t i, j;
- for (i = 1; i < n; ++i) {
- for (t = a[i], j = i; j > 0 && CompareStrings(t, a[j - 1]) < 0; --j) {
- a[j] = a[j - 1];
- }
- a[j] = t;
- }
-}
-
-/**
- * Copies environment variable pointers and sorts them.
- *
- * This is useful for (a) binary searching; and (b) keeping the NT
- * Executive happy, which wants strings to be ordered by UNICODE
- * codepoint identifiers. That's basically what uint8_t comparisons on
- * UTF8-encoded data gives us.
- *
- * @param envp is a NULL-terminated string array
- * @return newly allocated sorted copy of envp pointer array
- */
-hidden textwindows nodiscard char **sortenvp(char *const envp[]) {
- char **copy;
- size_t n, size;
- n = 0;
- while (envp[n]) n++;
- size = (n + 1) * sizeof(char *);
- if ((copy = malloc(size))) {
- memcpy(copy, envp, size);
- SortStrings(copy, n);
- }
- return copy;
-}
diff --git a/libc/calls/hefty/spawn.h b/libc/calls/hefty/spawn.h
deleted file mode 100644
index da6f460d..00000000
--- a/libc/calls/hefty/spawn.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef COSMOPOLITAN_LIBC_CALLS_HEFTY_SPAWN_H_
-#define COSMOPOLITAN_LIBC_CALLS_HEFTY_SPAWN_H_
-
-#define SPAWN_DETACH 1
-#define SPAWN_TABULARASA 2
-
-#if !(__ASSEMBLER__ + __LINKER__ + 0)
-COSMOPOLITAN_C_START_
-
-int spawnve(unsigned, int[3], const char *, char *const[], char *const[])
- paramsnonnull((3, 4, 5));
-int spawnl(unsigned, int[3], const char *, const char *, ...) nullterminated()
- paramsnonnull((3, 4));
-int spawnlp(unsigned, int[3], const char *, const char *, ...) nullterminated()
- paramsnonnull((3, 4));
-int spawnle(unsigned, int[3], const char *, const char *, ...)
- nullterminated((1)) paramsnonnull((3, 4));
-int spawnv(unsigned, int[3], const char *, char *const[]) paramsnonnull((3, 4));
-int spawnvp(unsigned, int[3], const char *, char *const[])
- paramsnonnull((3, 4));
-int spawnvpe(unsigned, int[3], const char *, char *const[], char *const[])
- paramsnonnull((3, 4, 5));
-
-COSMOPOLITAN_C_END_
-#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
-#endif /* COSMOPOLITAN_LIBC_CALLS_HEFTY_SPAWN_H_ */
diff --git a/libc/calls/hefty/spawnl.c b/libc/calls/hefty/spawnl.c
deleted file mode 100644
index de0730a6..00000000
--- a/libc/calls/hefty/spawnl.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
-│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
-╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
-│ │
-│ Permission to use, copy, modify, and/or distribute this software for │
-│ any purpose with or without fee is hereby granted, provided that the │
-│ above copyright notice and this permission notice appear in all copies. │
-│ │
-│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
-│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
-│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
-│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
-│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
-│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
-│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
-│ PERFORMANCE OF THIS SOFTWARE. │
-╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/calls/hefty/mkvarargv.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/mem/mem.h"
-#include "libc/runtime/runtime.h"
-
-/**
- * Launches program, with current environment.
- *
- * @param stdiofds may optionally be passed to customize standard i/o
- * @param stdiofds[𝑖] may be -1 to receive a pipe() fd
- * @param prog is program to launch (may be PATH searched)
- * @param arg[0] is the name of the program to run
- * @param arg[1,n-2] optionally specify program arguments
- * @param arg[n-1] is NULL
- * @return pid of child, or -1 w/ errno
- */
-int spawnl(unsigned flags, int stdiofds[3], const char *exe, const char *arg,
- ... /*, NULL*/) {
- int rc;
- va_list va;
- void *argv;
- rc = -1;
- va_start(va, arg);
- if ((argv = mkvarargv(arg, va))) {
- rc = spawnve(flags, stdiofds, exe, argv, environ);
- free(argv);
- }
- va_end(va);
- return rc;
-}
diff --git a/libc/calls/hefty/spawnve-nt.c b/libc/calls/hefty/spawnve-nt.c
deleted file mode 100644
index 56edf6d6..00000000
--- a/libc/calls/hefty/spawnve-nt.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
-│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
-╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
-│ │
-│ Permission to use, copy, modify, and/or distribute this software for │
-│ any purpose with or without fee is hereby granted, provided that the │
-│ above copyright notice and this permission notice appear in all copies. │
-│ │
-│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
-│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
-│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
-│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
-│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
-│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
-│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
-│ PERFORMANCE OF THIS SOFTWARE. │
-╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/bits/xchg.h"
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/internal.h"
-#include "libc/calls/hefty/ntspawn.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/calls/internal.h"
-#include "libc/nt/enum/processcreationflags.h"
-#include "libc/nt/enum/startf.h"
-#include "libc/nt/files.h"
-#include "libc/nt/ipc.h"
-#include "libc/nt/process.h"
-#include "libc/nt/runtime.h"
-#include "libc/nt/startupinfo.h"
-#include "libc/nt/struct/processinformation.h"
-#include "libc/str/str.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/sysv/consts/o.h"
-
-textwindows int spawnve$nt(unsigned flags, int stdiofds[3], const char *program,
- char *const argv[], char *const envp[]) {
- int pid;
- size_t i;
- int tubes[3];
- int64_t handle, h, *x, *y;
- struct NtStartupInfo sti;
- struct NtProcessInformation procinfo;
-
- handle = 0;
- memset(&sti, 0, sizeof(sti));
- sti.cb = sizeof(sti);
- sti.dwFlags = kNtStartfUsestdhandles;
-
- if ((pid = __getemptyfd()) == -1) return -1;
-
- for (i = 0; i < 3; ++i) {
- if (stdiofds[i] == -1) {
- x = &h;
- y = &sti.stdiofds[i];
- if (kIoMotion[i]) xchg(&x, &y);
- if ((tubes[i] = __getemptyfd()) != -1 &&
- CreatePipe(x, y, &kNtIsInheritable, 0)) {
- g_fds.p[tubes[i]].handle = h;
- } else {
- handle = -1;
- }
- } else {
- sti.stdiofds[i] = g_fds.p[stdiofds[i]].handle;
- }
- }
-
- if (handle != -1 &&
- ntspawn(program, argv, envp, &kNtIsInheritable, NULL,
- (flags & SPAWN_TABULARASA) ? false : true,
- (flags & SPAWN_DETACH)
- ? (kNtCreateNewProcessGroup | kNtDetachedProcess |
- kNtCreateBreakawayFromJob)
- : 0,
- NULL, &sti, &procinfo) != -1) {
- CloseHandle(procinfo.hThread);
- handle = procinfo.hProcess;
- }
-
- for (i = 0; i < 3; ++i) {
- if (stdiofds[i] == -1) {
- if (handle != -1) {
- stdiofds[i] = tubes[i];
- g_fds.p[tubes[i]].kind = kFdFile;
- g_fds.p[tubes[i]].flags = 0;
- CloseHandle(sti.stdiofds[i]);
- } else {
- CloseHandle(tubes[i]);
- }
- }
- }
-
- g_fds.p[pid].kind = kFdProcess;
- g_fds.p[pid].handle = handle;
- g_fds.p[pid].flags = O_CLOEXEC;
- return pid;
-}
diff --git a/libc/calls/hefty/spawnve-sysv.c b/libc/calls/hefty/spawnve-sysv.c
deleted file mode 100644
index 2050d540..00000000
--- a/libc/calls/hefty/spawnve-sysv.c
+++ /dev/null
@@ -1,120 +0,0 @@
-/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
-│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
-╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
-│ │
-│ Permission to use, copy, modify, and/or distribute this software for │
-│ any purpose with or without fee is hereby granted, provided that the │
-│ above copyright notice and this permission notice appear in all copies. │
-│ │
-│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
-│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
-│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
-│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
-│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
-│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
-│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
-│ PERFORMANCE OF THIS SOFTWARE. │
-╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/assert.h"
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/internal.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/calls/internal.h"
-#include "libc/dce.h"
-#include "libc/fmt/conv.h"
-#include "libc/mem/mem.h"
-#include "libc/paths.h"
-#include "libc/runtime/runtime.h"
-#include "libc/str/str.h"
-#include "libc/sysv/consts/at.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/sysv/consts/o.h"
-
-int spawnve$sysv(unsigned flags, int stdiofds[3], const char *program,
- char *const argv[], char *const envp[]) {
- int rc, pid, fd;
- size_t i, j, len;
- int32_t tubes[3][2];
- char **argv2, MZqFpD[8];
- void *argv3;
-
- pid = 0;
- argv2 = NULL;
- argv3 = argv;
-
- /*
- * αcτµαlly pδrταblε εxεcµταblε w/ thompson shell script
- * morphology needs to be launched via command interpreter.
- */
- if (endswith(program, ".com") || endswith(program, ".exe")) {
- memset(MZqFpD, 0, sizeof(MZqFpD));
- fd = openat$sysv(AT_FDCWD, program, O_RDONLY, 0);
- read$sysv(fd, MZqFpD, sizeof(MZqFpD));
- close$sysv(fd);
- if (memcmp(MZqFpD, "MZqFpD", 6) == 0) {
- /*
- * If we got this:
- *
- * spawn(/bin/echo, [echo, hi, there])
- *
- * It will become this:
- *
- * spawn(/bin/sh, [sh, /bin/echo, hi, there])
- */
- len = 1;
- while (argv[len]) len++;
- if ((argv2 = malloc((2 + len + 1) * sizeof(char *)))) {
- i = 0, j = 1;
- argv2[i++] = "sh";
- argv2[i++] = program;
- while (j < len) argv2[i++] = argv[j++];
- argv2[i] = NULL;
- argv3 = argv2;
- program = "/bin/sh";
- }
- }
- }
-
- for (i = 0; i < 3; ++i) {
- if (stdiofds[i] == -1) {
- pid |= pipe$sysv(tubes[i]);
- }
- }
-
- if (pid != -1) {
- if ((pid = vfork()) == 0) {
- if (flags & SPAWN_DETACH) {
- if (setsid() == -1) abort();
- if ((rc = fork$sysv()) == -1) abort();
- if (rc > 0) _exit(0);
- }
- for (i = 0; i < 3; ++i) {
- if (stdiofds[i] == -1) {
- close$sysv(tubes[i][kIoMotion[i]]);
- fd = tubes[i][!kIoMotion[i]];
- } else {
- fd = stdiofds[i];
- }
- dup2$sysv(fd, i);
- }
- execve$sysv(program, argv3, envp);
- abort();
- }
- }
-
- for (i = 0; i < 3; ++i) {
- if (stdiofds[i] == -1) {
- close$sysv(tubes[i][!kIoMotion[i]]);
- fd = tubes[i][kIoMotion[i]];
- if (pid != -1) {
- stdiofds[i] = fd;
- } else {
- close$sysv(fd);
- }
- }
- }
-
- if (argv2) free(argv2);
- return pid;
-}
diff --git a/libc/calls/hefty/spawnve.c b/libc/calls/hefty/spawnve.c
deleted file mode 100644
index 06336506..00000000
--- a/libc/calls/hefty/spawnve.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
-│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
-╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
-│ │
-│ Permission to use, copy, modify, and/or distribute this software for │
-│ any purpose with or without fee is hereby granted, provided that the │
-│ above copyright notice and this permission notice appear in all copies. │
-│ │
-│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
-│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
-│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
-│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
-│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
-│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
-│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
-│ PERFORMANCE OF THIS SOFTWARE. │
-╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/bits/pushpop.h"
-#include "libc/calls/hefty/internal.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/dce.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/sysv/errfuns.h"
-
-/**
- * Launches program, e.g.
- *
- * char buf[2];
- * int ws, pid, fds[3] = {-1, -1, STDERR_FILENO};
- * CHECK_NE(-1, (pid = spawnve(0, fds, commandv("ssh"),
- * (char *const[]){"ssh", hostname, "cat", 0},
- * environ)));
- * CHECK_EQ(+2, write(fds[0], "hi", 2));
- * CHECK_NE(-1, close(fds[0]));
- * CHECK_EQ(+2, read(fds[1], buf, 2)));
- * CHECK_NE(-1, close(fds[1]));
- * CHECK_EQ(+0, memcmp(buf, "hi", 2)));
- * CHECK_NE(-1, waitpid(pid, &ws, 0));
- * CHECK_EQ(+0, WEXITSTATUS(ws));
- *
- * @param stdiofds may optionally be passed to customize standard i/o
- * @param stdiofds[𝑖] may be -1 to receive a pipe() fd
- * @param program will not be PATH searched, see commandv()
- * @param argv[0] is the name of the program to run
- * @param argv[1,n-2] optionally specify program arguments
- * @param argv[n-1] is NULL
- * @param envp[0,n-2] specifies "foo=bar" environment variables
- * @param envp[n-1] is NULL
- * @return pid of child, or -1 w/ errno
- * @deprecated just use vfork() and execve()
- */
-int spawnve(unsigned flags, int stdiofds[3], const char *program,
- char *const argv[], char *const envp[]) {
- if (!argv[0]) return einval();
- int defaultfds[3] = {pushpop(STDIN_FILENO), pushpop(STDOUT_FILENO),
- pushpop(STDERR_FILENO)};
- if (!IsWindows()) {
- return spawnve$sysv(flags, stdiofds ?: defaultfds, program, argv, envp);
- } else {
- return spawnve$nt(flags, stdiofds ?: defaultfds, program, argv, envp);
- }
-}
diff --git a/libc/calls/hefty/vfork.S b/libc/calls/hefty/vfork.S
index 9cbe0547..40f6ecfd 100644
--- a/libc/calls/hefty/vfork.S
+++ b/libc/calls/hefty/vfork.S
@@ -22,28 +22,50 @@
/ Forks process without copying page tables.
/
/ This is the same as fork() except it's optimized for the case
-/ where the caller invokes exec() immediately afterwards.
+/ where the caller invokes execve() immediately afterwards. You
+/ can also call functions like close(), dup2(), etc. You cannot
+/ call read() safely but you can call pread(). Call _exit() but
+/ don't call exit(). Look for the vforksafe function annotation
/
/ @return pid of child process or 0 if forked process
/ @returnstwice
-vfork: testb IsWindows()
+/ @vforksafe
+vfork:
+#if SupportsWindows()
+ testb IsWindows()
jnz fork$nt
+#endif
mov __NR_vfork(%rip),%eax
- cmp $-1,%eax
- je systemfive.enosys
- pop %rsi
+ pop %rsi # saves return address in a register
+#if SupportsBsd()
testb IsBsd()
jnz vfork.bsd
+#endif
syscall
- push %rsi
- cmp $-4095,%rax
+ push %rsi # note it happens twice in same page
+ cmp $-4095,%eax
jae systemfive.error
- ret
+0: ezlea __vforked,di
+ test %eax,%eax
+ jz 1f
+ decl (%rdi)
+ jns 2f # openbsd doesn't actually share mem
+1: incl (%rdi)
+2: ret
.endfn vfork,globl
+#if SupportsBsd()
vfork.bsd:
syscall
push %rsi
jc systemfive.errno
- ret
+#if SupportsXnu()
+ testb IsXnu()
+ jz 0b
+ neg %edx # edx is 0 for parent and 1 for child
+ not %edx # eax always returned with childs pid
+ and %edx,%eax
+#endif /* XNU */
+ jmp 0b
.endfn vfork.bsd
+#endif /* BSD */
diff --git a/libc/calls/internal.h b/libc/calls/internal.h
index 90b3707f..f1db931a 100644
--- a/libc/calls/internal.h
+++ b/libc/calls/internal.h
@@ -9,6 +9,7 @@
#include "libc/dce.h"
#include "libc/limits.h"
#include "libc/macros.h"
+#include "libc/nt/struct/ntexceptionpointers.h"
#include "libc/nt/struct/securityattributes.h"
#include "libc/nt/struct/startupinfo.h"
#include "libc/nt/struct/systeminfo.h"
@@ -37,7 +38,7 @@ struct IoctlPtmGet {
};
struct Fds {
- size_t f; // arbitrary free slot start search index
+ size_t f; // lowest free slot
size_t n; // monotonic capacity
struct Fd {
int64_t handle;
@@ -59,6 +60,7 @@ struct Fds {
extern const struct Fd kEmptyFd;
+hidden extern int __vforked;
hidden extern int g_sighandrvas[NSIG];
hidden extern struct Fds g_fds;
hidden extern struct NtSystemInfo g_ntsysteminfo;
@@ -91,6 +93,7 @@ forceinline size_t clampio(size_t size) {
char *getcwd$sysv(char *, u64) hidden;
i32 __dup3$sysv(i32, i32, i32) hidden;
+i32 __execve$sysv(const char *, char *const[], char *const[]) hidden;
i32 __fstat$sysv(i32, struct stat *) hidden;
i32 __fstatat$sysv(i32, const char *, struct stat *, i32) hidden;
i32 __pipe2$sysv(i32[hasatleast 2], u32) hidden;
@@ -119,7 +122,8 @@ i32 fsync$sysv(i32) hidden;
i32 ftruncate$sysv(i32, i64) hidden;
i32 futimes$sysv(i32, const struct timeval *) hidden;
i32 futimesat$sysv(i32, const char *, const struct timeval *) hidden;
-i32 getdents(i32, char *, u32) hidden;
+i32 getdents(i32, char *, u32, i64 *) hidden;
+i32 getitimer$sysv(i32, struct itimerval *) hidden;
i32 getppid$sysv(void) hidden;
i32 getpriority$sysv(i32, u32) hidden;
i32 getrlimit$sysv(i32, struct rlimit *) hidden;
@@ -150,7 +154,10 @@ i32 sched_setaffinity$sysv(i32, u64, const void *) hidden;
i32 sched_yield$sysv(void) hidden;
i32 setitimer$sysv(i32, const struct itimerval *, struct itimerval *) hidden;
i32 setpriority$sysv(i32, u32, i32) hidden;
+i32 setresgid$sysv(uint32_t, uint32_t, uint32_t) hidden;
+i32 setresuid$sysv(uint32_t, uint32_t, uint32_t) hidden;
i32 setrlimit$sysv(i32, const struct rlimit *) hidden;
+i32 setsid$sysv(void) hidden;
i32 sigaction$sysv(i32, const void *, void *, i64) hidden;
i32 sigprocmask$sysv(i32, const sigset *, sigset *, u64) hidden;
i32 sigsuspend$sysv(const sigset *, u64) hidden;
@@ -169,6 +176,7 @@ i64 copy_file_range$sysv(i32, long *, i32, long *, u64, u32) hidden;
i64 getrandom$sysv(void *, u64, u32) hidden;
i64 pread$sysv(i32, void *, u64, i64) hidden;
i64 preadv$sysv(i32, struct iovec *, i32, i64) hidden;
+i64 ptrace$sysv(int, i32, void *, void *) hidden;
i64 pwrite$sysv(i32, const void *, u64, i64) hidden;
i64 pwritev$sysv(i32, const struct iovec *, i32, i64) hidden;
i64 read$sysv(i32, void *, u64) hidden;
@@ -176,10 +184,6 @@ i64 sendfile$sysv(i32, i32, i64 *, u64) hidden;
i64 splice$sysv(i32, i64 *, i32, i64 *, u64, u32) hidden;
i64 vmsplice$sysv(i32, const struct iovec *, i64, u32) hidden;
i64 write$sysv(i32, const void *, u64) hidden;
-int getitimer$sysv(i32, struct itimerval *) hidden;
-int setresgid$sysv(uint32_t, uint32_t, uint32_t) hidden;
-int setresuid$sysv(uint32_t, uint32_t, uint32_t) hidden;
-int setsid$sysv(void) hidden;
u32 getgid$sysv(void) hidden;
u32 getpid$sysv(void) hidden;
u32 getsid$sysv(int) hidden;
@@ -248,6 +252,8 @@ int utimensat$nt(int, const char *, const struct timespec *, int) hidden;
int getrusage$nt(int, struct rusage *) hidden;
int setitimer$nt(int, const struct itimerval *, struct itimerval *) hidden;
int nanosleep$nt(const struct timespec *, struct timespec *) hidden;
+int faccessat$nt(int, const char *, int, uint32_t) hidden;
+int execve$nt(const char *, char *const[], char *const[]) hidden;
/*───────────────────────────────────────────────────────────────────────────│─╗
│ cosmopolitan § syscalls » windows nt » support ─╬─│┼
@@ -266,6 +272,7 @@ int ntaccesscheck(const char16_t *, u32) paramsnonnull() hidden;
int64_t __winerr(void) nocallback privileged;
int __mkntpath(const char *, char16_t[hasatleast PATH_MAX - 16]) hidden;
int __mkntpath2(const char *, char16_t[hasatleast PATH_MAX - 16], int) hidden;
+unsigned __wincrash$nt(struct NtExceptionPointers *);
/*───────────────────────────────────────────────────────────────────────────│─╗
│ cosmopolitan § syscalls » metal ─╬─│┼
diff --git a/libc/calls/ischardev.c b/libc/calls/ischardev.c
index cc1d6df3..c55b0037 100644
--- a/libc/calls/ischardev.c
+++ b/libc/calls/ischardev.c
@@ -17,12 +17,8 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
-#include "libc/calls/internal.h"
#include "libc/calls/struct/stat.h"
-#include "libc/dce.h"
#include "libc/errno.h"
-#include "libc/nt/enum/filetype.h"
-#include "libc/nt/files.h"
/**
* Returns true if file descriptor is backed by character i/o.
diff --git a/libc/calls/isexecutable.c b/libc/calls/isexecutable.c
index 4d70f22f..f79f7ca6 100644
--- a/libc/calls/isexecutable.c
+++ b/libc/calls/isexecutable.c
@@ -16,13 +16,15 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/calls/struct/stat.h"
#include "libc/calls/calls.h"
+#include "libc/calls/struct/stat.h"
#include "libc/sysv/consts/s.h"
/**
* Returns true if file exists and is executable.
+ *
* @see access(exe, X_OK) which is more accurate on NT
+ * @asyncsignalsafe
*/
bool isexecutable(const char *path) {
struct stat st;
diff --git a/libc/calls/hefty/mkntcmdline.c b/libc/calls/mkntcmdline.c
similarity index 55%
rename from libc/calls/hefty/mkntcmdline.c
rename to libc/calls/mkntcmdline.c
index db321546..a30b228a 100644
--- a/libc/calls/hefty/mkntcmdline.c
+++ b/libc/calls/mkntcmdline.c
@@ -16,31 +16,13 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/arraylist2.internal.h"
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/ntspawn.h"
-#include "libc/fmt/conv.h"
-#include "libc/macros.h"
+#include "libc/calls/ntspawn.h"
#include "libc/mem/mem.h"
-#include "libc/nexgen32e/hascharacter.internal.h"
-#include "libc/runtime/runtime.h"
-#include "libc/str/oldutf16.internal.h"
#include "libc/str/str.h"
-#include "libc/str/tpdecode.internal.h"
-#include "libc/sysv/consts/fileno.h"
+#include "libc/str/thompike.h"
+#include "libc/str/utf16.h"
#include "libc/sysv/errfuns.h"
-#define APPENDCHAR(C) \
- do { \
- if (mkntcmdline_append(&cmdline_p, &cmdline_i, &cmdline_n, C) == -1) { \
- goto error; \
- } \
- } while (0)
-
-static int mkntcmdline_append(char16_t **p, size_t *i, size_t *n, char16_t c) {
- return APPEND(p, i, n, &c);
-}
-
/**
* Converts System V argv to Windows-style command line.
*
@@ -53,45 +35,60 @@ static int mkntcmdline_append(char16_t **p, size_t *i, size_t *n, char16_t c) {
* @kudos Daniel Colascione for teaching how to quote
* @see libc/runtime/dosargv.c
*/
-hidden textwindows nodiscard char16_t *mkntcmdline(char *const argv[]) {
- wint_t wc;
- size_t i, j;
+textwindows int mkntcmdline(char16_t cmdline[ARG_MAX], char *const argv[]) {
+ uint64_t w;
+ wint_t x, y;
+ int slashes, n;
+ size_t i, j, k;
+ bool needsquote;
char16_t cbuf[2];
- char16_t *cmdline_p = NULL;
- size_t cmdline_i = 0;
- size_t cmdline_n = 0;
- if (argv[0]) {
- for (i = 0; argv[i]; ++i) {
- if (i) APPENDCHAR(u' ');
- bool needsquote = !argv[i] || !!argv[i][strcspn(argv[i], " \t\n\v\"")];
- if (needsquote) APPENDCHAR(u'"');
- for (j = 0;;) {
- if (needsquote) {
- int slashes = 0;
- while (argv[i][j] && argv[i][j] == u'\\') slashes++, j++;
- slashes <<= 1;
- if (argv[i][j] == u'"') slashes++;
- while (slashes--) APPENDCHAR(u'\\');
- }
- if (!argv[i][j]) break;
- j += abs(tpdecode(&argv[i][j], &wc));
- if (CONCAT(&cmdline_p, &cmdline_i, &cmdline_n, cbuf,
- abs(pututf16(cbuf, ARRAYLEN(cbuf), wc, false))) == -1) {
- goto error;
+ for (k = i = 0; argv[i]; ++i) {
+ if (i) {
+ cmdline[k++] = u' ';
+ if (k == ARG_MAX) return e2big();
+ }
+ needsquote = !*argv[i] || argv[i][strcspn(argv[i], " \t\n\v\"")];
+ if (needsquote) {
+ cmdline[k++] = u'"';
+ if (k == ARG_MAX) return e2big();
+ }
+ for (j = 0;;) {
+ if (needsquote) {
+ slashes = 0;
+ while (argv[i][j] && argv[i][j] == '\\') slashes++, j++;
+ slashes <<= 1;
+ if (argv[i][j] == '"') slashes++;
+ while (slashes--) {
+ cmdline[k++] = u'\\';
+ if (k == ARG_MAX) return e2big();
}
}
- if (needsquote) APPENDCHAR(u'"');
+ x = argv[i][j++] & 0xff;
+ if (x >= 0300) {
+ n = ThomPikeLen(x);
+ x = ThomPikeByte(x);
+ while (--n) {
+ if ((y = argv[i][j++] & 0xff)) {
+ x = ThomPikeMerge(x, y);
+ } else {
+ x = 0;
+ break;
+ }
+ }
+ }
+ if (!x) break;
+ if (!i && x == '/') x = '\\';
+ w = EncodeUtf16(x);
+ do {
+ cmdline[k++] = w;
+ if (k == ARG_MAX) return e2big();
+ } while ((w >>= 16));
}
- APPENDCHAR(u'\0');
- if (cmdline_i > CMD_MAX) {
- e2big();
- goto error;
+ if (needsquote) {
+ cmdline[k++] = u'"';
+ if (k == ARG_MAX) return e2big();
}
- } else {
- einval();
}
- return cmdline_p;
-error:
- free(cmdline_p);
- return NULL;
+ cmdline[k] = u'\0';
+ return 0;
}
diff --git a/libc/calls/hefty/mkntenvblock.c b/libc/calls/mkntenvblock.c
similarity index 63%
rename from libc/calls/hefty/mkntenvblock.c
rename to libc/calls/mkntenvblock.c
index f2e01e2c..0ec52f5e 100644
--- a/libc/calls/hefty/mkntenvblock.c
+++ b/libc/calls/mkntenvblock.c
@@ -17,15 +17,35 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/alg/arraylist2.internal.h"
-#include "libc/calls/hefty/ntspawn.h"
+#include "libc/calls/ntspawn.h"
#include "libc/fmt/conv.h"
#include "libc/macros.h"
+#include "libc/mem/alloca.h"
#include "libc/mem/mem.h"
#include "libc/str/oldutf16.internal.h"
#include "libc/str/str.h"
+#include "libc/str/thompike.h"
#include "libc/str/tpdecode.internal.h"
+#include "libc/str/utf16.h"
#include "libc/sysv/errfuns.h"
+static int CompareStrings(const char *l, const char *r) {
+ size_t i = 0;
+ while (l[i] == r[i] && r[i]) ++i;
+ return (l[i] & 0xff) - (r[i] & 0xff);
+}
+
+static void SortStrings(char **a, size_t n) {
+ char *t;
+ size_t i, j;
+ for (i = 1; i < n; ++i) {
+ for (t = a[i], j = i; j > 0 && CompareStrings(t, a[j - 1]) < 0; --j) {
+ a[j] = a[j - 1];
+ }
+ a[j] = t;
+ }
+}
+
/**
* Copies sorted environment variable block for Windows.
*
@@ -34,33 +54,40 @@
* @param envp is an a NULL-terminated array of UTF-8 strings
* @return freshly allocated lpEnvironment or NULL w/ errno
*/
-textwindows char16_t *mkntenvblock(char *const envp[]) {
- wint_t wc;
- size_t i, j, bi, bn;
- char16_t *bp, cbuf[2];
- unsigned consumed, produced;
- bi = 0;
- bn = 8;
- bp = NULL;
- if ((envp = sortenvp(envp)) && (bp = calloc(bn, sizeof(char16_t)))) {
- for (i = 0; envp[i]; ++i) {
- for (j = 0;; j += consumed) {
- consumed = abs(tpdecode(&envp[i][j], &wc));
- produced = abs(pututf16(cbuf, ARRAYLEN(cbuf), wc, false));
- if (CONCAT(&bp, &bi, &bn, cbuf, produced) == -1) goto error;
- if (!wc) break;
+textwindows int mkntenvblock(char16_t envvars[ARG_MAX], char *const envp[]) {
+ axdx_t rc;
+ uint64_t w;
+ char **vars;
+ wint_t x, y;
+ size_t i, j, k, n, m;
+ for (n = 0; envp[n];) n++;
+ vars = alloca(n * sizeof(char *));
+ memcpy(vars, envp, n * sizeof(char *));
+ SortStrings(vars, n);
+ for (k = i = 0; i < n; ++i) {
+ j = 0;
+ do {
+ x = vars[i][j++] & 0xff;
+ if (x >= 0200) {
+ if (x < 0300) continue;
+ m = ThomPikeLen(x);
+ x = ThomPikeByte(x);
+ while (--m) {
+ if ((y = vars[i][j++] & 0xff)) {
+ x = ThomPikeMerge(x, y);
+ } else {
+ x = 0;
+ break;
+ }
+ }
}
- }
- ++bi;
- if (bi > ENV_MAX) {
- e2big();
- goto error;
- }
- free(envp);
- return bp;
+ w = EncodeUtf16(x);
+ do {
+ envvars[k++] = w & 0xffff;
+ if (k == ARG_MAX) return e2big();
+ } while ((w >>= 16));
+ } while (x);
}
-error:
- free(envp);
- free(bp);
- return NULL;
+ envvars[k] = u'\0';
+ return 0;
}
diff --git a/libc/calls/ntcontext2linux.c b/libc/calls/ntcontext2linux.c
index 8675905b..d9815d9e 100644
--- a/libc/calls/ntcontext2linux.c
+++ b/libc/calls/ntcontext2linux.c
@@ -36,16 +36,6 @@ textwindows void ntcontext2linux(ucontext_t *ctx, const struct NtContext *cr) {
ctx->uc_mcontext.cs = cr->SegCs;
ctx->uc_mcontext.gs = cr->SegGs;
ctx->uc_mcontext.fs = cr->SegFs;
- ctx->uc_mcontext.fpregs = &ctx->fpustate;
- ctx->fpustate.cwd = cr->FltSave.ControlWord;
- ctx->fpustate.swd = cr->FltSave.StatusWord;
- ctx->fpustate.mxcsr = cr->FltSave.MxCsr;
- ctx->fpustate.mxcr_mask = cr->FltSave.MxCsr_Mask;
- /* copy r8,r9,r10,r11,r12,r13,r15 */
- memcpy(&ctx->uc_mcontext.r8, &cr->R8, 8 * sizeof(int64_t));
- /* copy st0-st7 as well as xmm0-xmm15 */
- memcpy(ctx->fpustate.st, &cr->FltSave.FloatRegisters,
- sizeof(ctx->fpustate.st) + sizeof(ctx->fpustate.xmm));
- memcpy(ctx->fpustate.st, &cr->FltSave.FloatRegisters,
- sizeof(ctx->fpustate.st) + sizeof(ctx->fpustate.xmm));
+ ctx->uc_mcontext.fpregs = &ctx->__fpustate;
+ memcpy(&ctx->__fpustate, &cr->FltSave, sizeof(ctx->__fpustate));
}
diff --git a/libc/calls/hefty/ntspawn.c b/libc/calls/ntspawn.c
similarity index 63%
rename from libc/calls/hefty/ntspawn.c
rename to libc/calls/ntspawn.c
index c03b293d..cbb2a799 100644
--- a/libc/calls/hefty/ntspawn.c
+++ b/libc/calls/ntspawn.c
@@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
@@ -16,21 +16,24 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
-#include "libc/alg/arraylist.internal.h"
-#include "libc/bits/bits.h"
-#include "libc/bits/safemacros.h"
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/ntspawn.h"
+#include "libc/bits/pushpop.h"
#include "libc/calls/internal.h"
-#include "libc/fmt/conv.h"
+#include "libc/calls/ntspawn.h"
+#include "libc/macros.h"
+#include "libc/nt/enum/filemapflags.h"
+#include "libc/nt/enum/pageflags.h"
#include "libc/nt/enum/processcreationflags.h"
+#include "libc/nt/memory.h"
#include "libc/nt/process.h"
#include "libc/nt/runtime.h"
-#include "libc/runtime/runtime.h"
-#include "libc/str/str.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/sysv/errfuns.h"
+#include "libc/nt/struct/processinformation.h"
+#include "libc/nt/struct/securityattributes.h"
+#include "libc/nt/struct/startupinfo.h"
+
+struct SpawnBlock {
+ char16_t cmdline[ARG_MAX];
+ char16_t envvars[ARG_MAX];
+};
/**
* Spawns process on Windows NT.
@@ -39,10 +42,8 @@
* translation and argv escaping. Please note this will NOT escape
* command interpreter syntax.
*
- * @param program will not be PATH searched, see commandv()
- * @param argv[0] is the name of the program to run
- * @param argv[1,n-2] optionally specifies program arguments
- * @param argv[n-1] is NULL
+ * @param prog won't be PATH searched
+ * @param argv specifies prog arguments
* @param envp[𝟶,m-2] specifies "foo=bar" environment variables, which
* don't need to be passed in sorted order; however, this function
* goes faster the closer they are to sorted
@@ -57,32 +58,44 @@
* @see spawnve() which abstracts this function
*/
textwindows int ntspawn(
- const char *program, char *const argv[], char *const envp[],
+ char *const argv[], char *const envp[],
struct NtSecurityAttributes *opt_lpProcessAttributes,
struct NtSecurityAttributes *opt_lpThreadAttributes, bool32 bInheritHandles,
uint32_t dwCreationFlags, const char16_t *opt_lpCurrentDirectory,
- /*nodiscard*/ const struct NtStartupInfo *lpStartupInfo,
+ const struct NtStartupInfo *lpStartupInfo,
struct NtProcessInformation *opt_out_lpProcessInformation) {
int rc;
- char16_t program16[PATH_MAX], *lpCommandLine, *lpEnvironment;
- lpCommandLine = NULL;
- lpEnvironment = NULL;
- if (__mkntpath(program, program16) != -1 &&
- (lpCommandLine = mkntcmdline(&argv[1])) &&
- (lpEnvironment = mkntenvblock(envp))) {
- if (CreateProcess(program16, lpCommandLine, opt_lpProcessAttributes,
- opt_lpThreadAttributes, bInheritHandles,
- dwCreationFlags | kNtCreateUnicodeEnvironment,
- lpEnvironment, opt_lpCurrentDirectory, lpStartupInfo,
- opt_out_lpProcessInformation)) {
- rc = 0;
- } else {
- rc = __winerr();
+ int64_t handle;
+ size_t blocksize;
+ struct SpawnBlock *block;
+ rc = -1;
+ block = NULL;
+ blocksize = ROUNDUP(sizeof(*block), FRAMESIZE);
+ if ((handle = CreateFileMappingNuma(
+ -1,
+ &(struct NtSecurityAttributes){sizeof(struct NtSecurityAttributes),
+ NULL, false},
+ pushpop(kNtPageReadwrite), 0, blocksize, NULL,
+ kNtNumaNoPreferredNode)) &&
+ (block =
+ MapViewOfFileExNuma(handle, kNtFileMapRead | kNtFileMapWrite, 0, 0,
+ blocksize, NULL, kNtNumaNoPreferredNode))) {
+ if (mkntcmdline(block->cmdline, argv) != -1 &&
+ mkntenvblock(block->envvars, envp) != -1) {
+ if (CreateProcess(NULL, block->cmdline, opt_lpProcessAttributes,
+ opt_lpThreadAttributes, bInheritHandles,
+ dwCreationFlags | kNtCreateUnicodeEnvironment,
+ block->envvars, opt_lpCurrentDirectory, lpStartupInfo,
+ opt_out_lpProcessInformation)) {
+ rc = 0;
+ } else {
+ __winerr();
+ }
}
} else {
- rc = -1;
+ __winerr();
}
- free(lpCommandLine);
- free(lpEnvironment);
+ if (block) UnmapViewOfFile(block);
+ if (handle) CloseHandle(handle);
return rc;
}
diff --git a/libc/calls/ntspawn.h b/libc/calls/ntspawn.h
new file mode 100644
index 00000000..e8c1a080
--- /dev/null
+++ b/libc/calls/ntspawn.h
@@ -0,0 +1,17 @@
+#ifndef COSMOPOLITAN_LIBC_CALLS_HEFTY_NTSPAWN_H_
+#define COSMOPOLITAN_LIBC_CALLS_HEFTY_NTSPAWN_H_
+#include "libc/nt/struct/processinformation.h"
+#include "libc/nt/struct/securityattributes.h"
+#include "libc/nt/struct/startupinfo.h"
+#if !(__ASSEMBLER__ + __LINKER__ + 0)
+COSMOPOLITAN_C_START_
+
+int mkntcmdline(char16_t[ARG_MAX], char *const[]) hidden;
+int mkntenvblock(char16_t[ARG_MAX], char *const[]) hidden;
+int ntspawn(char *const[], char *const[], struct NtSecurityAttributes *,
+ struct NtSecurityAttributes *, bool32, uint32_t, const char16_t *,
+ const struct NtStartupInfo *, struct NtProcessInformation *) hidden;
+
+COSMOPOLITAN_C_END_
+#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
+#endif /* COSMOPOLITAN_LIBC_CALLS_HEFTY_NTSPAWN_H_ */
diff --git a/libc/calls/onntconsoleevent.c b/libc/calls/onntconsoleevent.c
index 3c379b46..481a3b3c 100644
--- a/libc/calls/onntconsoleevent.c
+++ b/libc/calls/onntconsoleevent.c
@@ -45,5 +45,6 @@ textwindows bool32 onntconsoleevent(uint32_t CtrlType) {
}
memset(&info, 0, sizeof(info));
info.si_signo = sig;
- return __sigenter(sig, &info, NULL);
+ __sigenter(sig, &info, NULL);
+ return true;
}
diff --git a/libc/calls/open-nt.c b/libc/calls/open-nt.c
index c6ef3c42..a13db563 100644
--- a/libc/calls/open-nt.c
+++ b/libc/calls/open-nt.c
@@ -42,9 +42,13 @@ static textwindows int64_t open$nt$impl(const char *file, uint32_t flags,
if (__mkntpath2(file, file16, flags) == -1) return -1;
if ((handle = CreateFile(
file16,
- (flags & 0xf000000f) | (/* this is needed if we mmap(rwx+cow)
- nt is choosy about open() access */
- kNtGenericExecute | kNtFileGenericWrite),
+ (flags & 0xf000000f) |
+ (/* this is needed if we mmap(rwx+cow)
+ nt is choosy about open() access */
+ (flags & O_ACCMODE) == O_RDONLY
+ ? kNtGenericExecute | kNtFileGenericRead
+ : kNtGenericExecute | kNtFileGenericRead |
+ kNtFileGenericWrite),
(flags & O_EXCL)
? kNtFileShareExclusive
: kNtFileShareRead | kNtFileShareWrite | kNtFileShareDelete,
diff --git a/libc/calls/open.c b/libc/calls/open.c
index 5fd5547d..a34cb0cd 100644
--- a/libc/calls/open.c
+++ b/libc/calls/open.c
@@ -35,6 +35,8 @@
* ignored if O_CREAT or O_TMPFILE weren't passed
* @return number needing close(), or -1 w/ errno
* @note don't call open() from signal handlers
+ * @asyncsignalsafe
+ * @vforksafe
*/
nodiscard int open(const char *file, int flags, ...) {
va_list va;
diff --git a/libc/calls/pipe-nt.c b/libc/calls/pipe-nt.c
index 531b5498..042d1172 100644
--- a/libc/calls/pipe-nt.c
+++ b/libc/calls/pipe-nt.c
@@ -16,25 +16,67 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
+#include "libc/alg/reverse.h"
#include "libc/calls/internal.h"
+#include "libc/nt/createfile.h"
+#include "libc/nt/enum/accessmask.h"
+#include "libc/nt/enum/creationdisposition.h"
+#include "libc/nt/enum/filesharemode.h"
#include "libc/nt/ipc.h"
+#include "libc/nt/process.h"
#include "libc/nt/runtime.h"
#include "libc/sysv/consts/o.h"
-textwindows int pipe$nt(int pipefd[2], unsigned flags) {
- int reader, writer;
- if ((reader = __getemptyfd()) == -1) return -1;
- if ((writer = __getemptyfd()) == -1) return -1;
- if (CreatePipe(&g_fds.p[reader].handle, &g_fds.p[writer].handle,
- &kNtIsInheritable, 0)) {
- g_fds.p[reader].kind = kFdFile;
- g_fds.p[reader].flags = flags;
- g_fds.p[writer].kind = kFdFile;
- g_fds.p[writer].flags = flags;
- pipefd[0] = reader;
- pipefd[1] = writer;
- return 0;
- } else {
- return __winerr();
- }
+static const char kPipeNamePrefix[] = "\\\\?\\pipe\\cosmo\\";
+
+static size_t UintToChar16Array(char16_t *a, uint64_t i) {
+ size_t j = 0;
+ do {
+ a[j++] = i % 10 + '0';
+ i /= 10;
+ } while (i > 0);
+ a[j] = 0;
+ reverse(a, j);
+ return j;
+}
+
+static char16_t *CreatePipeName(char16_t *a) {
+ static long x;
+ unsigned i;
+ for (i = 0; kPipeNamePrefix[i]; ++i) a[i] = kPipeNamePrefix[i];
+ i += UintToChar16Array(a + i, GetCurrentProcessId());
+ a[i++] = u'-';
+ i += UintToChar16Array(a + i, GetCurrentProcessId());
+ a[i++] = u'-';
+ i += UintToChar16Array(a + i, x++);
+ a[i] = u'\0';
+ return a;
+}
+
+textwindows int pipe$nt(int pipefd[2], unsigned flags) {
+ int64_t hin, hout;
+ int reader, writer;
+ char16_t pipename[64];
+ CreatePipeName(pipename);
+ if ((hin = CreateNamedPipe(pipename, kNtPipeAccessInbound,
+ kNtPipeWait | kNtPipeReadmodeByte, 1, 65536, 65536,
+ 0, &kNtIsInheritable)) != -1) {
+ if ((hout = CreateFile(pipename, kNtGenericWrite, kNtFileShareWrite,
+ &kNtIsInheritable, kNtOpenExisting, 0, 0)) != -1) {
+ reader = __getemptyfd();
+ g_fds.p[reader].kind = kFdFile;
+ g_fds.p[reader].flags = flags;
+ g_fds.p[reader].handle = hin;
+ writer = __getemptyfd();
+ g_fds.p[writer].kind = kFdFile;
+ g_fds.p[writer].flags = flags;
+ g_fds.p[writer].handle = hout;
+ pipefd[0] = reader;
+ pipefd[1] = writer;
+ return 0;
+ } else {
+ CloseHandle(hin);
+ }
+ }
+ return __winerr();
}
diff --git a/libc/calls/pipe-sysv.S b/libc/calls/pipe-sysv.S
index 0e781211..a435f410 100644
--- a/libc/calls/pipe-sysv.S
+++ b/libc/calls/pipe-sysv.S
@@ -30,12 +30,14 @@
pipe$sysv:
push %rbp
mov %rsp,%rbp
- xor %esi,%esi # FreeBSD is pipe2()
+#if SupportsFreebsd()
+ xor %esi,%esi
+#endif
call __pipe$sysv
#if SupportsXnu()
- testb IsXnu() # XNU has special needs
+ testb IsXnu()
jz 1f
- cmp $-1,%eax
+ cmp $-1,%rax
je 1f
mov %eax,(%rdi)
mov %edx,4(%rdi)
diff --git a/libc/calls/pipe.c b/libc/calls/pipe.c
index 668eedf1..0fe2ca1a 100644
--- a/libc/calls/pipe.c
+++ b/libc/calls/pipe.c
@@ -22,7 +22,7 @@
#include "libc/sysv/errfuns.h"
/**
- * Creates file-less file descriptors for inter-process communication.
+ * Creates file-less file descriptors for interprocess communication.
*
* @param fd is (reader, writer)
* @return 0 on success or -1 w/ errno
diff --git a/libc/calls/pread.c b/libc/calls/pread.c
index 25f79db6..786adefb 100644
--- a/libc/calls/pread.c
+++ b/libc/calls/pread.c
@@ -37,6 +37,8 @@
* @return [1..size] bytes on success, 0 on EOF, or -1 w/ errno; with
* exception of size==0, in which case return zero means no error
* @see pwrite(), write()
+ * @asyncsignalsafe
+ * @vforksafe
*/
ssize_t pread(int fd, void *buf, size_t size, int64_t offset) {
ssize_t rc;
diff --git a/libc/calls/preadv.c b/libc/calls/preadv.c
index 578db4a7..5a95e808 100644
--- a/libc/calls/preadv.c
+++ b/libc/calls/preadv.c
@@ -34,6 +34,8 @@
* @param count is recommended to be 16 or fewer; if it exceeds IOV_MAX
* then the extra buffers are simply ignored
* @return number of bytes actually read, or -1 w/ errno
+ * @asyncsignalsafe
+ * @vforksafe
*/
ssize_t preadv(int fd, struct iovec *iovec, int count, int64_t off) {
static bool once, demodernize;
diff --git a/libc/alg/replacestr16.c b/libc/calls/ptrace.c
similarity index 80%
rename from libc/alg/replacestr16.c
rename to libc/calls/ptrace.c
index 3260643b..6b801da6 100644
--- a/libc/alg/replacestr16.c
+++ b/libc/calls/ptrace.c
@@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
@@ -16,16 +16,17 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
-#include "libc/alg/arraylist2.internal.h"
-#include "libc/bits/safemacros.h"
-#include "libc/str/str.h"
+#include "libc/calls/internal.h"
#include "libc/sysv/errfuns.h"
-#undef strlen
-#undef replacestr
-#define replacestr replacestr16
-#define memmem memmem16
-#define char char16_t
-#define strlen strlen16
-#include "libc/alg/replacestr.c"
+/**
+ * Traces process.
+ *
+ * @param request can be PTRACE_xxx
+ * @note de facto linux only atm
+ */
+long ptrace(int request, int pid, void *addr, void *data) {
+ /* TODO(jart): FreeBSD addr and data args are different */
+ if (request == -1) return einval(); /* see consts.sh */
+ return ptrace$sysv(request, pid, addr, data);
+}
diff --git a/libc/calls/pwrite.c b/libc/calls/pwrite.c
index c7a1d46d..53c355cd 100644
--- a/libc/calls/pwrite.c
+++ b/libc/calls/pwrite.c
@@ -34,6 +34,8 @@
* @return [1..size] bytes on success, or -1 w/ errno; noting zero is
* impossible unless size was passed as zero to do an error check
* @see pread(), write()
+ * @asyncsignalsafe
+ * @vforksafe
*/
ssize_t pwrite(int fd, const void *buf, size_t size, int64_t offset) {
ssize_t rc;
diff --git a/libc/calls/pwritev.c b/libc/calls/pwritev.c
index e6766fb2..d7068fdf 100644
--- a/libc/calls/pwritev.c
+++ b/libc/calls/pwritev.c
@@ -38,6 +38,8 @@
* @param count is recommended to be 16 or fewer; if it exceeds IOV_MAX
* then the extra buffers are simply ignored
* @return number of bytes actually sent, or -1 w/ errno
+ * @asyncsignalsafe
+ * @vforksafe
*/
ssize_t pwritev(int fd, const struct iovec *iovec, int count, int64_t off) {
static bool once, demodernize;
diff --git a/libc/calls/readv.c b/libc/calls/readv.c
index 5bb987e3..ba728f5d 100644
--- a/libc/calls/readv.c
+++ b/libc/calls/readv.c
@@ -28,6 +28,7 @@
* Reads data to multiple buffers.
*
* @return number of bytes actually read, or -1 w/ errno
+ * @asyncsignalsafe
*/
ssize_t readv(int fd, const struct iovec *iov, int iovlen) {
if (fd < 0) return einval();
diff --git a/libc/time/sleep.c b/libc/calls/sleep.c
similarity index 100%
rename from libc/time/sleep.c
rename to libc/calls/sleep.c
diff --git a/libc/calls/struct/dirent.h b/libc/calls/struct/dirent.h
index c19c825c..62271a71 100644
--- a/libc/calls/struct/dirent.h
+++ b/libc/calls/struct/dirent.h
@@ -2,7 +2,7 @@
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_DIRENT_H_
#if !(__ASSEMBLER__ + __LINKER__ + 0)
-struct dirent { /* linux getdents64 abi */
+struct dirent { /* openbsd and linux getdents64 abi */
uint64_t d_ino; /* inode number */
int64_t d_off; /* implementation-dependent location number */
uint16_t d_reclen; /* byte length of this whole struct and string */
diff --git a/libc/calls/struct/user_regs_struct.h b/libc/calls/struct/user_regs_struct.h
new file mode 100644
index 00000000..32a7cf76
--- /dev/null
+++ b/libc/calls/struct/user_regs_struct.h
@@ -0,0 +1,73 @@
+#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_USER_REGS_STRUCT_H_
+#define COSMOPOLITAN_LIBC_CALLS_STRUCT_USER_REGS_STRUCT_H_
+#if !(__ASSEMBLER__ + __LINKER__ + 0)
+COSMOPOLITAN_C_START_
+
+/**
+ * Linux Kernel user registers.
+ *
+ * @note superset of struct pt_regs
+ * @see ptrace() w/ PTRACE_SYSCALL
+ */
+struct user_regs_struct {
+ uint64_t r15;
+ uint64_t r14;
+ uint64_t r13;
+ uint64_t r12;
+ uint64_t rbp;
+ uint64_t rbx;
+ uint64_t r11;
+ uint64_t r10;
+ uint64_t r9;
+ uint64_t r8;
+ uint64_t rax;
+ uint64_t rcx;
+ uint64_t rdx;
+ uint64_t rsi;
+ uint64_t rdi;
+ uint64_t orig_rax;
+ uint64_t rip;
+ uint64_t cs;
+ uint64_t eflags;
+ uint64_t rsp;
+ uint64_t ss;
+ uint64_t fs_base;
+ uint64_t gs_base;
+ uint64_t ds;
+ uint64_t es;
+ uint64_t fs;
+ uint64_t gs;
+};
+
+struct useregs_struct$freebsd {
+ int64_t r15;
+ int64_t r14;
+ int64_t r13;
+ int64_t r12;
+ int64_t r11;
+ int64_t r10;
+ int64_t r9;
+ int64_t r8;
+ int64_t rdi;
+ int64_t rsi;
+ int64_t rbp;
+ int64_t rbx;
+ int64_t rdx;
+ int64_t rcx;
+ int64_t rax;
+ uint32_t trapno;
+ uint16_t fs;
+ uint16_t gs;
+ uint32_t err;
+ uint16_t es;
+ uint16_t ds;
+ int64_t rip;
+ int64_t cs;
+ int64_t rflags;
+ int64_t rsp;
+ int64_t ss;
+};
+
+COSMOPOLITAN_C_END_
+#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
+#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_USER_REGS_STRUCT_H_ */
diff --git a/libc/calls/thunks/fork-sysv.S b/libc/calls/thunks/fork-sysv.S
new file mode 100644
index 00000000..ee5d150b
--- /dev/null
+++ b/libc/calls/thunks/fork-sysv.S
@@ -0,0 +1,41 @@
+/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
+│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
+╞══════════════════════════════════════════════════════════════════════════════╡
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
+│ │
+│ Permission to use, copy, modify, and/or distribute this software for │
+│ any purpose with or without fee is hereby granted, provided that the │
+│ above copyright notice and this permission notice appear in all copies. │
+│ │
+│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
+│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
+│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
+│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
+│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
+│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
+│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
+│ PERFORMANCE OF THIS SOFTWARE. │
+╚─────────────────────────────────────────────────────────────────────────────*/
+#include "libc/dce.h"
+#include "libc/macros.h"
+
+/ Makes fork() kernel ABI consistent across UNIX systems.
+/
+/ @return 0 if parent, pid if child, or -1 on error
+fork$sysv:
+ push %rbp
+ mov %rsp,%rbp
+ .profilable
+ call __fork$sysv
+#if SupportsXnu()
+ testb IsXnu()
+ jz 1f
+ cmp $-1,%rax
+ je 1f
+ neg %edx # edx is 0 for parent and 1 for child
+ not %edx # eax always returned with childs pid
+ and %edx,%eax
+#endif
+1: pop %rbp
+ ret
+ .endfn fork$sysv,globl,hidden
diff --git a/libc/calls/thunks/ftruncate-sysv.S b/libc/calls/thunks/ftruncate-sysv.S
index 5819ff6d..050fa168 100644
--- a/libc/calls/thunks/ftruncate-sysv.S
+++ b/libc/calls/thunks/ftruncate-sysv.S
@@ -21,6 +21,6 @@
/ Directly calls ftruncate() impl on host o/s if available.
ftruncate$sysv:
- mov %rsp,%rdx # openbsd:pad
+ mov %rsi,%rdx # openbsd:pad
jmp __ftruncate$sysv
- .endfn ftruncate$sysv,globl
+ .endfn ftruncate$sysv,globl,hidden
diff --git a/libc/calls/thunks/lseek-sysv.S b/libc/calls/thunks/lseek-sysv.S
index 4f1983ab..7eece2cf 100644
--- a/libc/calls/thunks/lseek-sysv.S
+++ b/libc/calls/thunks/lseek-sysv.S
@@ -29,7 +29,7 @@ lseek$sysv:
cmovnz .Lzero(%rip),%rsi
#endif
jmp __lseek$sysv
- .endfn lseek$sysv,globl
+ .endfn lseek$sysv,globl,hidden
.rodata.cst8
.Lzero: .quad 0
diff --git a/libc/calls/thunks/mmap-sysv.S b/libc/calls/thunks/mmap-sysv.S
index 6b94204d..34574efe 100644
--- a/libc/calls/thunks/mmap-sysv.S
+++ b/libc/calls/thunks/mmap-sysv.S
@@ -27,4 +27,4 @@ mmap$sysv:
call __mmap$sysv
leave
ret
- .endfn mmap$sysv,globl
+ .endfn mmap$sysv,globl,hidden
diff --git a/libc/calls/thunks/onwincrash.S b/libc/calls/thunks/onwincrash.S
index 765dfd09..8f74e9f3 100644
--- a/libc/calls/thunks/onwincrash.S
+++ b/libc/calls/thunks/onwincrash.S
@@ -23,4 +23,4 @@
__wincrash$nt:
ezlea __wincrash,ax
jmp __nt2sysv
- .endfn __wincrash$nt,globl
+ .endfn __wincrash$nt,globl,hidden
diff --git a/libc/calls/thunks/pread-sysv.S b/libc/calls/thunks/pread-sysv.S
index eefdc3f8..ca544e24 100644
--- a/libc/calls/thunks/pread-sysv.S
+++ b/libc/calls/thunks/pread-sysv.S
@@ -23,4 +23,4 @@
pread$sysv:
mov %rcx,%r8 # openbsd:pad
jmp __pread$sysv
- .endfn pread$sysv,globl
+ .endfn pread$sysv,globl,hidden
diff --git a/libc/calls/thunks/preadv-sysv.S b/libc/calls/thunks/preadv-sysv.S
index 04ccc426..717695b0 100644
--- a/libc/calls/thunks/preadv-sysv.S
+++ b/libc/calls/thunks/preadv-sysv.S
@@ -23,4 +23,4 @@
preadv$sysv:
mov %rcx,%r8 # openbsd:pad
jmp __preadv$sysv
- .endfn preadv$sysv,globl
+ .endfn preadv$sysv,globl,hidden
diff --git a/libc/calls/thunks/pwrite-sysv.S b/libc/calls/thunks/pwrite-sysv.S
index 40754f4b..2cea4f80 100644
--- a/libc/calls/thunks/pwrite-sysv.S
+++ b/libc/calls/thunks/pwrite-sysv.S
@@ -23,4 +23,4 @@
pwrite$sysv:
mov %rcx,%r8 # openbsd:pad
jmp __pwrite$sysv
- .endfn pwrite$sysv,globl
+ .endfn pwrite$sysv,globl,hidden
diff --git a/libc/calls/thunks/pwritev-sysv.S b/libc/calls/thunks/pwritev-sysv.S
index 71e5b7ee..83217443 100644
--- a/libc/calls/thunks/pwritev-sysv.S
+++ b/libc/calls/thunks/pwritev-sysv.S
@@ -23,4 +23,4 @@
pwritev$sysv:
mov %rcx,%r8 # openbsd:pad
jmp __pwritev$sysv
- .endfn pwritev$sysv,globl
+ .endfn pwritev$sysv,globl,hidden
diff --git a/libc/calls/thunks/truncate-sysv.S b/libc/calls/thunks/truncate-sysv.S
index 9dc4a18d..bac70ef0 100644
--- a/libc/calls/thunks/truncate-sysv.S
+++ b/libc/calls/thunks/truncate-sysv.S
@@ -21,6 +21,6 @@
/ Directly calls truncate() impl on host o/s if available.
truncate$sysv:
- mov %rsp,%rdx # openbsd:pad
+ mov %rsi,%rdx # openbsd:pad
jmp __truncate$sysv
- .endfn truncate$sysv,globl
+ .endfn truncate$sysv,globl,hidden
diff --git a/libc/calls/ucontext.h b/libc/calls/ucontext.h
index 911a6ccc..4a08cf5a 100644
--- a/libc/calls/ucontext.h
+++ b/libc/calls/ucontext.h
@@ -144,9 +144,9 @@ struct ucontext {
};
struct ucontext *uc_link;
stack_t uc_stack;
- mcontext_t uc_mcontext;
- uint8_t uc_sigmask[128 + 16]; /* ?!? wut */
- struct FpuState fpustate;
+ mcontext_t uc_mcontext; /* use this */
+ sigset_t uc_sigmask;
+ struct FpuState __fpustate; /* for cosmo on non-linux */
};
typedef struct ucontext ucontext_t;
diff --git a/libc/calls/vdprintf.c b/libc/calls/vdprintf.c
index a66149dc..977d07b5 100644
--- a/libc/calls/vdprintf.c
+++ b/libc/calls/vdprintf.c
@@ -51,6 +51,8 @@ static int vdprintfputchar(int c, struct VdprintfState *df) {
/**
* Formats string directly to system i/o device.
+ * @asyncsignalsafe
+ * @vforksafe
*/
int(vdprintf)(int fd, const char *fmt, va_list va) {
struct VdprintfState df;
diff --git a/libc/alg/memmem16.c b/libc/calls/vforked.c
similarity index 86%
rename from libc/alg/memmem16.c
rename to libc/calls/vforked.c
index f7d58ac6..4cb33868 100644
--- a/libc/alg/memmem16.c
+++ b/libc/calls/vforked.c
@@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
@@ -16,14 +16,6 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
-#include "libc/mem/mem.h"
-#include "libc/str/str.h"
+#include "libc/calls/internal.h"
-#undef memmem
-#undef memchr
-#define char char16_t
-#define memmem memmem16
-#define memchr memchr16
-
-#include "libc/alg/memmem.c"
+int __vforked;
diff --git a/libc/calls/wait.c b/libc/calls/wait.c
index 8ec01db8..a0c4f85b 100644
--- a/libc/calls/wait.c
+++ b/libc/calls/wait.c
@@ -25,6 +25,7 @@
* may be inspected using WEEXITSTATUS(), etc.
* @return process id of terminated child or -1 w/ errno
* @asyncsignalsafe
+ * @vforksafe
*/
int wait(int *opt_out_wstatus) {
return wait4(-1, opt_out_wstatus, 0, NULL);
diff --git a/libc/calls/xnutrampoline.c b/libc/calls/xnutrampoline.c
index 6f70098e..ee0b7eb2 100644
--- a/libc/calls/xnutrampoline.c
+++ b/libc/calls/xnutrampoline.c
@@ -439,6 +439,7 @@ wontreturn void xnutrampoline(void *fn, int infostyle, int sig,
g.uc.uc_stack.ss_sp = xnuctx->uc_stack.ss_sp;
g.uc.uc_stack.ss_flags = xnuctx->uc_stack.ss_flags;
g.uc.uc_stack.ss_size = xnuctx->uc_stack.ss_size;
+ g.uc.uc_mcontext.fpregs = &g.uc.__fpustate;
if (xnuctx->uc_mcontext) {
if (xnuctx->uc_mcsize >= sizeof(struct __darwin_x86_exception_state64)) {
xnuexceptionstate2linux(&g.uc.uc_mcontext, &xnuctx->uc_mcontext->__es);
@@ -449,7 +450,7 @@ wontreturn void xnutrampoline(void *fn, int infostyle, int sig,
&xnuctx->uc_mcontext->__ss);
}
if (xnuctx->uc_mcsize >= sizeof(struct __darwin_mcontext64)) {
- xnussefpustate2linux(&g.uc.fpustate, &xnuctx->uc_mcontext->__fs);
+ xnussefpustate2linux(&g.uc.__fpustate, &xnuctx->uc_mcontext->__fs);
}
}
}
diff --git a/libc/dce.h b/libc/dce.h
index 24992054..c4bc0845 100644
--- a/libc/dce.h
+++ b/libc/dce.h
@@ -24,7 +24,7 @@
#define METAL 2
#define WINDOWS 4
#define XNU 8
-#define OPENBSD 16 /* 2019-12-11: new openbsd drm might thwart syscall */
+#define OPENBSD 16
#define FREEBSD 32
/* #define YOUR_CLOUD_PLATFORM_HERE 64 /\* jtunney@gmail.com *\/ */
/* #define YOUR_CLOUD_PLATFORM_HERE 128 /\* jtunney@gmail.com *\/ */
@@ -89,6 +89,7 @@
#define SupportsXnu() ((SUPPORT_VECTOR & XNU) == XNU)
#define SupportsFreebsd() ((SUPPORT_VECTOR & FREEBSD) == FREEBSD)
#define SupportsOpenbsd() ((SUPPORT_VECTOR & OPENBSD) == OPENBSD)
+#define SupportsBsd() (!!(SUPPORT_VECTOR & (XNU | FREEBSD | OPENBSD)))
#define SupportsSystemv() \
((SUPPORT_VECTOR & (LINUX | METAL | XNU | OPENBSD | FREEBSD)) != 0)
diff --git a/libc/fmt/palandprintf.c b/libc/fmt/palandprintf.c
index 674534ef..5531641f 100644
--- a/libc/fmt/palandprintf.c
+++ b/libc/fmt/palandprintf.c
@@ -115,6 +115,8 @@ static int ppatoi(const char **str) {
*
* @note implementation detail of printf(), snprintf(), etc.
* @see printf() for wordier documentation
+ * @asyncsignalsafe
+ * @vforksafe
*/
hidden int palandprintf(void *fn, void *arg, const char *format, va_list va) {
void *p;
diff --git a/libc/fmt/snprintf.c b/libc/fmt/snprintf.c
index 7b579fbc..afc94837 100644
--- a/libc/fmt/snprintf.c
+++ b/libc/fmt/snprintf.c
@@ -25,6 +25,8 @@
* if the output buffer wasn't passed, or was too short, then the
* number of characters that *would* have been written is returned
* @see palandprintf() and printf() for detailed documentation
+ * @asyncsignalsafe
+ * @vforksafe
*/
int(snprintf)(char* buf, size_t count, const char* fmt, ...) {
int rc;
diff --git a/libc/fmt/sprintf.c b/libc/fmt/sprintf.c
index 33cc6682..25cf3af2 100644
--- a/libc/fmt/sprintf.c
+++ b/libc/fmt/sprintf.c
@@ -24,6 +24,8 @@
*
* @see palandprintf() and printf() for detailed documentation
* @see snprintf() for same w/ buf size param
+ * @asyncsignalsafe
+ * @vforksafe
*/
int(sprintf)(char *buf, const char *fmt, ...) {
int rc;
diff --git a/libc/fmt/stoa.c b/libc/fmt/stoa.c
index e4aa3a91..097d8739 100644
--- a/libc/fmt/stoa.c
+++ b/libc/fmt/stoa.c
@@ -28,11 +28,12 @@
typedef int (*emit_f)(int (*)(long, void *), void *, wint_t);
-static int StoaEmitByte(int f(long, void *), void *a, wint_t c) {
+static noinstrument int StoaEmitByte(int f(long, void *), void *a, wint_t c) {
return f(c, a);
}
-static int StoaEmitWordEncodedString(int f(long, void *), void *a, uint64_t w) {
+static noinstrument int StoaEmitWordEncodedString(int f(long, void *), void *a,
+ uint64_t w) {
do {
if (f(w & 0xff, a) == -1) {
return -1;
@@ -41,7 +42,8 @@ static int StoaEmitWordEncodedString(int f(long, void *), void *a, uint64_t w) {
return 0;
}
-static int StoaEmitUnicode(int f(long, void *), void *a, wint_t c) {
+static noinstrument int StoaEmitUnicode(int f(long, void *), void *a,
+ wint_t c) {
if (isascii(c)) {
return f(c, a);
} else {
@@ -49,7 +51,7 @@ static int StoaEmitUnicode(int f(long, void *), void *a, wint_t c) {
}
}
-static int StoaEmitQuoted(int f(long, void *), void *a, wint_t c) {
+static noinstrument int StoaEmitQuoted(int f(long, void *), void *a, wint_t c) {
if (isascii(c)) {
return StoaEmitWordEncodedString(f, a, cescapec(c));
} else {
@@ -57,12 +59,14 @@ static int StoaEmitQuoted(int f(long, void *), void *a, wint_t c) {
}
}
-static int StoaEmitVisualized(int f(long, void *), void *a, wint_t c) {
+static noinstrument int StoaEmitVisualized(int f(long, void *), void *a,
+ wint_t c) {
return StoaEmitUnicode(f, a, (*weaken(kCp437))[c]);
}
-static int StoaEmitQuote(int out(long, void *), void *arg, unsigned flags,
- char ch, unsigned char signbit) {
+static noinstrument int StoaEmitQuote(int out(long, void *), void *arg,
+ unsigned flags, char ch,
+ unsigned char signbit) {
if (flags & FLAGS_REPR) {
if (signbit == 63) {
if (out('L', arg) == -1) return -1;
diff --git a/libc/fmt/vsnprintf.c b/libc/fmt/vsnprintf.c
index 37bfb157..f7a69db5 100644
--- a/libc/fmt/vsnprintf.c
+++ b/libc/fmt/vsnprintf.c
@@ -28,7 +28,8 @@ struct SprintfStr {
size_t n;
};
-static int vsnprintfputchar(unsigned char c, struct SprintfStr *str) {
+static noinstrument int vsnprintfputchar(unsigned char c,
+ struct SprintfStr *str) {
if (str->i < str->n) str->p[str->i] = c;
str->i++;
return 0;
@@ -44,6 +45,8 @@ static int vsnprintfputchar(unsigned char c, struct SprintfStr *str) {
* if the output buffer wasn't passed, or was too short, then the
* number of characters that *would* have been written is returned
* @see palandprintf() and printf() for detailed documentation
+ * @asyncsignalsafe
+ * @vforksafe
*/
int(vsnprintf)(char *buf, size_t size, const char *fmt, va_list va) {
struct SprintfStr str = {buf, 0, size};
diff --git a/libc/integral/normalize.inc b/libc/integral/normalize.inc
index ae09ea41..553d23ba 100644
--- a/libc/integral/normalize.inc
+++ b/libc/integral/normalize.inc
@@ -63,9 +63,7 @@
#define BUFSIZ 0x1000 /* best stdio default */
#define CACHELINE 0x40 /* nexgen32e */
#define CHAR_BIT 8 /* b/c von neumann */
-#define ENV_MAX 0x7fff /* b/c windows */
-#define ARG_MAX 0x3fff /* b/c windows */
-#define CMD_MAX 0x4000 /* b/c windows */
+#define ARG_MAX 0x8000 /* b/c windows */
#define PATH_MAX 248 /* b/c win32 apis limit ~248..260 */
#define NAME_MAX 63 /* b/c dns */
#define CHILD_MAX 25 /* only if malloc isn't linked */
diff --git a/libc/log/asan.c b/libc/log/asan.c
index 318c1d79..819e9a14 100644
--- a/libc/log/asan.c
+++ b/libc/log/asan.c
@@ -311,6 +311,11 @@ static void *__asan_pvalloc(size_t n) {
return __asan_valloc(ROUNDUP(n, PAGESIZE));
}
+static int __asan_malloc_trim(size_t pad) {
+ __asan_morgue_flush();
+ return dlmalloc_trim(pad);
+}
+
void __asan_register_globals(struct AsanGlobal g[], int n) {
unsigned i;
for (i = 0; i < n; ++i) {
@@ -382,6 +387,7 @@ void __asan_install_malloc_hooks(void) {
HOOK(hook$pvalloc, __asan_pvalloc);
HOOK(hook$realloc, __asan_realloc);
HOOK(hook$memalign, __asan_memalign);
+ HOOK(hook$malloc_trim, __asan_malloc_trim);
HOOK(hook$malloc_usable_size, __asan_malloc_usable_size);
}
diff --git a/libc/log/attachdebugger.c b/libc/log/attachdebugger.c
index 561c0335..c8677365 100644
--- a/libc/log/attachdebugger.c
+++ b/libc/log/attachdebugger.c
@@ -18,7 +18,6 @@
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/bits/safemacros.h"
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/fmt/fmt.h"
#include "libc/log/gdb.h"
#include "libc/log/log.h"
@@ -52,12 +51,12 @@
* @note this is called via eponymous spinlock macro wrapper
*/
relegated int(attachdebugger)(intptr_t continuetoaddr) {
- int ttyfd;
+ int pid, ttyfd;
struct StackFrame *bp;
char pidstr[11], breakcmd[40];
const char *se, *elf, *gdb, *rewind, *layout;
if (IsGenuineCosmo() || !(gdb = GetGdbPath()) ||
- (ttyfd = open(_PATH_TTY, O_RDWR, 0)) == -1) {
+ (ttyfd = open(_PATH_TTY, O_RDWR | O_CLOEXEC)) == -1) {
return -1;
}
write(ttyfd, RESTORE_TTY, strlen(RESTORE_TTY));
@@ -81,20 +80,24 @@ relegated int(attachdebugger)(intptr_t continuetoaddr) {
rewind = NULL;
breakcmd[0] = '\0';
}
- return spawnve(0, (int[3]){ttyfd, ttyfd, STDERR_FILENO}, gdb,
- (char *const[]){
- "gdb", "--tui",
- "-p", pidstr,
- se, elf,
- "-ex", "set osabi GNU/Linux",
- "-ex", "set complaints 0",
- "-ex", "set confirm off",
- "-ex", layout,
- "-ex", "layout reg",
- "-ex", "set var g_gdbsync = 1",
- "-q", rewind,
- breakcmd, "-ex",
- "c", NULL,
- },
- environ);
+ if (!(pid = vfork())) {
+ dup2(ttyfd, 0);
+ dup2(ttyfd, 1);
+ execv(gdb, (char *const[]){
+ "gdb", "--tui",
+ "-p", pidstr,
+ se, elf,
+ "-ex", "set osabi GNU/Linux",
+ "-ex", "set complaints 0",
+ "-ex", "set confirm off",
+ "-ex", layout,
+ "-ex", "layout reg",
+ "-ex", "set var g_gdbsync = 1",
+ "-q", rewind,
+ breakcmd, "-ex",
+ "c", NULL,
+ });
+ abort();
+ }
+ return pid;
}
diff --git a/libc/log/backtrace2.c b/libc/log/backtrace2.c
index f8d1c772..b45c4fb2 100644
--- a/libc/log/backtrace2.c
+++ b/libc/log/backtrace2.c
@@ -21,7 +21,6 @@
#include "libc/bits/safemacros.h"
#include "libc/bits/weaken.h"
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/dce.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/fmt.h"
@@ -32,6 +31,7 @@
#include "libc/runtime/symbols.internal.h"
#include "libc/str/str.h"
#include "libc/sysv/consts/fileno.h"
+#include "libc/sysv/consts/o.h"
#define kBacktraceMaxFrames 128
#define kBacktraceBufSize ((kBacktraceMaxFrames - 1) * (16 + 1))
@@ -40,7 +40,7 @@ static int PrintBacktraceUsingAddr2line(int fd, const struct StackFrame *bp) {
ssize_t got;
intptr_t addr;
size_t i, j, gi;
- int rc, pid, tubes[3];
+ int rc, pid, pipefds[2];
struct Garbages *garbage;
const struct StackFrame *frame;
const char *debugbin, *p1, *p2, *p3, *addr2line;
@@ -67,13 +67,16 @@ static int PrintBacktraceUsingAddr2line(int fd, const struct StackFrame *bp) {
j += snprintf(&buf[j], 17, "%#x", addr - 1) + 1;
}
argv[i++] = NULL;
- tubes[0] = STDIN_FILENO;
- tubes[1] = -1;
- tubes[2] = STDERR_FILENO;
- if ((pid = spawnve(0, tubes, addr2line, argv, environ)) == -1) {
- return -1;
+ pipe(pipefds);
+ if (!(pid = vfork())) {
+ dup2(pipefds[1], 1);
+ close(pipefds[0]);
+ close(pipefds[1]);
+ execvp(addr2line, argv);
+ abort();
}
- while ((got = read(tubes[1], buf, kBacktraceBufSize)) > 0) {
+ close(pipefds[1]);
+ while ((got = read(pipefds[0], buf, kBacktraceBufSize)) > 0) {
for (p1 = buf; got;) {
/*
* remove racist output from gnu tooling, that can't be disabled
@@ -95,7 +98,7 @@ static int PrintBacktraceUsingAddr2line(int fd, const struct StackFrame *bp) {
}
}
}
- close(tubes[1]);
+ close(pipefds[0]);
if (waitpid(pid, &rc, 0) == -1) return -1;
if (WEXITSTATUS(rc) != 0) return -1;
return 0;
diff --git a/libc/log/checkfail.c b/libc/log/checkfail.c
index e036bbe1..8e5a010e 100644
--- a/libc/log/checkfail.c
+++ b/libc/log/checkfail.c
@@ -46,18 +46,22 @@ relegated void __check_fail(const char *suffix, const char *opstr,
size_t i;
va_list va;
char sufbuf[8];
+ char hostname[32];
int lasterr = errno;
__start_fatal(file, line);
if (!memccpy(sufbuf, suffix, '\0', sizeof(sufbuf))) strcpy(sufbuf, "?");
strtoupper(sufbuf);
+ strcpy(hostname, "unknown");
+ gethostname(hostname, sizeof(hostname));
(dprintf)(STDERR_FILENO,
- "check failed\r\n"
+ "check failed on %s pid %d\r\n"
"\tCHECK_%s(%s, %s);\r\n"
"\t\t → %#lx (%s)\r\n"
"\t\t%s %#lx (%s)\r\n",
- sufbuf, wantstr, gotstr, want, wantstr, opstr, got, gotstr);
+ hostname, getpid(), sufbuf, wantstr, gotstr, want, wantstr, opstr,
+ got, gotstr);
if (!isempty(fmt)) {
(dprintf)(STDERR_FILENO, "\t");
diff --git a/libc/log/gdbexec.c b/libc/log/gdbexec.c
index a8346e04..d1df93bf 100644
--- a/libc/log/gdbexec.c
+++ b/libc/log/gdbexec.c
@@ -18,7 +18,6 @@
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/bits/safemacros.h"
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/fmt/fmt.h"
#include "libc/log/gdb.h"
#include "libc/log/log.h"
@@ -30,8 +29,8 @@
* Attachs GDB temporarilly, to do something like print a variable.
*/
int(gdbexec)(const char *cmd) {
- int ttyin, ttyout;
struct StackFrame *bp;
+ int pid, ttyin, ttyout;
intptr_t continuetoaddr;
const char *se, *elf, *gdb;
char pidstr[11], breakcmd[40];
@@ -45,33 +44,34 @@ int(gdbexec)(const char *cmd) {
}
bp = __builtin_frame_address(0);
continuetoaddr = bp->addr;
- snprintf(breakcmd, sizeof(breakcmd), "%s *%#p", "break", bp->addr);
-
- char *const args[] = {
- "gdb",
- "--nx",
- "--nh",
- "-p",
- pidstr,
- se,
- elf,
- "-ex",
- "set osabi GNU/Linux",
- "-ex",
- "set complaints 0",
- "-ex",
- "set confirm off",
- "-ex",
- "set var g_gdbsync = 1",
- "-q",
- "-ex",
- breakcmd,
- "-ex",
- cmd,
- "-ex",
- "quit",
- NULL,
- };
-
- return SYNCHRONIZE_DEBUGGER(spawnve(0, NULL, gdb, args, environ));
+ sprintf(breakcmd, "%s *%#p", "break", bp->addr);
+ if (!(pid = vfork())) {
+ execv(gdb, (char *const[]){
+ "gdb",
+ "--nx",
+ "--nh",
+ "-p",
+ pidstr,
+ se,
+ elf,
+ "-ex",
+ "set osabi GNU/Linux",
+ "-ex",
+ "set complaints 0",
+ "-ex",
+ "set confirm off",
+ "-ex",
+ "set var g_gdbsync = 1",
+ "-q",
+ "-ex",
+ breakcmd,
+ "-ex",
+ cmd,
+ "-ex",
+ "quit",
+ NULL,
+ });
+ abort();
+ }
+ return SYNCHRONIZE_DEBUGGER(pid);
}
diff --git a/libc/log/oncrash.c b/libc/log/oncrash.c
index 9eb14860..ecaff714 100644
--- a/libc/log/oncrash.c
+++ b/libc/log/oncrash.c
@@ -115,7 +115,11 @@ relegated static void ShowGeneralRegisters(int fd, ucontext_t *ctx) {
ctx->uc_mcontext.gregs[(unsigned)kGregOrder[i]]);
if (++j == 3) {
j = 0;
- memcpy(&st, (char *)&ctx->fpustate.st[k], sizeof(st));
+ if (ctx->uc_mcontext.fpregs) {
+ memcpy(&st, (char *)&ctx->uc_mcontext.fpregs->st[k], sizeof(st));
+ } else {
+ memset(&st, 0, sizeof(st));
+ }
(dprintf)(fd, " %s(%zu) %Lf", "ST", k, st);
++k;
write(fd, "\r\n", 2);
@@ -126,12 +130,15 @@ relegated static void ShowGeneralRegisters(int fd, ucontext_t *ctx) {
relegated static void ShowSseRegisters(int fd, ucontext_t *ctx) {
size_t i;
- write(fd, "\r\n\r\n", 4);
- for (i = 0; i < 8; ++i) {
- (dprintf)(fd, VEIL("r", "%s%-2zu %016lx%016lx %s%-2d %016lx%016lx\r\n"),
- "XMM", i + 0, ctx->fpustate.xmm[i + 0].u64[0],
- ctx->fpustate.xmm[i + 0].u64[1], "XMM", i + 8,
- ctx->fpustate.xmm[i + 8].u64[0], ctx->fpustate.xmm[i + 8].u64[1]);
+ if (ctx->uc_mcontext.fpregs) {
+ write(fd, "\r\n\r\n", 4);
+ for (i = 0; i < 8; ++i) {
+ (dprintf)(fd, VEIL("r", "%s%-2zu %016lx%016lx %s%-2d %016lx%016lx\r\n"),
+ "XMM", i + 0, ctx->uc_mcontext.fpregs->xmm[i + 0].u64[1],
+ ctx->uc_mcontext.fpregs->xmm[i + 0].u64[0], "XMM", i + 8,
+ ctx->uc_mcontext.fpregs->xmm[i + 8].u64[1],
+ ctx->uc_mcontext.fpregs->xmm[i + 8].u64[0]);
+ }
}
}
@@ -153,10 +160,14 @@ relegated static void ShowMemoryMappings(int outfd) {
relegated static void ShowCrashReport(int err, int fd, int sig,
ucontext_t *ctx) {
int i;
+ char hostname[64];
struct utsname names;
- (dprintf)(fd, VEIL("r", "\r\n%serror%s: Uncaught SIG%s\r\n %s\r\n %s\r\n"),
- RED2, RESET, TinyStrSignal(sig), getauxval(AT_EXECFN),
- strerror(err));
+ strcpy(hostname, "unknown");
+ gethostname(hostname, sizeof(hostname));
+ (dprintf)(
+ fd, VEIL("r", "\r\n%serror%s: Uncaught SIG%s on %s\r\n %s\r\n %s\r\n"),
+ RED2, RESET, TinyStrSignal(sig), hostname, getauxval(AT_EXECFN),
+ strerror(err));
if (uname(&names) != -1) {
(dprintf)(fd, VEIL("r", " %s %s %s %s\r\n"), names.sysname, names.nodename,
names.release, names.version);
diff --git a/libc/log/vflogf.c b/libc/log/vflogf.c
index c0552f47..b9653ae5 100644
--- a/libc/log/vflogf.c
+++ b/libc/log/vflogf.c
@@ -86,7 +86,7 @@ void(vflogf)(unsigned level, const char *file, int line, FILE *f,
long double t2;
const char *prog;
int64_t secs, nsec, dots;
- char timebuf[32], *timebufp;
+ char buf32[32], *buf32p;
if (!f) f = g_logfile;
if (fileno(f) == -1) return;
t2 = nowl();
@@ -94,17 +94,17 @@ void(vflogf)(unsigned level, const char *file, int line, FILE *f,
nsec = rem1000000000int64(t2 * 1e9L);
if (secs > ts.tv_sec) {
localtime_r(&secs, &tm);
- strftime(timebuf, sizeof(timebuf), "%Y-%m-%dT%H:%M:%S.", &tm);
- timebufp = timebuf;
+ strftime(buf32, sizeof(buf32), "%Y-%m-%dT%H:%M:%S.", &tm);
+ buf32p = buf32;
dots = nsec;
} else {
- timebufp = "--------------------";
+ buf32p = "--------------------";
dots = nsec - ts.tv_nsec;
}
ts.tv_sec = secs;
ts.tv_nsec = nsec;
prog = basename(program_invocation_name);
- if ((fprintf)(f, "%c%s%06ld:%s:%d:%.*s:%d] ", loglevel2char(level), timebufp,
+ if ((fprintf)(f, "%c%s%06ld:%s:%d:%.*s:%d] ", loglevel2char(level), buf32p,
rem1000000int64(div1000int64(dots)), file, line,
strchrnul(prog, '.') - prog, prog, getpid()) <= 0) {
vflogf_onfail(f);
@@ -114,7 +114,9 @@ void(vflogf)(unsigned level, const char *file, int line, FILE *f,
fputs("\n", f);
if (level == kLogFatal) {
__start_fatal(file, line);
- (dprintf)(STDERR_FILENO, "fatal error see logfile\n");
+ strcpy(buf32, "unknown");
+ gethostname(buf32, sizeof(buf32));
+ (dprintf)(STDERR_FILENO, "fatality %s pid %d\n", buf32, getpid());
__die();
unreachable;
}
diff --git a/libc/mem/hook/hook.h b/libc/mem/hook/hook.h
index b9c2b8fe..8d021698 100644
--- a/libc/mem/hook/hook.h
+++ b/libc/mem/hook/hook.h
@@ -11,6 +11,7 @@ extern void *(*hook$realloc)(void *, size_t);
extern void *(*hook$realloc_in_place)(void *, size_t);
extern void *(*hook$valloc)(size_t);
extern void *(*hook$pvalloc)(size_t);
+extern int (*hook$malloc_trim)(size_t);
extern size_t (*hook$malloc_usable_size)(const void *);
COSMOPOLITAN_C_END_
diff --git a/libc/mem/hook/malloc_trim.S b/libc/mem/hook/malloc_trim.S
new file mode 100644
index 00000000..46530b33
--- /dev/null
+++ b/libc/mem/hook/malloc_trim.S
@@ -0,0 +1,33 @@
+/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
+│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
+╞══════════════════════════════════════════════════════════════════════════════╡
+│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ │
+│ Permission to use, copy, modify, and/or distribute this software for │
+│ any purpose with or without fee is hereby granted, provided that the │
+│ above copyright notice and this permission notice appear in all copies. │
+│ │
+│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
+│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
+│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
+│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
+│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
+│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
+│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
+│ PERFORMANCE OF THIS SOFTWARE. │
+╚─────────────────────────────────────────────────────────────────────────────*/
+#include "libc/macros.h"
+.source __FILE__
+
+ .initbss 202,_init_malloc_trim
+hook$malloc_trim:
+ .quad 0
+ .endobj hook$malloc_trim,globl,hidden
+ .previous
+
+ .init.start 202,_init_malloc_trim
+ .hidden dlmalloc_trim
+ ezlea dlmalloc_trim,ax
+ stosq
+ yoink free
+ .init.end 202,_init_malloc_trim
diff --git a/libc/mem/malloc_trim.S b/libc/mem/malloc_trim.S
new file mode 100644
index 00000000..44d0d1fd
--- /dev/null
+++ b/libc/mem/malloc_trim.S
@@ -0,0 +1,27 @@
+/*-*- mode:unix-assembly; indent-tabs-mode:t; tab-width:8; coding:utf-8 -*-│
+│vi: set et ft=asm ts=8 tw=8 fenc=utf-8 :vi│
+╞══════════════════════════════════════════════════════════════════════════════╡
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
+│ │
+│ Permission to use, copy, modify, and/or distribute this software for │
+│ any purpose with or without fee is hereby granted, provided that the │
+│ above copyright notice and this permission notice appear in all copies. │
+│ │
+│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
+│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
+│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
+│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
+│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
+│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
+│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
+│ PERFORMANCE OF THIS SOFTWARE. │
+╚─────────────────────────────────────────────────────────────────────────────*/
+#include "libc/macros.h"
+
+/ Releases freed memory back to system.
+/
+/ @param rdi specifies bytes of memory to leave available
+/ @return 1 if it actually released any memory, else 0
+malloc_trim:
+ jmp *hook$malloc_trim(%rip)
+ .endfn malloc_trim,globl
diff --git a/libc/nexgen32e/environ.S b/libc/nexgen32e/environ.S
index 2a071dac..18585b65 100644
--- a/libc/nexgen32e/environ.S
+++ b/libc/nexgen32e/environ.S
@@ -22,7 +22,8 @@
/ Environment variable pointer list.
.bss
.align 8
-environ:.quad 0
+environ:
+ .quad 0
.endobj environ,globl
.previous
diff --git a/libc/nexgen32e/memcpy.S b/libc/nexgen32e/memcpy.S
index 6b7167d8..91840cbb 100644
--- a/libc/nexgen32e/memcpy.S
+++ b/libc/nexgen32e/memcpy.S
@@ -55,6 +55,7 @@ memcpy: mov %rdi,%rax
/ @mode long
.align 16
MemCpy: .leafprologue
+ .profilable
mov $.Lmemcpytab.ro.size,%ecx
cmp %rcx,%rdx
cmovb %rdx,%rcx
diff --git a/libc/nexgen32e/memset.S b/libc/nexgen32e/memset.S
index 82c15c12..c892e853 100644
--- a/libc/nexgen32e/memset.S
+++ b/libc/nexgen32e/memset.S
@@ -46,17 +46,15 @@ memset: mov %rdi,%rax
/ @mode long
MemSet: .leafprologue
.profilable
- push %rbx
- movd %esi,%xmm3
mov $.Lmemsettab.ro.size,%ecx
cmp %rcx,%rdx
cmovb %rdx,%rcx
- ezlea memsettab,bx
- jmp *(%rbx,%rcx,8)
+ jmp *memsettab(,%rcx,8)
.Lanchorpoint:
.L32r: cmp $1024,%rdx
jae .Lerms
-.L32: vpbroadcastb %xmm3,%ymm3
+.L32: vmovd %esi,%xmm3
+ vpbroadcastb %xmm3,%ymm3
mov $32,%ecx
1: lea 32(%rcx),%rcx
vmovdqu %ymm3,-64(%rdi,%rcx)
@@ -67,7 +65,8 @@ MemSet: .leafprologue
jmp .L0
.L16r: cmp $1024,%rdx
jae .Lerms
-.L16: pbroadcastb %xmm3
+.L16: movd %esi,%xmm3
+ pbroadcastb %xmm3
mov $16,%ecx
1: lea 16(%rcx),%rcx
movdqu %xmm3,-32(%rdi,%rcx)
@@ -75,19 +74,16 @@ MemSet: .leafprologue
ja 1b
movdqu %xmm3,-16(%rdi,%rdx)
pxor %xmm3,%xmm3
-.L0: pop %rbx
- .leafepilogue
-.L8: movzbq %sil,%rbx
- mov $0x0101010101010101,%rcx
- imul %rcx,%rbx
- mov %rbx,(%rdi)
- mov %rbx,-8(%rdi,%rdx)
+.L0: .leafepilogue
+.L8: movzbl %sil,%ecx
+ imul .Lb8(%rip),%rcx
+ mov %rcx,(%rdi)
+ mov %rcx,-8(%rdi,%rdx)
jmp .L0
-.L4: movzbl %sil,%ebx
- mov $0x01010101,%ecx
- imul %ecx,%ebx
- mov %ebx,(%rdi)
- mov %ebx,-4(%rdi,%rdx)
+.L4: movzbl %sil,%ecx
+ imul $0x01010101,%ecx,%ecx
+ mov %ecx,(%rdi)
+ mov %ecx,-4(%rdi,%rdx)
jmp .L0
.L3: mov %sil,2(%rdi)
.L2: mov %sil,1(%rdi)
@@ -103,6 +99,10 @@ MemSet: .leafprologue
jmp .L0
.endfn MemSet,globl,hidden
+ .rodata.cst8
+.Lb8: .quad 0x0101010101010101
+ .previous
+
.initro 300,_init_memset
memsettab.ro:
.byte .L0 - .Lanchorpoint
diff --git a/libc/nexgen32e/strcspn.S b/libc/nexgen32e/strcspn.S
index 21e65a20..9c7fadd3 100644
--- a/libc/nexgen32e/strcspn.S
+++ b/libc/nexgen32e/strcspn.S
@@ -19,15 +19,16 @@
#include "libc/macros.h"
/ Returns prefix length, consisting of chars not in reject.
-/ a.k.a. Return index of first byte that's in charset.
/
/ @param rdi is string
/ @param rsi is reject nul-terminated character set
+/ @return rax is index of first byte in charset
/ @see strspn(), strtok_r()
/ @asyncsignalsafe
strcspn:
push %rbp
mov %rsp,%rbp
+ .profilable
sub $16,%rsp
push %rdi
mov %rsi,%rdi
diff --git a/libc/nt/enum/wt.h b/libc/nt/enum/wt.h
new file mode 100644
index 00000000..0430e5da
--- /dev/null
+++ b/libc/nt/enum/wt.h
@@ -0,0 +1,10 @@
+#ifndef COSMOPOLITAN_LIBC_NT_ENUM_WT_H_
+#define COSMOPOLITAN_LIBC_NT_ENUM_WT_H_
+#if !(__ASSEMBLER__ + __LINKER__ + 0)
+COSMOPOLITAN_C_START_
+
+#define kNtWtExecuteonlyonce 8
+
+COSMOPOLITAN_C_END_
+#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
+#endif /* COSMOPOLITAN_LIBC_NT_ENUM_WT_H_ */
diff --git a/libc/nt/kernel32/RegisterWaitForSingleObject.s b/libc/nt/kernel32/RegisterWaitForSingleObject.s
index 0a36627d..0c055f91 100644
--- a/libc/nt/kernel32/RegisterWaitForSingleObject.s
+++ b/libc/nt/kernel32/RegisterWaitForSingleObject.s
@@ -1,2 +1,12 @@
.include "o/libc/nt/codegen.inc"
.imp kernel32,__imp_RegisterWaitForSingleObject,RegisterWaitForSingleObject,1191
+
+ .text.windows
+RegisterWaitForSingleObject:
+ push %rbp
+ mov %rsp,%rbp
+ .profilable
+ mov __imp_RegisterWaitForSingleObject(%rip),%rax
+ jmp __sysv2nt6
+ .endfn RegisterWaitForSingleObject,globl
+ .previous
diff --git a/libc/nt/master.sh b/libc/nt/master.sh
index 86e34c44..ae0099df 100755
--- a/libc/nt/master.sh
+++ b/libc/nt/master.sh
@@ -4689,7 +4689,7 @@ imp 'RegisterTouchWindow' RegisterTouchWindow user32 2275
imp 'RegisterUserApiHook' RegisterUserApiHook user32 2276
imp 'RegisterWaitChainCOMCallback' RegisterWaitChainCOMCallback advapi32 1695
imp 'RegisterWaitForInputIdle' RegisterWaitForInputIdle kernel32 1190
-imp 'RegisterWaitForSingleObject' RegisterWaitForSingleObject kernel32 1191
+imp 'RegisterWaitForSingleObject' RegisterWaitForSingleObject kernel32 1191 6
imp 'RegisterWaitForSingleObjectEx' RegisterWaitForSingleObjectEx KernelBase 1389
imp 'RegisterWaitUntilOOBECompleted' RegisterWaitUntilOOBECompleted kernel32 1193
imp 'RegisterWindowMessageA' RegisterWindowMessageA user32 2277
diff --git a/libc/nt/struct/context.h b/libc/nt/struct/context.h
index 1be8f2df..b6b911ed 100644
--- a/libc/nt/struct/context.h
+++ b/libc/nt/struct/context.h
@@ -5,9 +5,9 @@
struct NtM128A {
uint64_t Low;
int64_t High;
-} forcealign(16);
+};
-struct NtXmmSaveArea32 {
+struct NtXmmSaveArea32 { /* basically same as struct FpuState */
uint16_t ControlWord;
uint16_t StatusWord;
uint8_t TagWord;
@@ -53,7 +53,7 @@ struct NtContext {
uint64_t LastBranchFromRip;
uint64_t LastExceptionToRip;
uint64_t LastExceptionFromRip;
-} forcealign(16);
+};
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_NT_STRUCT_CONTEXT_H_ */
diff --git a/libc/nt/synchronization.h b/libc/nt/synchronization.h
index 331e0287..8b656755 100644
--- a/libc/nt/synchronization.h
+++ b/libc/nt/synchronization.h
@@ -50,6 +50,8 @@ COSMOPOLITAN_C_START_
typedef void (*NtTimerapcroutine)(void *lpArgToCompletionRoutine,
uint32_t dwTimerLowValue,
uint32_t dwTimerHighValue);
+typedef void (*NtWaitOrTimerCallback)(void *lpParameter,
+ bool32 TimerOrWaitFired);
void Sleep(uint32_t dwMilliseconds);
uint32_t SleepEx(uint32_t dwMilliseconds, bool32 bAlertable);
@@ -68,6 +70,10 @@ uint32_t WaitForSingleObjectEx(int64_t hHandle, uint32_t dwMilliseconds,
uint32_t WaitForMultipleObjectsEx(unsigned int nCount, const int64_t *lpHandles,
bool32 bWaitAll, uint32_t dwMilliseconds,
bool32 bAlertable);
+bool32 RegisterWaitForSingleObject(int64_t *phNewWaitObject, int64_t hObject,
+ NtWaitOrTimerCallback Callback,
+ void *Context, uint32_t dwMilliseconds,
+ uint32_t dwFlags);
int64_t CreateWaitableTimer(struct NtSecurityAttributes *lpTimerAttributes,
bool32 bManualReset, const char16_t *lpTimerName);
diff --git a/libc/runtime/directmap.c b/libc/runtime/directmap.c
index a917416d..9a4c8d6c 100644
--- a/libc/runtime/directmap.c
+++ b/libc/runtime/directmap.c
@@ -34,6 +34,8 @@ struct DirectMap __mmap(void *addr, size_t size, unsigned prot, unsigned flags,
return (struct DirectMap){mmap$sysv(addr, size, prot, flags, fd, off),
kNtInvalidHandleValue};
} else {
- return __mmap$nt(addr, size, prot, flags, fd, off);
+ return __mmap$nt(addr, size, prot,
+ fd != -1 ? g_fds.p[fd].handle : kNtInvalidHandleValue,
+ off);
}
}
diff --git a/libc/runtime/directmap.h b/libc/runtime/directmap.h
index ee3d3dba..4419c093 100644
--- a/libc/runtime/directmap.h
+++ b/libc/runtime/directmap.h
@@ -9,7 +9,7 @@ struct DirectMap {
};
struct DirectMap __mmap(void *, size_t, unsigned, unsigned, int, int64_t);
-struct DirectMap __mmap$nt(void *, size_t, unsigned, unsigned, int, int64_t);
+struct DirectMap __mmap$nt(void *, size_t, unsigned, int64_t, int64_t);
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
diff --git a/libc/runtime/directmapnt.c b/libc/runtime/directmapnt.c
index 8f1ed508..490c0ce3 100644
--- a/libc/runtime/directmapnt.c
+++ b/libc/runtime/directmapnt.c
@@ -17,33 +17,33 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/internal.h"
+#include "libc/nt/enum/filemapflags.h"
#include "libc/nt/enum/pageflags.h"
#include "libc/nt/memory.h"
#include "libc/nt/runtime.h"
#include "libc/runtime/directmap.h"
+#include "libc/sysv/consts/prot.h"
textwindows struct DirectMap __mmap$nt(void *addr, size_t size, unsigned prot,
- unsigned flags, int fd, int64_t off) {
- int64_t handle;
- struct DirectMap res;
- if (fd != -1) {
- handle = g_fds.p[fd].handle;
- } else {
- handle = kNtInvalidHandleValue;
- }
- if ((res.maphandle = CreateFileMappingNuma(
- handle, NULL, kNtPageExecuteReadwrite, size >> 32, size, NULL,
- kNtNumaNoPreferredNode))) {
- if (!(res.addr = MapViewOfFileExNuma(res.maphandle, fprot2nt(prot, flags),
- off >> 32, off, size, addr,
- kNtNumaNoPreferredNode))) {
- CloseHandle(res.maphandle);
- res.maphandle = kNtInvalidHandleValue;
- res.addr = (void *)(intptr_t)__winerr();
+ int64_t handle, int64_t off) {
+ struct DirectMap dm;
+ if ((dm.maphandle = CreateFileMappingNuma(
+ handle, &kNtIsInheritable,
+ (prot & PROT_WRITE) ? kNtPageExecuteReadwrite : kNtPageExecuteRead,
+ size >> 32, size, NULL, kNtNumaNoPreferredNode))) {
+ if (!(dm.addr = MapViewOfFileExNuma(
+ dm.maphandle,
+ (prot & PROT_WRITE)
+ ? kNtFileMapWrite | kNtFileMapExecute | kNtFileMapRead
+ : kNtFileMapExecute | kNtFileMapRead,
+ off >> 32, off, size, addr, kNtNumaNoPreferredNode))) {
+ CloseHandle(dm.maphandle);
+ dm.maphandle = kNtInvalidHandleValue;
+ dm.addr = (void *)(intptr_t)__winerr();
}
} else {
- res.maphandle = kNtInvalidHandleValue;
- res.addr = (void *)(intptr_t)__winerr();
+ dm.maphandle = kNtInvalidHandleValue;
+ dm.addr = (void *)(intptr_t)__winerr();
}
- return res;
+ return dm;
}
diff --git a/libc/stubs/exit.S b/libc/runtime/exit2.S
similarity index 85%
rename from libc/stubs/exit.S
rename to libc/runtime/exit2.S
index a570f009..a9bb626d 100644
--- a/libc/stubs/exit.S
+++ b/libc/runtime/exit2.S
@@ -16,22 +16,15 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "ape/macros.internal.h"
-.real
+#include "libc/macros.h"
+.privileged
.source __FILE__
-.code16 # ∩ .code32 ∩ .code64
-/ Linkable delegate for traditional Unix user process termination.
+/ Terminates process, ignoring destructors and atexit() handlers.
/
/ @param edi is exit code ∈ [0,256)
-/ @note cosmopolitan headers obfuscate this indirection
-/ @see libc/runtime/runtime.h
-/ @mode long,legacy,real
/ @asyncsignalsafe
+/ @vforksafe
/ @noreturn
-_exit: push %bp
- mov %sp,%bp
- .weak _Exit
- rlcall _Exit
- int3
- .endfn _exit,weak
+_exit: jmp _Exit
+ .endfn _exit,globl,protected
diff --git a/libc/runtime/_exit.S b/libc/runtime/exit3.S
similarity index 96%
rename from libc/runtime/_exit.S
rename to libc/runtime/exit3.S
index faf684da..5b12aa34 100644
--- a/libc/runtime/_exit.S
+++ b/libc/runtime/exit3.S
@@ -25,8 +25,9 @@
/ Terminates process, ignoring destructors and atexit() handlers.
/
/ @param edi is exit code ∈ [0,256)
-/ @note _exit() is same thing
/ @asyncsignalsafe
+/ @vforksafe
+/ @noreturn
_Exit: push %rbp
mov %rsp,%rbp
#if SupportsWindows()
@@ -38,7 +39,7 @@ _Exit: push %rbp
jmp 4b
0: int3 # @see setjmp() in WinMain()
#endif
-1: mov __NR_exit(%rip),%eax
+1: mov __NR_exit_group(%rip),%eax
syscall
cli
lidt 3f
@@ -46,4 +47,4 @@ _Exit: push %rbp
jmp 2b
3: .quad 0
.endfn _Exit,globl,protected
- .hidden __NR_exit
+ .hidden __NR_exit_group
diff --git a/libc/runtime/mmap.c b/libc/runtime/mmap.c
index 4b054c2d..381df6f1 100644
--- a/libc/runtime/mmap.c
+++ b/libc/runtime/mmap.c
@@ -66,6 +66,7 @@ void *mmap(void *addr, size_t size, int prot, int flags, int fd, int64_t off) {
if (!(!!(flags & MAP_ANONYMOUS) ^ (fd != -1))) return VIP(einval());
if (!(!!(flags & MAP_PRIVATE) ^ !!(flags & MAP_SHARED))) return VIP(einval());
if (fd == -1) size = ROUNDUP(size, FRAMESIZE);
+ if (IsWindows() && fd == -1) prot |= PROT_WRITE;
if (flags & MAP_FIXED) {
if (UntrackMemoryIntervals(addr, size) == -1) {
return MAP_FAILED;
diff --git a/libc/runtime/msync.c b/libc/runtime/msync.c
index 0c312336..6359652d 100644
--- a/libc/runtime/msync.c
+++ b/libc/runtime/msync.c
@@ -26,7 +26,8 @@
/**
* Synchronize memory mapping changes to disk.
*
- * Without this, there's no guarantee memory is written back to disk.
+ * Without this, there's no guarantee memory is written back to disk. In
+ * practice, what that means is just Windows NT.
*
* @param flags needs MS_ASYNC or MS_SYNC and can have MS_INVALIDATE
* @return 0 on success or -1 w/ errno
diff --git a/libc/runtime/munmap.c b/libc/runtime/munmap.c
index d5ff7154..891c43db 100644
--- a/libc/runtime/munmap.c
+++ b/libc/runtime/munmap.c
@@ -30,19 +30,20 @@
/**
* Releases memory pages.
*
+ * This function may be used to punch holes in existing mappings, but your
+ * mileage may vary on Windows.
+ *
* @param addr is a pointer within any memory mapped region the process
* has permission to control, such as address ranges returned by
* mmap(), the program image itself, etc.
- * @param size is the amount of memory to unmap, which needn't be a
- * multiple of FRAMESIZE, and may be a subset of that which was
- * mapped previously, and may punch holes in existing mappings,
- * but your mileage may vary on windows
+ * @param size is the amount of memory to unmap, which needs to be a
+ * multiple of FRAMESIZE for anonymous mappings, because windows
+ * and for files size needs to be perfect to the byte bc openbsd
* @return 0 on success, or -1 w/ errno
*/
int munmap(void *addr, size_t size) {
int rc;
if (!ALIGNED(addr) || !CANONICAL(addr) || !size) return einval();
- size = ROUNDUP(size, FRAMESIZE);
if (UntrackMemoryIntervals(addr, size) == -1) return -1;
if (IsWindows()) return 0;
return munmap$sysv(addr, size);
diff --git a/libc/runtime/print.greg.c b/libc/runtime/print.greg.c
index 23418e8d..6d06456b 100644
--- a/libc/runtime/print.greg.c
+++ b/libc/runtime/print.greg.c
@@ -30,13 +30,13 @@
static privileged void __print$nt(const void *data, size_t len) {
int64_t hand;
+ char xmm[256];
uint32_t wrote;
- char xmm[256] forcealign(16);
- savexmm(&xmm[128]);
+ savexmm(xmm + 128);
hand = __imp_GetStdHandle(kNtStdErrorHandle);
__imp_WriteFile(hand, data, len, &wrote, NULL);
__imp_FlushFileBuffers(hand);
- loadxmm(&xmm[128]);
+ loadxmm(xmm + 128);
}
/**
diff --git a/libc/runtime/stackchkfail.c b/libc/runtime/stackchkfail.c
index 1fd01592..a9a60410 100644
--- a/libc/runtime/stackchkfail.c
+++ b/libc/runtime/stackchkfail.c
@@ -44,7 +44,7 @@ void __stack_chk_fail(void) {
: "rcx", "r11", "cc", "memory");
asm volatile("syscall"
: "=a"(ax)
- : "0"(__NR_exit), "D"(pushpop(23))
+ : "0"(__NR_exit_group), "D"(pushpop(23))
: "rcx", "r11", "cc", "memory");
}
asm volatile("rep outsb"
diff --git a/libc/runtime/winmain.greg.c b/libc/runtime/winmain.greg.c
index a7b16e07..23ea5df9 100644
--- a/libc/runtime/winmain.greg.c
+++ b/libc/runtime/winmain.greg.c
@@ -36,6 +36,7 @@
#include "libc/nt/process.h"
#include "libc/nt/runtime.h"
#include "libc/nt/struct/teb.h"
+#include "libc/runtime/directmap.h"
#include "libc/runtime/internal.h"
#include "libc/runtime/memtrack.h"
#include "libc/runtime/runtime.h"
@@ -50,52 +51,34 @@
#define ADDRESS 0x77700000 /*0000*/
struct WinArgs {
- char *argv[512];
- char *envp[512];
- long auxv[1][2];
+ char *argv[4096];
+ char *envp[4096];
char argblock[ARG_MAX];
- char envblock[ENV_MAX];
+ char envblock[ARG_MAX];
};
-static struct CmdExe {
- bool result;
- struct OldNtConsole {
- uint32_t codepage;
- uint32_t mode;
- int64_t handle;
- } oldin, oldout;
-} g_cmdexe;
-
-static textwindows void RestoreCmdExe(void) {
- if (g_cmdexe.oldin.handle) {
- SetConsoleCP(g_cmdexe.oldin.codepage);
- SetConsoleMode(g_cmdexe.oldin.handle, g_cmdexe.oldin.mode);
- }
- if (g_cmdexe.oldout.handle) {
- SetConsoleOutputCP(g_cmdexe.oldout.codepage);
- SetConsoleMode(g_cmdexe.oldout.handle, g_cmdexe.oldout.mode);
- }
-}
-
static textwindows void SetTrueColor(void) {
SetEnvironmentVariable(u"TERM", u"xterm-truecolor");
}
+static textwindows void MakeLongDoubleLongAgain(void) {
+ int x87cw = 0x037f; /* let's hope win32 won't undo this */
+ asm volatile("fldcw\t%0" : /* no outputs */ : "m"(x87cw));
+}
+
static textwindows void NormalizeCmdExe(void) {
+ uint32_t mode;
int64_t handle, hstdin, hstdout, hstderr;
if ((int)weakaddr("v_ntsubsystem") == kNtImageSubsystemWindowsCui &&
NtGetVersion() >= kNtVersionWindows10) {
- atexit(RestoreCmdExe);
hstdin = GetStdHandle(pushpop(kNtStdInputHandle));
hstdout = GetStdHandle(pushpop(kNtStdOutputHandle));
hstderr = GetStdHandle(pushpop(kNtStdErrorHandle));
if (GetFileType((handle = hstdin)) == kNtFileTypeChar) {
SetTrueColor();
- g_cmdexe.oldin.handle = handle;
- g_cmdexe.oldin.codepage = GetConsoleCP();
SetConsoleCP(kNtCpUtf8);
- GetConsoleMode(handle, &g_cmdexe.oldin.mode);
- SetConsoleMode(handle, g_cmdexe.oldin.mode | kNtEnableProcessedInput |
+ GetConsoleMode(handle, &mode);
+ SetConsoleMode(handle, mode | kNtEnableProcessedInput |
kNtEnableEchoInput | kNtEnableLineInput |
kNtEnableWindowInput |
kNtEnableVirtualTerminalInput);
@@ -103,11 +86,9 @@ static textwindows void NormalizeCmdExe(void) {
if (GetFileType((handle = hstdout)) == kNtFileTypeChar ||
GetFileType((handle = hstderr)) == kNtFileTypeChar) {
SetTrueColor();
- g_cmdexe.oldout.handle = handle;
- g_cmdexe.oldout.codepage = GetConsoleOutputCP();
SetConsoleOutputCP(kNtCpUtf8);
- GetConsoleMode(handle, &g_cmdexe.oldout.mode);
- SetConsoleMode(handle, g_cmdexe.oldout.mode | kNtEnableProcessedOutput |
+ GetConsoleMode(handle, &mode);
+ SetConsoleMode(handle, mode | kNtEnableProcessedOutput |
kNtEnableWrapAtEolOutput |
(NtGetVersion() >= kNtVersionWindows10
? kNtEnableVirtualTerminalProcessing
@@ -116,44 +97,38 @@ static textwindows void NormalizeCmdExe(void) {
}
}
-static textwindows char *AllocateMemory(void *addr, size_t size, int64_t *h) {
- return MapViewOfFileExNuma(
- (*h = CreateFileMappingNuma(-1, NULL, pushpop(kNtPageExecuteReadwrite), 0,
- size, NULL, kNtNumaNoPreferredNode)),
- kNtFileMapRead | kNtFileMapWrite, 0, 0, size, addr,
- kNtNumaNoPreferredNode);
-}
-
static textwindows wontreturn void WinMainNew(void) {
int64_t h;
size_t size;
int i, count;
- uint64_t data;
+ long auxv[1][2];
struct WinArgs *wa;
const char16_t *env16;
NormalizeCmdExe();
*(/*unconst*/ int *)&__hostos = WINDOWS;
size = ROUNDUP(STACKSIZE + sizeof(struct WinArgs), FRAMESIZE);
- data = (intptr_t)AllocateMemory((char *)ADDRESS, size, &_mmi.p[0].h);
- _mmi.p[0].x = data >> 16;
- _mmi.p[0].y = (data >> 16) + ((size >> 16) - 1);
- _mmi.p[0].prot = PROT_READ | PROT_WRITE;
+ _mmi.p[0].h = __mmap$nt((char *)ADDRESS, size,
+ PROT_READ | PROT_WRITE | PROT_EXEC, -1, 0)
+ .maphandle;
+ _mmi.p[0].x = ADDRESS >> 16;
+ _mmi.p[0].y = (ADDRESS >> 16) + ((size >> 16) - 1);
+ _mmi.p[0].prot = PROT_READ | PROT_WRITE | PROT_EXEC;
_mmi.p[0].flags = MAP_PRIVATE | MAP_ANONYMOUS;
_mmi.i = pushpop(1L);
- wa = (struct WinArgs *)(data + size - sizeof(struct WinArgs));
- count = GetDosArgv(GetCommandLine(), wa->argblock, ARG_MAX, wa->argv, 512);
+ wa = (struct WinArgs *)(ADDRESS + size - sizeof(struct WinArgs));
+ count = GetDosArgv(GetCommandLine(), wa->argblock, ARG_MAX, wa->argv, 4096);
for (i = 0; wa->argv[0][i]; ++i) {
if (wa->argv[0][i] == '\\') {
wa->argv[0][i] = '/';
}
}
env16 = GetEnvironmentStrings();
- GetDosEnviron(env16, wa->envblock, ENV_MAX, wa->envp, 512);
+ GetDosEnviron(env16, wa->envblock, ARG_MAX, wa->envp, 4096);
FreeEnvironmentStrings(env16);
- wa->auxv[0][0] = pushpop(0L);
- wa->auxv[0][1] = pushpop(0L);
- _jmpstack((char *)data + STACKSIZE, _executive, count, wa->argv, wa->envp,
- wa->auxv);
+ auxv[0][0] = pushpop(0L);
+ auxv[0][1] = pushpop(0L);
+ _jmpstack((char *)ADDRESS + STACKSIZE, _executive, count, wa->argv, wa->envp,
+ auxv);
}
/**
@@ -182,7 +157,9 @@ static textwindows wontreturn void WinMainNew(void) {
* the downloads folder. Since we don't even use dynamic linking,
* we've cargo culted some API calls, that may harden against it.
*
- * 6. Finally, we need fork. Microsoft designed Windows to prevent us
+ * 6. Reconfigure x87 FPU so long double is actually long (80 bits).
+ *
+ * 7. Finally, we need fork. Microsoft designed Windows to prevent us
* from having fork() so we pass pipe handles in an environment
* variable literally copy all the memory.
*
@@ -190,6 +167,7 @@ static textwindows wontreturn void WinMainNew(void) {
*/
textwindows int64_t WinMain(int64_t hInstance, int64_t hPrevInstance,
const char *lpCmdLine, int nCmdShow) {
+ MakeLongDoubleLongAgain();
if (weaken(winsockinit)) weaken(winsockinit)();
if (weaken(WinMainForked)) weaken(WinMainForked)();
WinMainNew();
diff --git a/libc/sock/accept-nt.c b/libc/sock/accept-nt.c
index e3477128..faf33fb2 100644
--- a/libc/sock/accept-nt.c
+++ b/libc/sock/accept-nt.c
@@ -16,35 +16,39 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/assert.h"
#include "libc/calls/internal.h"
#include "libc/nt/files.h"
+#include "libc/nt/struct/pollfd.h"
#include "libc/nt/winsock.h"
#include "libc/sock/internal.h"
#include "libc/sock/yoink.inc"
#include "libc/sysv/consts/fio.h"
+#include "libc/sysv/consts/poll.h"
#include "libc/sysv/consts/sock.h"
#include "libc/sysv/errfuns.h"
textwindows int accept$nt(struct Fd *fd, void *addr, uint32_t *addrsize,
int flags) {
+ int64_t h;
int client;
uint32_t yes;
- assert(fd->kind == kFdSocket);
- if ((client = __getemptyfd()) == -1) return -1;
- if ((g_fds.p[client].handle = WSAAccept(fd->handle, addr, (int32_t *)addrsize,
- NULL, NULL)) != -1) {
- if (flags & SOCK_NONBLOCK) {
- yes = 1;
- if (__ioctlsocket$nt(g_fds.p[client].handle, FIONBIO, &yes) == -1) {
- __closesocket$nt(g_fds.p[client].handle);
- return __winsockerr();
+ for (;;) {
+ if (!WSAPoll(&(struct pollfd$nt){fd->handle, POLLIN}, 1, 1000)) continue;
+ if ((client = __getemptyfd()) == -1) return -1;
+ if ((h = WSAAccept(fd->handle, addr, (int32_t *)addrsize, 0, 0)) != -1) {
+ if (flags & SOCK_NONBLOCK) {
+ yes = 1;
+ if (__ioctlsocket$nt(g_fds.p[client].handle, FIONBIO, &yes) == -1) {
+ __closesocket$nt(g_fds.p[client].handle);
+ return __winsockerr();
+ }
}
+ g_fds.p[client].kind = kFdSocket;
+ g_fds.p[client].flags = flags;
+ g_fds.p[client].handle = h;
+ return client;
+ } else {
+ return __winsockerr();
}
- g_fds.p[client].kind = kFdSocket;
- g_fds.p[client].flags = flags;
- return client;
- } else {
- return __winsockerr();
}
}
diff --git a/libc/sock/accept-sysv.c b/libc/sock/accept-sysv.c
index 72092186..b1a5afbf 100644
--- a/libc/sock/accept-sysv.c
+++ b/libc/sock/accept-sysv.c
@@ -21,7 +21,7 @@
int accept$sysv(int server, void *addr, uint32_t *addrsize) {
int client;
- if ((client = __accept$sysv(server, addr, addrsize)) != -1 && IsBsd()) {
+ if ((client = __accept$sysv(server, addr, addrsize, 0)) != -1 && IsBsd()) {
sockaddr2linux(addr);
}
return client;
diff --git a/libc/sock/accept4-sysv.c b/libc/sock/accept4-sysv.c
index 0cef4f77..6f67da58 100644
--- a/libc/sock/accept4-sysv.c
+++ b/libc/sock/accept4-sysv.c
@@ -32,7 +32,8 @@ int accept4$sysv(int server, void *addr, uint32_t *addrsize, int flags) {
if (client == -1 && errno == ENOSYS) {
errno = olderr;
TriedAndTrue:
- client = fixupnewsockfd$sysv(__accept$sysv(server, addr, addrsize), flags);
+ client =
+ fixupnewsockfd$sysv(__accept$sysv(server, addr, addrsize, 0), flags);
} else if (SupportsLinux() && !once) {
once = true;
if (client == __NR_accept4_linux) {
diff --git a/libc/sock/internal.h b/libc/sock/internal.h
index 8e110925..c951c5d4 100644
--- a/libc/sock/internal.h
+++ b/libc/sock/internal.h
@@ -51,7 +51,7 @@ struct msghdr$bsd {
errno_t MapDosErrorToErrno(uint32_t);
-int32_t __accept$sysv(int32_t, void *, uint32_t *) nodiscard hidden;
+int32_t __accept$sysv(int32_t, void *, uint32_t *, int) nodiscard hidden;
int32_t __accept4$sysv(int32_t, void *, uint32_t *, int) nodiscard hidden;
int32_t __connect$sysv(int32_t, const void *, uint32_t) hidden;
int32_t __socket$sysv(int32_t, int32_t, int32_t) hidden;
@@ -82,7 +82,7 @@ int32_t epoll_create$sysv(int32_t) hidden;
int32_t epoll_ctl$sysv(int32_t, int32_t, int32_t, void *) hidden;
int32_t epoll_wait$sysv(int32_t, void *, int32_t, int32_t) hidden;
-int poll$nt(struct pollfd *, uint64_t, int32_t) hidden;
+int poll$nt(struct pollfd *, uint64_t, uint64_t) hidden;
int getsockopt$nt(struct Fd *, int, int, void *, uint32_t *) hidden;
int getsockname$nt(struct Fd *, void *, uint32_t *) hidden;
int getpeername$nt(struct Fd *, void *, uint32_t *) hidden;
diff --git a/libc/sock/poll-nt.c b/libc/sock/poll-nt.c
index a76fe840..825d4080 100644
--- a/libc/sock/poll-nt.c
+++ b/libc/sock/poll-nt.c
@@ -17,6 +17,7 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/internal.h"
+#include "libc/macros.h"
#include "libc/nt/struct/pollfd.h"
#include "libc/nt/winsock.h"
#include "libc/sock/internal.h"
@@ -24,9 +25,10 @@
#include "libc/sysv/consts/poll.h"
#include "libc/sysv/errfuns.h"
-textwindows int poll$nt(struct pollfd *fds, uint64_t nfds, int32_t timeout_ms) {
+textwindows int poll$nt(struct pollfd *fds, uint64_t nfds, uint64_t timeoutms) {
int got;
size_t i;
+ uint64_t waitfor;
struct pollfd$nt ntfds[64];
if (nfds > 64) return einval();
for (i = 0; i < nfds; ++i) {
@@ -34,12 +36,16 @@ textwindows int poll$nt(struct pollfd *fds, uint64_t nfds, int32_t timeout_ms) {
ntfds[i].handle = g_fds.p[fds[i].fd].handle;
ntfds[i].events = fds[i].events & (POLLPRI | POLLIN | POLLOUT);
}
- if ((got = WSAPoll(ntfds, nfds, timeout_ms)) != -1) {
- for (i = 0; i < nfds; ++i) {
- fds[i].revents = ntfds[i].revents;
+ for (;;) {
+ waitfor = MIN(1000, timeoutms); /* for ctrl+c */
+ if ((got = WSAPoll(ntfds, nfds, waitfor)) != -1) {
+ if (!got && (timeoutms -= waitfor)) continue;
+ for (i = 0; i < nfds; ++i) {
+ fds[i].revents = ntfds[i].revents;
+ }
+ return got;
+ } else {
+ return __winsockerr();
}
- return got;
- } else {
- return __winsockerr();
}
}
diff --git a/libc/sock/socket-nt.c b/libc/sock/socket-nt.c
index dfed3e0e..82fc1e02 100644
--- a/libc/sock/socket-nt.c
+++ b/libc/sock/socket-nt.c
@@ -31,8 +31,7 @@ textwindows int socket$nt(int family, int type, int protocol) {
uint32_t yes;
if ((fd = __getemptyfd()) == -1) return -1;
if ((g_fds.p[fd].handle = WSASocket(family, type & ~(CLOEXEC | NONBLOCK),
- protocol, NULL, 0, (type & CLOEXEC))) !=
- -1) {
+ protocol, NULL, 0, 0)) != -1) {
if (type & NONBLOCK) {
yes = 1;
if (__ioctlsocket$nt(g_fds.p[fd].handle, FIONBIO, &yes) == -1) {
diff --git a/libc/stdio/fputc.c b/libc/stdio/fputc.c
index 4f7a644e..1202a6ca 100644
--- a/libc/stdio/fputc.c
+++ b/libc/stdio/fputc.c
@@ -20,7 +20,7 @@
#include "libc/stdio/internal.h"
#include "libc/stdio/stdio.h"
-static noinline int __fputc(int c, FILE *f) {
+static noinstrument noinline int __fputc(int c, FILE *f) {
if (f->beg < f->size) {
f->buf[f->beg++] = c;
if (f->beg == f->size || f->bufmode == _IONBF ||
diff --git a/libc/stdio/getdelim.c b/libc/stdio/getdelim.c
index 61ce9646..6cbf0252 100644
--- a/libc/stdio/getdelim.c
+++ b/libc/stdio/getdelim.c
@@ -18,12 +18,11 @@
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/assert.h"
#include "libc/errno.h"
+#include "libc/macros.h"
#include "libc/mem/mem.h"
#include "libc/stdio/internal.h"
#include "libc/stdio/stdio.h"
-#define GETDELIM_MAX 65536
-
/**
* Reads string from stream.
*
@@ -42,6 +41,8 @@ ssize_t getdelim(char **line, size_t *n, int delim, FILE *f) {
assert((*line && *n) || (!*line && !*n));
ssize_t rc = -1;
size_t i = 0;
+ char *p2;
+ size_t n2;
int c;
for (;;) {
if ((c = getc(f)) == -1) {
@@ -49,9 +50,16 @@ ssize_t getdelim(char **line, size_t *n, int delim, FILE *f) {
if (feof(f) && i) rc = i;
break;
}
- if (i + 2 >= *n && !__grow(line, n, 1, 0)) {
- __fseterrno(f);
- break;
+ if (i + 2 > *n) {
+ n2 = MAX(11, *n);
+ n2 += n2 >> 1;
+ if ((p2 = realloc(*line, n2))) {
+ *line = p2;
+ *n = n2;
+ } else {
+ __fseterrno(f);
+ break;
+ }
}
if (((*line)[i++] = c) == delim) {
rc = i;
diff --git a/libc/stdio/system.c b/libc/stdio/system.c
index b297a945..a01c7fdb 100644
--- a/libc/stdio/system.c
+++ b/libc/stdio/system.c
@@ -18,7 +18,6 @@
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/bits/weaken.h"
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/paths.h"
@@ -34,18 +33,18 @@
* status that can be accessed using macros like WEXITSTATUS(s)
*/
int system(const char *cmdline) {
+ int pid, wstatus;
char comspec[128];
- int rc, pid, wstatus;
const char *prog, *arg;
if (weaken(fflush)) weaken(fflush)(NULL);
if (cmdline) {
- if ((pid = fork()) == -1) return -1;
+ if ((pid = vfork()) == -1) return -1;
if (!pid) {
strcpy(comspec, kNtSystemDirectory);
strcat(comspec, "cmd.exe");
prog = !IsWindows() ? _PATH_BSHELL : comspec;
arg = !IsWindows() ? "-c" : "/C";
- execve(prog, (char *const[]){prog, arg, cmdline, NULL}, environ);
+ execv(prog, (char *const[]){prog, arg, cmdline, NULL});
_exit(errno);
} else if (wait4(pid, &wstatus, 0, NULL) != -1) {
return wstatus;
diff --git a/libc/stdio/vfprintf.c b/libc/stdio/vfprintf.c
index 0f8226e8..d94506ad 100644
--- a/libc/stdio/vfprintf.c
+++ b/libc/stdio/vfprintf.c
@@ -26,7 +26,7 @@ struct state {
int n;
};
-static int vfprintfputchar(int c, struct state *st) {
+static noinstrument int vfprintfputchar(int c, struct state *st) {
st->n++;
return fputc(c, st->f);
}
diff --git a/libc/str/chomp.c b/libc/str/chomp.c
index 3e6ba362..41c97b37 100644
--- a/libc/str/chomp.c
+++ b/libc/str/chomp.c
@@ -26,11 +26,13 @@
*/
char *chomp(char *line) {
size_t i;
- for (i = strlen(line); i--;) {
- if (line[i] == '\r' || line[i] == '\n') {
- line[i] = '\0';
- } else {
- break;
+ if (line) {
+ for (i = strlen(line); i--;) {
+ if (line[i] == '\r' || line[i] == '\n') {
+ line[i] = '\0';
+ } else {
+ break;
+ }
}
}
return line;
diff --git a/libc/alg/memmem.c b/libc/str/memmem.c
similarity index 92%
rename from libc/alg/memmem.c
rename to libc/str/memmem.c
index d80151ce..c20622e4 100644
--- a/libc/alg/memmem.c
+++ b/libc/str/memmem.c
@@ -16,9 +16,8 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
#include "libc/macros.h"
-#include "libc/mem/mem.h"
+#include "libc/mem/alloca.h"
#include "libc/str/str.h"
static void KnuthMorrisPrattInit(ssize_t m, ssize_t *T, const char *W) {
@@ -62,8 +61,8 @@ static size_t KnuthMorrisPratt(long m, const long *T, const char *W, long n,
* @param needlelen is its character count
* @return pointer to first result or NULL if not found
*/
-void *(memmem)(const void *haystackp, size_t haystacklen, const void *needlep,
- size_t needlelen) {
+void *memmem(const void *haystackp, size_t haystacklen, const void *needlep,
+ size_t needlelen) {
long *T;
size_t i;
const char *haystack, *needle, *h;
@@ -77,10 +76,9 @@ void *(memmem)(const void *haystackp, size_t haystacklen, const void *needlep,
if (needlelen < haystacklen && memcmp(h, needle, needlelen) == 0) {
return h;
} else {
- T = malloc((needlelen + 1) * sizeof(long));
+ T = alloca((needlelen + 1) * sizeof(long));
KnuthMorrisPrattInit(needlelen, T, needle);
i = KnuthMorrisPratt(needlelen, T, needle, haystacklen, h);
- free(T);
- return i < haystacklen ? h + i * sizeof(char) : NULL;
+ return i < haystacklen ? h + i : NULL;
}
}
diff --git a/libc/str/str.h b/libc/str/str.h
index a21a2a42..8f814355 100644
--- a/libc/str/str.h
+++ b/libc/str/str.h
@@ -175,6 +175,8 @@ compatfn wchar_t *wmemcpy(wchar_t *, const wchar_t *, size_t) memcpyesque;
compatfn wchar_t *wmempcpy(wchar_t *, const wchar_t *, size_t) memcpyesque;
compatfn wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t) memcpyesque;
int timingsafe_memcmp(const void *, const void *, size_t);
+void *memmem(const void *, size_t, const void *, size_t)
+ paramsnonnull() nothrow nocallback nosideeffect;
char *tinystrstr(const char *, const char *) strlenesque;
char16_t *tinystrstr16(const char16_t *, const char16_t *) strlenesque;
diff --git a/libc/str/str.mk b/libc/str/str.mk
index e54a8fd4..87d8cf66 100644
--- a/libc/str/str.mk
+++ b/libc/str/str.mk
@@ -42,6 +42,10 @@ $(LIBC_STR_A).pkg: \
$(LIBC_STR_A_OBJS) \
$(foreach x,$(LIBC_STR_A_DIRECTDEPS),$($(x)_A).pkg)
+o/$(MODE)/libc/str/memmem.o: \
+ OVERRIDE_CPPFLAGS += \
+ -DSTACK_FRAME_UNLIMITED
+
LIBC_STR_LIBS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)))
LIBC_STR_SRCS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_SRCS))
LIBC_STR_HDRS = $(foreach x,$(LIBC_STR_ARTIFACTS),$($(x)_HDRS))
diff --git a/libc/str/strcat.c b/libc/str/strcat.c
index 0956fa04..814d941c 100644
--- a/libc/str/strcat.c
+++ b/libc/str/strcat.c
@@ -26,4 +26,6 @@
* @return 𝑑
* @asyncsignalsafe
*/
-char *strcat(char *d, const char *s) { return strcpy(d + strlen(d), s); }
+char *strcat(char *d, const char *s) {
+ return strcpy(d + strlen(d), s);
+}
diff --git a/libc/str/strcpy.c b/libc/str/strcpy.c
index f4f2db49..e3e81aeb 100644
--- a/libc/str/strcpy.c
+++ b/libc/str/strcpy.c
@@ -19,7 +19,6 @@
#include "libc/intrin/pcmpeqb.h"
#include "libc/intrin/pmovmskb.h"
#include "libc/limits.h"
-#include "libc/nexgen32e/bsf.h"
#include "libc/str/str.h"
/**
diff --git a/libc/str/strncpy.c b/libc/str/strncpy.c
index 4013c0b6..c70f6e01 100644
--- a/libc/str/strncpy.c
+++ b/libc/str/strncpy.c
@@ -22,7 +22,6 @@
* Prepares static search buffer.
*
* 1. If SRC is too long, it's truncated and *not* NUL-terminated.
- *
* 2. If SRC is too short, the remainder is zero-filled.
*
* Please note this function isn't designed to prevent untrustworthy
diff --git a/libc/str/strstr.c b/libc/str/strstr.c
index 3c92a270..cef3d937 100644
--- a/libc/str/strstr.c
+++ b/libc/str/strstr.c
@@ -16,9 +16,6 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
-#include "libc/nexgen32e/x86feature.h"
-#include "libc/str/internal.h"
#include "libc/str/str.h"
/**
@@ -31,29 +28,5 @@
* @see memmem()
*/
char *strstr(const char *haystack, const char *needle) {
- size_t i;
- if (needle[0]) {
- if (needle[1]) {
- for (;;) {
-#if 0 /* todo: fix me */
- if (!((uintptr_t)haystack & 15) && X86_HAVE(SSE4_2) &&
- (((uintptr_t)needle + strlen(needle)) & 0xfff) <= 0xff0) {
- return strstr$sse42(haystack, needle);
- }
-#endif
- for (i = 0;;) {
- if (!needle[i]) return haystack;
- if (!haystack[i]) break;
- if (needle[i] != haystack[i]) break;
- ++i;
- }
- if (!*haystack++) break;
- }
- return NULL;
- } else {
- return strchr(haystack, needle[0]);
- }
- } else {
- return haystack;
- }
+ return memmem(haystack, strlen(haystack), needle, strlen(needle));
}
diff --git a/libc/str/strstr16.c b/libc/str/strstr16.c
index 03ca2228..20ebdaec 100644
--- a/libc/str/strstr16.c
+++ b/libc/str/strstr16.c
@@ -16,22 +16,18 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
-#include "libc/dce.h"
-#include "libc/str/internal.h"
#include "libc/str/str.h"
-#undef memmem
-#undef strlen
-#undef strstr
-#undef strchr
-
-#define char char16_t
-#define memmem memmem16
-#define strlen strlen16
-#define strstr strstr16
-#define strchr strchr16
-#define strstr$sse42 strstr16$sse42
-#define tinystrstr tinystrstr16
-
-#include "libc/str/strstr.c"
+/**
+ * Searches for substring.
+ *
+ * @param haystack is the search area, as a NUL-terminated string
+ * @param needle is the desired substring, also NUL-terminated
+ * @return pointer to first substring within haystack, or NULL
+ * @asyncsignalsafe
+ * @see memmem()
+ */
+char16_t *strstr16(const char16_t *haystack, const char16_t *needle) {
+ return memmem(haystack, strlen16(haystack) * sizeof(char16_t), needle,
+ strlen16(needle) * sizeof(char16_t));
+}
diff --git a/libc/mem/malloc_trim.c b/libc/str/wcslen.c
similarity index 79%
rename from libc/mem/malloc_trim.c
rename to libc/str/wcslen.c
index 7a7bc60d..9be3adc4 100644
--- a/libc/mem/malloc_trim.c
+++ b/libc/str/wcslen.c
@@ -16,15 +16,18 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/mem/mem.h"
-#include "third_party/dlmalloc/dlmalloc.internal.h"
+#include "libc/str/str.h"
/**
- * Releases freed memory back to system.
+ * Searches for substring.
*
- * @param pad can specify how many bytes of memory to leave available
- * @return 1 if it actually released any memory, else 0
+ * @param haystack is the search area, as a NUL-terminated string
+ * @param needle is the desired substring, also NUL-terminated
+ * @return pointer to first substring within haystack, or NULL
+ * @asyncsignalsafe
+ * @see memmem()
*/
-int malloc_trim(size_t pad) {
- return dlmalloc_trim(pad);
+wchar_t *wcsstr(const wchar_t *haystack, const wchar_t *needle) {
+ return memmem(haystack, wcslen(haystack) * sizeof(wchar_t), needle,
+ wcslen(needle) * sizeof(wchar_t));
}
diff --git a/libc/sysv/calls/__accept-sysv.s b/libc/sysv/calls/__accept-sysv.s
index b338ac7e..030a0487 100644
--- a/libc/sysv/calls/__accept-sysv.s
+++ b/libc/sysv/calls/__accept-sysv.s
@@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
-.scall __accept$sysv 0x001e0063201e002b globl hidden
+.scall __accept$sysv 0x001e021d201e002b globl hidden
diff --git a/libc/sysv/calls/__execve-sysv.s b/libc/sysv/calls/__execve-sysv.s
new file mode 100644
index 00000000..bddbd005
--- /dev/null
+++ b/libc/sysv/calls/__execve-sysv.s
@@ -0,0 +1,2 @@
+.include "o/libc/sysv/macros.internal.inc"
+.scall __execve$sysv 0x003b003b203b003b globl hidden
diff --git a/libc/sysv/calls/__fork-sysv.s b/libc/sysv/calls/__fork-sysv.s
new file mode 100644
index 00000000..68c35c37
--- /dev/null
+++ b/libc/sysv/calls/__fork-sysv.s
@@ -0,0 +1,2 @@
+.include "o/libc/sysv/macros.internal.inc"
+.scall __fork$sysv 0x0002000220020039 globl hidden
diff --git a/libc/sysv/calls/copy_file_range-sysv.s b/libc/sysv/calls/copy_file_range-sysv.s
index 9255a74b..adc6ded9 100644
--- a/libc/sysv/calls/copy_file_range-sysv.s
+++ b/libc/sysv/calls/copy_file_range-sysv.s
@@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
-.scall copy_file_range$sysv 0xffffffffffff0146 globl hidden
+.scall copy_file_range$sysv 0xffff0239ffff0146 globl hidden
diff --git a/libc/sysv/calls/execve-sysv.s b/libc/sysv/calls/execve-sysv.s
deleted file mode 100644
index 981fff27..00000000
--- a/libc/sysv/calls/execve-sysv.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "o/libc/sysv/macros.internal.inc"
-.scall execve$sysv 0x003b003b203b003b globl hidden
diff --git a/libc/sysv/calls/fork-sysv.s b/libc/sysv/calls/fork-sysv.s
deleted file mode 100644
index af05a360..00000000
--- a/libc/sysv/calls/fork-sysv.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "o/libc/sysv/macros.internal.inc"
-.scall fork$sysv 0x0002000220020039 globl hidden
diff --git a/libc/sysv/calls/getdents.s b/libc/sysv/calls/getdents.s
index 5dc378a4..a2aaa12a 100644
--- a/libc/sysv/calls/getdents.s
+++ b/libc/sysv/calls/getdents.s
@@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
-.scall getdents 0x00630110ffff00d9 globl hidden
+.scall getdents 0x0063011020c400d9 globl hidden
diff --git a/libc/sysv/calls/getdirentries.s b/libc/sysv/calls/getdirentries.s
index 9f55ac6e..839abad7 100644
--- a/libc/sysv/calls/getdirentries.s
+++ b/libc/sysv/calls/getdirentries.s
@@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
-.scall getdirentries 0xffff022a2158ffff globl
+.scall getdirentries 0xffff022a20c4ffff globl
diff --git a/libc/sysv/calls/ptrace-sysv.s b/libc/sysv/calls/ptrace-sysv.s
new file mode 100644
index 00000000..738265a6
--- /dev/null
+++ b/libc/sysv/calls/ptrace-sysv.s
@@ -0,0 +1,2 @@
+.include "o/libc/sysv/macros.internal.inc"
+.scall ptrace$sysv 0x001a001a201a0065 globl hidden
diff --git a/libc/sysv/calls/ptrace.s b/libc/sysv/calls/ptrace.s
deleted file mode 100644
index 964ca362..00000000
--- a/libc/sysv/calls/ptrace.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "o/libc/sysv/macros.internal.inc"
-.scall ptrace 0x001a001a201a0065 globl
diff --git a/libc/sysv/calls/sysctl.s b/libc/sysv/calls/sysctl.s
index e00274e2..de22523c 100644
--- a/libc/sysv/calls/sysctl.s
+++ b/libc/sysv/calls/sysctl.s
@@ -1,2 +1,2 @@
.include "o/libc/sysv/macros.internal.inc"
-.scall sysctl 0x00caffff20caffff globl
+.scall sysctl 0x00ca00ca20caffff globl
diff --git a/libc/sysv/consensus.py b/libc/sysv/consensus.py
index a910923d..fbd61bfd 100755
--- a/libc/sysv/consensus.py
+++ b/libc/sysv/consensus.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
import sys
lineno = 0
diff --git a/libc/sysv/consts.sh b/libc/sysv/consts.sh
index f9ded08c..0278edbe 100755
--- a/libc/sysv/consts.sh
+++ b/libc/sysv/consts.sh
@@ -388,6 +388,7 @@ syscon fcntl2 F_DUPFD 0 0 0 0 0 # consensus
syscon fcntl2 F_GETFD 1 1 1 1 1 # unix consensus & faked nt
syscon fcntl2 F_SETFD 2 2 2 2 2 # unix consensus & faked nt
syscon fcntl3 FD_CLOEXEC 1 1 1 1 1 # unix consensus & faked nt
+syscon fcntl F_DUPFD_CLOEXEC 0x0406 67 17 10 0
syscon fcntl2 F_GETFL 3 3 3 3 3 # unix consensus & faked nt
syscon fcntl2 F_SETFL 4 4 4 4 4 # unix consensus & faked nt
@@ -408,10 +409,10 @@ syscon fcntl F_TLOCK 2 2 2 2 0 # unix consensus
syscon fcntl F_UNLCK 2 2 2 2 0 # unix consensus
syscon fcntl F_TEST 3 3 3 3 0 # unix consensus
syscon fcntl F_GETLK 5 7 11 7 0
-syscon fcntl F_GETLK64 5 0 0 0 0
syscon fcntl F_SETLK 6 8 12 8 0
-syscon fcntl F_SETLK64 6 0 0 0 0
syscon fcntl F_SETLKW 7 9 13 9 0
+syscon fcntl F_GETLK64 5 0 0 0 0
+syscon fcntl F_SETLK64 6 0 0 0 0
syscon fcntl F_SETLKW64 7 0 0 0 0
syscon fcntl F_SETSIG 10 0 0 0 0
syscon fcntl F_GETSIG 11 0 0 0 0
@@ -423,7 +424,6 @@ syscon fcntl F_OFD_SETLKW 38 0 0 0 0
syscon fcntl F_SETLEASE 0x0400 0 0 0 0
syscon fcntl F_GETLEASE 0x0401 0 0 0 0
syscon fcntl F_NOTIFY 0x0402 0 0 0 0
-syscon fcntl F_DUPFD_CLOEXEC 0x0406 67 17 10 0
syscon fcntl F_SETPIPE_SZ 0x0407 0 0 0 0
syscon fcntl F_GETPIPE_SZ 0x0408 0 0 0 0
@@ -474,6 +474,56 @@ syscon auxv AT_EXECFN 31 999 999 999 999 # faked on non-linux
syscon auxv AT_SYSINFO_EHDR 33 0 0 0 0
syscon auxv AT_NO_AUTOMOUNT 0x0800 0 0 0 0
+# ptrace() codes
+#
+# group name GNU/Systemd XNU's Not UNIX FreeBSD OpenBSD XENIX Commentary
+syscon ptrace PTRACE_TRACEME 0 0 0 0 -1 # unix consensus a.k.a. PT_TRACE_ME
+syscon ptrace PTRACE_PEEKTEXT 1 1 1 1 -1 # unix consensus a.k.a. PT_READ_I
+syscon ptrace PTRACE_PEEKDATA 2 2 2 2 -1 # unix consensus a.k.a. PT_READ_D
+syscon ptrace PTRACE_PEEKUSER 3 3 -1 -1 -1 # a.k.a. PT_READ_U
+syscon ptrace PTRACE_POKETEXT 4 4 4 4 -1 # unix consensus a.k.a. PT_WRITE_I
+syscon ptrace PTRACE_POKEDATA 5 5 5 5 -1 # unix consensus a.k.a. PT_WRITE_D
+syscon ptrace PTRACE_POKEUSER 6 6 -1 -1 -1 # a.k.a. PT_WRITE_U
+syscon ptrace PTRACE_CONT 7 7 7 7 -1 # unix consensus a.k.a. PT_CONTINUE
+syscon ptrace PTRACE_KILL 8 8 8 8 -1 # unix consensus a.k.a. PT_KILL
+syscon ptrace PTRACE_SINGLESTEP 9 9 9 32 -1 # a.k.a. PT_STEP
+syscon ptrace PTRACE_GETREGS 12 -1 33 33 -1 # a.k.a. PT_GETREGS
+syscon ptrace PTRACE_SETREGS 13 -1 34 34 -1 # a.k.a. PT_SETREGS
+syscon ptrace PTRACE_GETFPREGS 14 -1 35 35 -1 # a.k.a. PT_GETFPREGS
+syscon ptrace PTRACE_SETFPREGS 15 -1 36 36 -1 # a.k.a. PT_SETFPREGS
+syscon ptrace PTRACE_ATTACH 16 10 10 9 -1 # a.k.a. PT_ATTACH
+syscon ptrace PTRACE_DETACH 17 11 11 10 -1 # a.k.a. PT_DETACH
+syscon ptrace PTRACE_GETFPXREGS 18 -1 -1 -1 -1 # a.k.a. PT_GETFPXREGS
+syscon ptrace PTRACE_SETFPXREGS 19 -1 -1 -1 -1 # a.k.a. PT_SETFPXREGS
+syscon ptrace PTRACE_SYSCALL 24 -1 22 -1 -1 # a.k.a. PT_SYSCALL
+syscon ptrace PTRACE_GETEVENTMSG 0x4201 -1 -1 -1 -1
+syscon ptrace PTRACE_GETSIGINFO 0x4202 -1 -1 -1 -1
+syscon ptrace PTRACE_SETOPTIONS 0x4200 -1 -1 -1 -1
+syscon ptrace PTRACE_SETSIGINFO 0x4203 -1 -1 -1 -1
+syscon ptrace PTRACE_GETREGSET 0x4204 -1 -1 -1 -1
+syscon ptrace PTRACE_GETSIGMASK 0x420a -1 -1 -1 -1
+syscon ptrace PTRACE_INTERRUPT 0x4207 -1 -1 -1 -1
+syscon ptrace PTRACE_LISTEN 0x4208 -1 -1 -1 -1
+syscon ptrace PTRACE_PEEKSIGINFO 0x4209 -1 -1 -1 -1
+syscon ptrace PTRACE_SECCOMP_GET_FILTER 0x420c -1 -1 -1 -1
+syscon ptrace PTRACE_SEIZE 0x4206 -1 -1 -1 -1
+syscon ptrace PTRACE_SETREGSET 0x4205 -1 -1 -1 -1
+syscon ptrace PTRACE_SETSIGMASK 0x420b -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACESYSGOOD 0x0001 -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACEFORK 0x0002 -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACEVFORK 0x0004 -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACECLONE 0x0008 -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACEEXEC 0x0010 -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACEVFORKDONE 0x0020 -1 -1 -1 -1
+syscon ptrace PTRACE_O_TRACEEXIT 0x0040 -1 -1 -1 -1
+syscon ptrace PTRACE_O_MASK 0x007f -1 -1 -1 -1
+syscon ptrace PTRACE_EVENT_FORK 1 -1 -1 -1 -1
+syscon ptrace PTRACE_EVENT_VFORK 2 -1 -1 -1 -1
+syscon ptrace PTRACE_EVENT_CLONE 3 -1 -1 -1 -1
+syscon ptrace PTRACE_EVENT_EXEC 4 -1 -1 -1 -1
+syscon ptrace PTRACE_EVENT_VFORK_DONE 5 -1 -1 -1 -1
+syscon ptrace PTRACE_EVENT_EXIT 6 -1 -1 -1 -1
+
syscon sigact SA_RESTORER 0x04000000 0 0 0 0
syscon sigact SA_ONSTACK 0x08000000 1 1 1 0 # bsd consensus
syscon sigact SA_RESTART 0x10000000 2 2 2 0 # bsd consensus
@@ -486,10 +536,10 @@ syscon sigact SA_RESETHAND 0x80000000 4 4 4 0 # bsd consensus
syscon sigact SA_ONESHOT 0x80000000 0 0 0 0
syscon clock CLOCK_REALTIME 0 0 0 0 0 # consensus
+syscon clock CLOCK_MONOTONIC 1 1 4 3 1 # XNU/NT faked
syscon clock CLOCK_PROCESS_CPUTIME_ID 2 -1 15 2 0
syscon clock CLOCK_THREAD_CPUTIME_ID 3 -1 14 4 0
-syscon clock CLOCK_MONOTONIC 4 1 4 3 1 # XNU/NT faked
-syscon clock CLOCK_MONOTONIC_RAW 4 4 0x4000 0x4000 4 # XNU/NT/FreeBSD/OpenBSD faked
+syscon clock CLOCK_MONOTONIC_RAW 4 4 0x4000 0x4000 4 # XNU/NT/FreeBSD/OpenBSD faked, not available on RHEL5
syscon clock CLOCK_REALTIME_COARSE 5 -1 0 0 0 # bsd consensus
syscon clock CLOCK_MONOTONIC_COARSE 6 -1 0 0 0 # bsd consensus
syscon clock CLOCK_BOOTTIME 7 -1 0 6 0
@@ -1472,30 +1522,6 @@ syscon in IN_OPEN 0x20 0 0 0 0
syscon in IN_Q_OVERFLOW 0x4000 0 0 0 0
syscon in IN_UNMOUNT 0x2000 0 0 0 0
-syscon pt PT_TRACE_ME 0 0 0 0 0 # consensus
-syscon pt PT_CONTINUE 7 7 7 7 0 # unix consensus
-syscon pt PT_KILL 8 8 8 8 0 # unix consensus
-syscon pt PT_READ_D 2 2 2 2 0 # unix consensus
-syscon pt PT_READ_I 1 1 1 1 0 # unix consensus
-syscon pt PT_WRITE_D 5 5 5 5 0 # unix consensus
-syscon pt PT_WRITE_I 4 4 4 4 0 # unix consensus
-syscon pt PT_ATTACH 0x10 10 10 9 0
-syscon pt PT_DETACH 17 11 11 10 0
-syscon pt PT_STEP 9 9 9 0x20 0
-syscon pt PT_GETFPREGS 14 0 35 35 0
-syscon pt PT_GETREGS 12 0 33 33 0
-syscon pt PT_SETFPREGS 15 0 36 36 0
-syscon pt PT_SETREGS 13 0 34 34 0
-syscon pt PT_READ_U 3 3 0 0 0
-syscon pt PT_SYSCALL 24 0 22 0 0
-syscon pt PT_WRITE_U 6 6 0 0 0
-syscon pt PT_GETEVENTMSG 0x4201 0 0 0 0
-syscon pt PT_GETFPXREGS 18 0 0 0 0
-syscon pt PT_GETSIGINFO 0x4202 0 0 0 0
-syscon pt PT_SETFPXREGS 19 0 0 0 0
-syscon pt PT_SETOPTIONS 0x4200 0 0 0 0
-syscon pt PT_SETSIGINFO 0x4203 0 0 0 0
-
syscon iff IFF_BROADCAST 2 2 2 2 2 # consensus
syscon iff IFF_LOOPBACK 8 8 8 8 4 # unix consensus
syscon iff IFF_MULTICAST 0x1000 0x8000 0x8000 0x8000 0x10 # bsd consensus
@@ -1887,17 +1913,6 @@ syscon misc LC_ALL_MASK 0x1fbf 0 63 126 0
syscon lock LOCK_UNLOCK_CACHE 54 0 0 0 0 # wut
-syscon ptrace PTRACE_GETREGSET 0x4204 0 0 0 0
-syscon ptrace PTRACE_GETSIGMASK 0x420a 0 0 0 0
-syscon ptrace PTRACE_INTERRUPT 0x4207 0 0 0 0
-syscon ptrace PTRACE_LISTEN 0x4208 0 0 0 0
-syscon ptrace PTRACE_PEEKSIGINFO 0x4209 0 0 0 0
-syscon ptrace PTRACE_SECCOMP_GET_FILTER 0x420c 0 0 0 0
-syscon ptrace PTRACE_SEIZE 0x4206 0 0 0 0
-syscon ptrace PTRACE_SETREGSET 0x4205 0 0 0 0
-syscon ptrace PTRACE_SETSIGMASK 0x420b 0 0 0 0
-syscon ptrace PTRACE_SYSCALL 0 0 6 0 0
-
syscon misc ARPHRD_ETHER 1 1 1 1 0 # unix consensus
syscon misc ARPHRD_FCFABRIC 787 0 0 0 0
syscon misc ARPHRD_IEEE80211 801 0 0 0 0
@@ -2779,38 +2794,770 @@ syscon misc YESSTR 0x050002 54 54 46 0
# System Call Numbers.
#
# group name GNU/Systemd XNU's Not UNIX FreeBSD OpenBSD XENIX
+syscon nr __NR_exit 0x003c 0x2000001 0x0001 0x0001 -1
+syscon nr __NR_exit_group 0x00e7 0x2000001 0x0001 0x0001 -1
+syscon nr __NR_read 0x0000 0x2000003 0x0003 0x0003 -1
+syscon nr __NR_write 0x0001 0x2000004 0x0004 0x0004 -1
+syscon nr __NR_open 0x0002 0x2000005 0x0005 0x0005 -1
+syscon nr __NR_close 0x0003 0x2000006 0x0006 0x0006 -1
+syscon nr __NR_stat 0x0004 0x2000152 -1 0x0026 -1
+syscon nr __NR_fstat 0x0005 0x2000153 0x0227 0x0035 -1
+syscon nr __NR_lstat 0x0006 0x2000154 0x0028 0x0028 -1
+syscon nr __NR_poll 0x0007 0x20000e6 0x00d1 0x00fc -1
+syscon nr __NR_ppoll 0x010f -1 0x0221 0x006d -1
+syscon nr __NR_lseek 0x0008 0x20000c7 0x01de 0x00c7 -1
+syscon nr __NR_mmap 0x0009 0x20000c5 0x01dd 0x00c5 -1
+syscon nr __NR_msync 0x001a 0x2000041 0x0041 0x0100 -1
+syscon nr __NR_mprotect 0x000a 0x200004a 0x004a 0x004a -1
+syscon nr __NR_munmap 0x000b 0x2000049 0x0049 0x0049 -1
+syscon nr __NR_sigaction 0x000d 0x200002e 0x01a0 0x002e -1
+syscon nr __NR_sigprocmask 0x000e 0x2000030 0x0154 0x0030 -1
+syscon nr __NR_ioctl 0x0010 0x2000036 0x0036 0x0036 -1
+syscon nr __NR_pread 0x0011 0x2000099 0x01db 0x00ad -1
+syscon nr __NR_pwrite 0x0012 0x200009a 0x01dc 0x00ae -1
+syscon nr __NR_readv 0x0013 0x2000078 0x0078 0x0078 -1
+syscon nr __NR_writev 0x0014 0x2000079 0x0079 0x0079 -1
+syscon nr __NR_access 0x0015 0x2000021 0x0021 0x0021 -1
+syscon nr __NR_pipe 0x0016 0x200002a 0x021e 0x0107 -1
+syscon nr __NR_select 0x0017 0x200005d 0x005d 0x0047 -1
+syscon nr __NR_pselect -1 0x200018a 0x020a 0x006e -1
+syscon nr __NR_pselect6 0x010e -1 -1 -1 -1
+syscon nr __NR_sched_yield 0x0018 0x010003c 0x014b 0x012a -1
+syscon nr __NR_mremap 0x0019 -1 -1 -1 -1
+syscon nr __NR_mincore 0x001b 0x200004e 0x004e 0x004e -1
+syscon nr __NR_madvise 0x001c 0x200004b 0x004b 0x004b -1
+syscon nr __NR_shmget 0x001d 0x2000109 0x00e7 0x0121 -1
+syscon nr __NR_shmat 0x001e 0x2000106 0x00e4 0x00e4 -1
+syscon nr __NR_shmctl 0x001f 0x2000107 0x0200 0x0128 -1
+syscon nr __NR_dup 0x0020 0x2000029 0x0029 0x0029 -1
+syscon nr __NR_dup2 0x0021 0x200005a 0x005a 0x005a -1
+syscon nr __NR_pause 0x0022 -1 -1 -1 -1
+syscon nr __NR_nanosleep 0x0023 -1 0x00f0 0x005b -1
+syscon nr __NR_getitimer 0x0024 0x2000056 0x0056 0x0046 -1
+syscon nr __NR_setitimer 0x0026 0x2000053 0x0053 0x0045 -1
+syscon nr __NR_alarm 0x0025 -1 -1 -1 -1
syscon nr __NR_getpid 0x0027 0x2000014 0x0014 0x0014 -1
-syscon nr __NR_kill 0x003e 0x2000025 0x0025 0x007a -1
-syscon nr __NR_exit 0x00e7 0x2000001 0x0001 0x0001 -1
-syscon nr __NR_read 0x0000 0x2000003 0x0003 0x0003 -1
-syscon nr __NR_write 0x0001 0x2000004 0x0004 0x0004 -1
-syscon nr __NR_open 0x0002 0x2000005 0x0005 0x0005 -1
-syscon nr __NR_close 0x0003 0x2000006 0x0006 0x0006 -1
-syscon nr __NR_wait4 0x003d 0x1000007 0x0007 0x000b -1
-syscon nr __NR_stat 0x0004 0x2000152 0x00bc 0x0026 -1
-syscon nr __NR_fstat 0x0005 0x2000153 0x0227 0x0035 -1
-syscon nr __NR_lstat 0x0006 0x2000154 0x0028 0x0028 -1
-syscon nr __NR_mmap 0x0009 0x20000c5 0x01dd 0x00c5 -1
-syscon nr __NR_mprotect 0x000a 0x200004a 0x004a 0x004a -1
-syscon nr __NR_munmap 0x000b 0x2000049 0x0049 0x0049 -1
-syscon nr __NR_sigaction 0x000d 0x200002e 0x01a0 0x002e -1
-syscon nr __NR_pread 0x0011 0x2000099 0x01db 0x00ad -1
-syscon nr __NR_pwrite 0x0012 0x200009a 0x01dc 0x00ae -1
-syscon nr __NR_access 0x0015 0x2000021 0x0021 0x0021 -1
-syscon nr __NR_sched_yield 0x0018 0x100003c 0x014b 0x012a -1
-syscon nr __NR_sendfile 0x0028 0x2000151 0x0189 0xffff -1
-syscon nr __NR_fork 0x0039 0x2000002 0x0002 0x0002 -1
+syscon nr __NR_sendfile 0x0028 0x2000151 0x0189 -1 -1
+syscon nr __NR_socket 0x0029 0x2000061 0x0061 0x0061 -1
+syscon nr __NR_connect 0x002a 0x2000062 0x0062 0x0062 -1
+syscon nr __NR_accept 0x002b 0x200001e 0x0063 0x001e -1
+syscon nr __NR_sendto 0x002c 0x2000085 0x0085 0x0085 -1
+syscon nr __NR_recvfrom 0x002d 0x200001d 0x001d 0x001d -1
+syscon nr __NR_sendmsg 0x002e 0x200001c 0x001c 0x001c -1
+syscon nr __NR_recvmsg 0x002f 0x200001b 0x001b 0x001b -1
+syscon nr __NR_shutdown 0x0030 0x2000086 0x0086 0x0086 -1
+syscon nr __NR_bind 0x0031 0x2000068 0x0068 0x0068 -1
+syscon nr __NR_listen 0x0032 0x200006a 0x006a 0x006a -1
+syscon nr __NR_getsockname 0x0033 0x2000020 0x0020 0x0020 -1
+syscon nr __NR_getpeername 0x0034 0x200001f 0x008d 0x001f -1
+syscon nr __NR_socketpair 0x0035 0x2000087 0x0087 0x0087 -1
+syscon nr __NR_setsockopt 0x0036 0x2000069 0x0069 0x0069 -1
+syscon nr __NR_getsockopt 0x0037 0x2000076 0x0076 0x0076 -1
+syscon nr __NR_fork 0x0039 0x2000002 0x0002 0x0002 -1
syscon nr __NR_vfork 0x003a 0x2000042 0x0042 0x0042 -1
-syscon nr __NR_gettimeofday 0x0060 0x2000074 0x0074 0x0043 -1
-syscon nr __NR_arch_prctl 0x009e 0x000ffff 0x00a5 0x00a5 -1
-syscon nr __NR_gettid 0x00ba 0x200011e 0xffff 0xffff -1
-syscon nr __NR_fadvise 0x00dd 0x000ffff 0x0213 0xffff -1
-syscon nr __NR_clock_gettime 0x00e4 0x000ffff 0x00e8 0x0057 -1
+syscon nr __NR_posix_spawn -1 0x20000f4 -1 -1 -1
+syscon nr __NR_execve 0x003b 0x200003b 0x003b 0x003b -1
+syscon nr __NR_wait4 0x003d 0x2000007 0x0007 0x000b -1
+syscon nr __NR_kill 0x003e 0x2000025 0x0025 0x007a -1
+syscon nr __NR_killpg -1 -1 0x0092 -1 -1
+syscon nr __NR_clone 0x0038 -1 -1 -1 -1
+syscon nr __NR_tkill 0x00c8 -1 -1 -1 -1
+syscon nr __NR_futex 0x00ca -1 -1 0x0053 -1
+syscon nr __NR_set_robust_list 0x0111 -1 -1 -1 -1
+syscon nr __NR_get_robust_list 0x0112 -1 -1 -1 -1
+syscon nr __NR_uname 0x003f -1 0x00a4 -1 -1
+syscon nr __NR_semget 0x0040 0x20000ff 0x00dd 0x00dd -1
+syscon nr __NR_semop 0x0041 0x2000100 0x00de 0x0122 -1
+syscon nr __NR_semctl 0x0042 0x20000fe 0x01fe 0x0127 -1
+syscon nr __NR_shmdt 0x0043 0x2000108 0x00e6 0x00e6 -1
+syscon nr __NR_msgget 0x0044 0x2000103 0x00e1 0x00e1 -1
+syscon nr __NR_msgsnd 0x0045 0x2000104 0x00e2 0x00e2 -1
+syscon nr __NR_msgrcv 0x0046 0x2000105 0x00e3 0x00e3 -1
+syscon nr __NR_msgctl 0x0047 0x2000102 0x01ff 0x0129 -1
+syscon nr __NR_fcntl 0x0048 0x200005c 0x005c 0x005c -1
+syscon nr __NR_flock 0x0049 0x2000083 0x0083 0x0083 -1
+syscon nr __NR_fsync 0x004a 0x200005f 0x005f 0x005f -1
+syscon nr __NR_fdatasync 0x004b 0x20000bb 0x0226 0x005f -1
+syscon nr __NR_truncate 0x004c 0x20000c8 0x01df 0x00c8 -1
+syscon nr __NR_ftruncate 0x004d 0x20000c9 0x01e0 0x00c9 -1
+syscon nr __NR_getcwd 0x004f -1 0x0146 0x0130 -1
+syscon nr __NR_chdir 0x0050 0x200000c 0x000c 0x000c -1
+syscon nr __NR_fchdir 0x0051 0x200000d 0x000d 0x000d -1
+syscon nr __NR_rename 0x0052 0x2000080 0x0080 0x0080 -1
+syscon nr __NR_mkdir 0x0053 0x2000088 0x0088 0x0088 -1
+syscon nr __NR_rmdir 0x0054 0x2000089 0x0089 0x0089 -1
+syscon nr __NR_creat 0x0055 -1 0x0008 -1 -1
+syscon nr __NR_link 0x0056 0x2000009 0x0009 0x0009 -1
+syscon nr __NR_unlink 0x0057 0x200000a 0x000a 0x000a -1
+syscon nr __NR_symlink 0x0058 0x2000039 0x0039 0x0039 -1
+syscon nr __NR_readlink 0x0059 0x200003a 0x003a 0x003a -1
+syscon nr __NR_chmod 0x005a 0x200000f 0x000f 0x000f -1
+syscon nr __NR_fchmod 0x005b 0x200007c 0x007c 0x007c -1
+syscon nr __NR_chown 0x005c 0x2000010 0x0010 0x0010 -1
+syscon nr __NR_fchown 0x005d 0x200007b 0x007b 0x007b -1
+syscon nr __NR_lchown 0x005e 0x200016c 0x00fe 0x00fe -1
+syscon nr __NR_umask 0x005f 0x200003c 0x003c 0x003c -1
+syscon nr __NR_gettimeofday 0x0060 0x2000074 0x0074 0x0043 -1
+syscon nr __NR_getrlimit 0x0061 0x20000c2 0x00c2 0x00c2 -1
+syscon nr __NR_getrusage 0x0062 0x2000075 0x0075 0x0013 -1
+syscon nr __NR_sysinfo 0x0063 -1 -1 -1 -1
+syscon nr __NR_times 0x0064 -1 -1 -1 -1
+syscon nr __NR_ptrace 0x0065 0x200001a 0x001a 0x001a -1
+syscon nr __NR_syslog 0x0067 -1 -1 -1 -1
syscon nr __NR_getuid 0x0066 0x2000018 0x0018 0x0018 -1
syscon nr __NR_getgid 0x0068 0x200002f 0x002f 0x002f -1
+syscon nr __NR_getppid 0x006e 0x2000027 0x0027 0x0027 -1
+syscon nr __NR_getpgrp 0x006f 0x2000051 0x0051 0x0051 -1
+syscon nr __NR_setsid 0x0070 0x2000093 0x0093 0x0093 -1
+syscon nr __NR_getsid 0x007c 0x2000136 0x0136 0x00ff -1
+syscon nr __NR_getpgid 0x0079 0x2000097 0x00cf 0x00cf -1
+syscon nr __NR_setpgid 0x006d 0x2000052 0x0052 0x0052 -1
syscon nr __NR_geteuid 0x006b 0x2000019 0x0019 0x0019 -1
syscon nr __NR_getegid 0x006c 0x200002b 0x002b 0x002b -1
-syscon nr __NR_madvise 0x001c 0x200004b 0x004b 0x004b -1
-syscon nr __NR_sigprocmask 0x000e 0x2000030 0x0154 0x0030 -1
+syscon nr __NR_getgroups 0x0073 0x200004f 0x004f 0x004f -1
+syscon nr __NR_setgroups 0x0074 0x2000050 0x0050 0x0050 -1
+syscon nr __NR_setreuid 0x0071 0x200007e 0x007e 0x007e -1
+syscon nr __NR_setregid 0x0072 0x200007f 0x007f 0x007f -1
+syscon nr __NR_setuid 0x0069 0x2000017 0x0017 0x0017 -1
+syscon nr __NR_setgid 0x006a 0x20000b5 0x00b5 0x00b5 -1
+syscon nr __NR_setresuid 0x0075 -1 0x0137 0x011a -1
+syscon nr __NR_setresgid 0x0077 -1 0x0138 0x011c -1
+syscon nr __NR_getresuid 0x0076 -1 0x0168 0x0119 -1
+syscon nr __NR_getresgid 0x0078 -1 0x0169 0x011b -1
+syscon nr __NR_sigpending 0x007f 0x2000034 0x0034 0x0034 -1
+syscon nr __NR_sigsuspend 0x0082 0x200006f 0x0155 0x006f -1
+syscon nr __NR_sigaltstack 0x0083 0x2000035 0x0035 0x0120 -1
+syscon nr __NR_mknod 0x0085 0x200000e 0x000e 0x000e -1
+syscon nr __NR_mknodat 0x0103 -1 0x22ff 0x0140 -1
+syscon nr __NR_mkfifo -1 0x2000084 0x0084 0x0084 -1
+syscon nr __NR_mkfifoat -1 -1 0x01f1 0x013f -1
+syscon nr __NR_statfs 0x0089 0x2000159 0x022b 0x003f -1
+syscon nr __NR_fstatfs 0x008a 0x200015a 0x022c 0x0040 -1
+syscon nr __NR_getpriority 0x008c 0x2000064 0x0064 0x0064 -1
+syscon nr __NR_setpriority 0x008d 0x2000060 0x0060 0x0060 -1
+syscon nr __NR_mlock 0x0095 0x20000cb 0x00cb 0x00cb -1
+syscon nr __NR_munlock 0x0096 0x20000cc 0x00cc 0x00cc -1
+syscon nr __NR_mlockall 0x0097 0x2000144 0x0144 0x010f -1
+syscon nr __NR_munlockall 0x0098 0x2000145 0x0145 0x0110 -1
+syscon nr __NR_setrlimit 0x00a0 0x20000c3 0x00c3 0x00c3 -1
+syscon nr __NR_chroot 0x00a1 0x200003d 0x003d 0x003d -1
+syscon nr __NR_sync 0x00a2 0x2000024 0x0024 0x0024 -1
+syscon nr __NR_acct 0x00a3 0x2000033 0x0033 0x0033 -1
+syscon nr __NR_settimeofday 0x00a4 0x200007a 0x007a 0x0044 -1
+syscon nr __NR_mount 0x00a5 0x20000a7 0x0015 0x0015 -1
+syscon nr __NR_reboot 0x00a9 0x2000037 0x0037 0x0037 -1
+syscon nr __NR_quotactl 0x00b3 0x20000a5 0x0094 0x0094 -1
+syscon nr __NR_setfsuid 0x007a -1 -1 -1 -1
+syscon nr __NR_setfsgid 0x007b -1 -1 -1 -1
+syscon nr __NR_capget 0x007d -1 -1 -1 -1
+syscon nr __NR_capset 0x007e -1 -1 -1 -1
+syscon nr __NR_sigtimedwait 0x0080 -1 0x0159 -1 -1
+syscon nr __NR_rt_sigqueueinfo 0x0081 -1 -1 -1 -1
+syscon nr __NR_personality 0x0087 -1 -1 -1 -1
+syscon nr __NR_ustat 0x0088 -1 -1 -1 -1
+syscon nr __NR_sysfs 0x008b -1 -1 -1 -1
+syscon nr __NR_sched_setparam 0x008e -1 0x0147 -1 -1
+syscon nr __NR_sched_getparam 0x008f -1 0x0148 -1 -1
+syscon nr __NR_sched_setscheduler 0x0090 -1 0x0149 -1 -1
+syscon nr __NR_sched_getscheduler 0x0091 -1 0x014a -1 -1
+syscon nr __NR_sched_get_priority_max 0x0092 -1 0x014c -1 -1
+syscon nr __NR_sched_get_priority_min 0x0093 -1 0x014d -1 -1
+syscon nr __NR_sched_rr_get_interval 0x0094 -1 0x014e -1 -1
+syscon nr __NR_vhangup 0x0099 -1 -1 -1 -1
+syscon nr __NR_modify_ldt 0x009a -1 -1 -1 -1
+syscon nr __NR_pivot_root 0x009b -1 -1 -1 -1
+syscon nr __NR__sysctl 0x009c -1 -1 -1 -1
+syscon nr __NR_prctl 0x009d -1 -1 -1 -1
+syscon nr __NR_arch_prctl 0x009e -1 0x00a5 0x00a5 -1
+syscon nr __NR_adjtimex 0x009f -1 -1 -1 -1
+syscon nr __NR_umount2 0x00a6 -1 -1 -1 -1
+syscon nr __NR_swapon 0x00a7 0x2000055 0x0055 -1 -1
+syscon nr __NR_swapoff 0x00a8 -1 0x01a8 -1 -1
+syscon nr __NR_sethostname 0x00aa -1 0x0058 -1 -1
+syscon nr __NR_setdomainname 0x00ab -1 0x00a3 -1 -1
+syscon nr __NR_iopl 0x00ac -1 -1 -1 -1
+syscon nr __NR_ioperm 0x00ad -1 -1 -1 -1
+syscon nr __NR_init_module 0x00af -1 -1 -1 -1
+syscon nr __NR_delete_module 0x00b0 -1 -1 -1 -1
+syscon nr __NR_gettid 0x00ba 0x200011e -1 -1 -1
+syscon nr __NR_readahead 0x00bb -1 -1 -1 -1
+syscon nr __NR_setxattr 0x00bc 0x20000ec -1 -1 -1
+syscon nr __NR_fsetxattr 0x00be 0x20000ed -1 -1 -1
+syscon nr __NR_getxattr 0x00bf 0x20000ea -1 -1 -1
+syscon nr __NR_fgetxattr 0x00c1 0x20000eb -1 -1 -1
+syscon nr __NR_listxattr 0x00c2 0x20000f0 -1 -1 -1
+syscon nr __NR_flistxattr 0x00c4 0x20000f1 -1 -1 -1
+syscon nr __NR_removexattr 0x00c5 0x20000ee -1 -1 -1
+syscon nr __NR_fremovexattr 0x00c7 0x20000ef -1 -1 -1
+syscon nr __NR_lsetxattr 0x00bd -1 -1 -1 -1
+syscon nr __NR_lgetxattr 0x00c0 -1 -1 -1 -1
+syscon nr __NR_llistxattr 0x00c3 -1 -1 -1 -1
+syscon nr __NR_lremovexattr 0x00c6 -1 -1 -1 -1
+syscon nr __NR_sched_setaffinity 0x00cb -1 -1 -1 -1
+syscon nr __NR_sched_getaffinity 0x00cc -1 -1 -1 -1
+syscon nr __NR_cpuset_getaffinity -1 -1 0x01e7 -1 -1
+syscon nr __NR_cpuset_setaffinity -1 -1 0x01e8 -1 -1
+syscon nr __NR_io_setup 0x00ce -1 -1 -1 -1
+syscon nr __NR_io_destroy 0x00cf -1 -1 -1 -1
+syscon nr __NR_io_getevents 0x00d0 -1 -1 -1 -1
+syscon nr __NR_io_submit 0x00d1 -1 -1 -1 -1
+syscon nr __NR_io_cancel 0x00d2 -1 -1 -1 -1
+syscon nr __NR_lookup_dcookie 0x00d4 -1 -1 -1 -1
+syscon nr __NR_epoll_create 0x00d5 -1 -1 -1 -1
+syscon nr __NR_epoll_wait 0x00e8 -1 -1 -1 -1
+syscon nr __NR_epoll_ctl 0x00e9 -1 -1 -1 -1
+syscon nr __NR_getdents 0x00d9 -1 0x0110 0x0063 -1
+syscon nr __NR_set_tid_address 0x00da -1 -1 -1 -1
+syscon nr __NR_restart_syscall 0x00db -1 -1 -1 -1
+syscon nr __NR_semtimedop 0x00dc -1 -1 -1 -1
+syscon nr __NR_fadvise 0x00dd -1 0x0213 -1 -1
+syscon nr __NR_timer_create 0x00de -1 -1 -1 -1
+syscon nr __NR_timer_settime 0x00df -1 -1 -1 -1
+syscon nr __NR_timer_gettime 0x00e0 -1 -1 -1 -1
+syscon nr __NR_timer_getoverrun 0x00e1 -1 -1 -1 -1
+syscon nr __NR_timer_delete 0x00e2 -1 -1 -1 -1
+syscon nr __NR_clock_settime 0x00e3 -1 0x00e9 0x0058 -1
+syscon nr __NR_clock_gettime 0x00e4 -1 0x00e8 0x0057 -1
+syscon nr __NR_clock_getres 0x00e5 -1 0x00ea 0x0059 -1
+syscon nr __NR_clock_nanosleep 0x00e6 -1 0x00f4 -1 -1
+syscon nr __NR_tgkill 0x00ea -1 -1 -1 -1
+syscon nr __NR_mbind 0x00ed -1 -1 -1 -1
+syscon nr __NR_set_mempolicy 0x00ee -1 -1 -1 -1
+syscon nr __NR_get_mempolicy 0x00ef -1 -1 -1 -1
+syscon nr __NR_mq_open 0x00f0 -1 -1 -1 -1
+syscon nr __NR_mq_unlink 0x00f1 -1 -1 -1 -1
+syscon nr __NR_mq_timedsend 0x00f2 -1 -1 -1 -1
+syscon nr __NR_mq_timedreceive 0x00f3 -1 -1 -1 -1
+syscon nr __NR_mq_notify 0x00f4 -1 -1 -1 -1
+syscon nr __NR_mq_getsetattr 0x00f5 -1 -1 -1 -1
+syscon nr __NR_kexec_load 0x00f6 -1 -1 -1 -1
+syscon nr __NR_waitid 0x00f7 0x20000ad -1 -1 -1
+syscon nr __NR_add_key 0x00f8 -1 -1 -1 -1
+syscon nr __NR_request_key 0x00f9 -1 -1 -1 -1
+syscon nr __NR_keyctl 0x00fa -1 -1 -1 -1
+syscon nr __NR_ioprio_set 0x00fb -1 -1 -1 -1
+syscon nr __NR_ioprio_get 0x00fc -1 -1 -1 -1
+syscon nr __NR_inotify_init 0x00fd -1 -1 -1 -1
+syscon nr __NR_inotify_add_watch 0x00fe -1 -1 -1 -1
+syscon nr __NR_inotify_rm_watch 0x00ff -1 -1 -1 -1
+syscon nr __NR_openat 0x0101 0x20001cf 0x01f3 0x0141 -1
+syscon nr __NR_mkdirat 0x0102 0x20001db 0x01f0 0x013e -1
+syscon nr __NR_fchownat 0x0104 0x20001d4 0x01eb 0x013b -1
+syscon nr __NR_utime 0x0084 -1 -1 -1 -1
+syscon nr __NR_utimes 0x00eb 0x200008a 0x008a 0x004c -1
+syscon nr __NR_futimesat 0x0105 -1 0x01ee -1 -1
+syscon nr __NR_futimes -1 0x200008b 0x00ce 0x004d -1
+syscon nr __NR_futimens -1 -1 0x0222 0x0055 -1
+syscon nr __NR_fstatat 0x0106 0x20001d6 0x0228 0x002a -1
+syscon nr __NR_unlinkat 0x0107 0x20001d8 0x01f7 0x0145 -1
+syscon nr __NR_renameat 0x0108 0x20001d1 0x01f5 0x0143 -1
+syscon nr __NR_linkat 0x0109 0x20001d7 0x01ef 0x013d -1
+syscon nr __NR_symlinkat 0x010a 0x20001da 0x01f6 0x0144 -1
+syscon nr __NR_readlinkat 0x010b 0x20001d9 0x01f4 0x0142 -1
+syscon nr __NR_fchmodat 0x010c 0x20001d3 0x01ea 0x013a -1
+syscon nr __NR_faccessat 0x010d 0x20001d2 0x01e9 0x0139 -1
+syscon nr __NR_unshare 0x0110 -1 -1 -1 -1
+syscon nr __NR_splice 0x0113 -1 -1 -1 -1
+syscon nr __NR_tee 0x0114 -1 -1 -1 -1
+syscon nr __NR_sync_file_range 0x0115 -1 -1 -1 -1
+syscon nr __NR_vmsplice 0x0116 -1 -1 -1 -1
+syscon nr __NR_migrate_pages 0x0100 -1 -1 -1 -1
+syscon nr __NR_move_pages 0x0117 -1 -1 -1 -1
+syscon nr __NR_preadv 0x0127 -1 0x0121 0x010b -1
+syscon nr __NR_pwritev 0x0128 -1 0x0122 0x010c -1
+syscon nr __NR_utimensat 0x0118 -1 0x0223 0x0054 -1
+syscon nr __NR_fallocate 0x011d -1 -1 -1 -1
+syscon nr __NR_posix_fallocate -1 -1 0x0212 -1 -1
+syscon nr __NR_accept4 0x0120 -1 0x021d 0x005d -1
+syscon nr __NR_dup3 0x0124 -1 -1 0x0066 -1
+syscon nr __NR_pipe2 0x0125 -1 0x021e 0x0065 -1
+syscon nr __NR_epoll_pwait 0x0119 -1 -1 -1 -1
+syscon nr __NR_epoll_create1 0x0123 -1 -1 -1 -1
+syscon nr __NR_perf_event_open 0x012a -1 -1 -1 -1
+syscon nr __NR_inotify_init1 0x0126 -1 -1 -1 -1
+syscon nr __NR_rt_tgsigqueueinfo 0x0129 -1 -1 -1 -1
+syscon nr __NR_signalfd 0x011a -1 -1 -1 -1
+syscon nr __NR_signalfd4 0x0121 -1 -1 -1 -1
+syscon nr __NR_eventfd 0x011c -1 -1 -1 -1
+syscon nr __NR_eventfd2 0x0122 -1 -1 -1 -1
+syscon nr __NR_timerfd_create 0x011b -1 -1 -1 -1
+syscon nr __NR_timerfd_settime 0x011e -1 -1 -1 -1
+syscon nr __NR_timerfd_gettime 0x011f -1 -1 -1 -1
+syscon nr __NR_recvmmsg 0x012b -1 -1 -1 -1
+syscon nr __NR_fanotify_init 0x012c -1 -1 -1 -1
+syscon nr __NR_fanotify_mark 0x012d -1 -1 -1 -1
+syscon nr __NR_prlimit 0x012e -1 -1 -1 -1
+syscon nr __NR_name_to_handle_at 0x012f -1 -1 -1 -1
+syscon nr __NR_open_by_handle_at 0x0130 -1 -1 -1 -1
+syscon nr __NR_clock_adjtime 0x0131 -1 -1 -1 -1
+syscon nr __NR_syncfs 0x0132 -1 -1 -1 -1
+syscon nr __NR_sendmmsg 0x0133 -1 -1 -1 -1
+syscon nr __NR_setns 0x0134 -1 -1 -1 -1
+syscon nr __NR_getcpu 0x0135 -1 -1 -1 -1
+syscon nr __NR_process_vm_readv 0x0136 -1 -1 -1 -1
+syscon nr __NR_process_vm_writev 0x0137 -1 -1 -1 -1
+syscon nr __NR_kcmp 0x0138 -1 -1 -1 -1
+syscon nr __NR_finit_module 0x0139 -1 -1 -1 -1
+syscon nr __NR_sched_setattr 0x013a -1 -1 -1 -1
+syscon nr __NR_sched_getattr 0x013b -1 -1 -1 -1
+syscon nr __NR_renameat2 0x013c -1 -1 -1 -1
+syscon nr __NR_seccomp 0x013d -1 -1 -1 -1
+syscon nr __NR_getrandom 0x013e 0x20001f4 0x0233 0x0007 -1
+syscon nr __NR_memfd_create 0x013f -1 -1 -1 -1
+syscon nr __NR_kexec_file_load 0x0140 -1 -1 -1 -1
+syscon nr __NR_bpf 0x0141 -1 -1 -1 -1
+syscon nr __NR_execveat 0x0142 -1 -1 -1 -1
+syscon nr __NR_userfaultfd 0x0143 -1 -1 -1 -1
+syscon nr __NR_membarrier 0x0144 -1 -1 -1 -1
+syscon nr __NR_mlock2 0x0145 -1 -1 -1 -1
+syscon nr __NR_copy_file_range 0x0146 -1 -1 -1 -1
+syscon nr __NR_preadv2 0x0147 -1 -1 -1 -1
+syscon nr __NR_pwritev2 0x0148 -1 -1 -1 -1
+syscon nr __NR_pkey_mprotect 0x0149 -1 -1 -1 -1
+syscon nr __NR_pkey_alloc 0x014a -1 -1 -1 -1
+syscon nr __NR_pkey_free 0x014b -1 -1 -1 -1
+syscon nr __NR_statx 0x014c -1 -1 -1 -1
+syscon nr __NR_io_pgetevents 0x014d -1 -1 -1 -1
+syscon nr __NR_rseq 0x014e -1 -1 -1 -1
+syscon nr __NR_pidfd_send_signal 0x01a8 -1 -1 -1 -1
+syscon nr __NR_io_uring_setup 0x01a9 -1 -1 -1 -1
+syscon nr __NR_io_uring_enter 0x01aa -1 -1 -1 -1
+syscon nr __NR_io_uring_register 0x01ab -1 -1 -1 -1
+syscon nr __NR_pledge -1 -1 -1 0x006c -1
+syscon nr __NR_ktrace -1 -1 0x002d 0x002d -1
+syscon nr __NR_kqueue -1 0x200016a 0x016a 0x010d -1
+syscon nr __NR_kevent -1 0x2000171 0x0230 0x0048 -1
+syscon nr __NR_revoke -1 0x2000038 0x0038 0x0038 -1
+syscon nr __NR_setlogin -1 0x2000032 0x0032 0x0032 -1
+syscon nr __NR_getfh -1 0x20000a1 0x00a1 0x00a1 -1
+syscon nr __NR_chflags -1 0x2000022 0x0022 0x0022 -1
+syscon nr __NR_getfsstat -1 0x200015b 0x022d 0x003e -1
+syscon nr __NR_nfssvc -1 0x200009b 0x009b 0x009b -1
+syscon nr __NR_adjtime -1 0x200008c 0x008c 0x008c -1
+syscon nr __NR_fchflags -1 0x2000023 0x0023 0x0023 -1
+syscon nr __NR_seteuid -1 0x20000b7 0x00b7 0x00b7 -1
+syscon nr __NR_setegid -1 0x20000b6 0x00b6 0x00b6 -1
+syscon nr __NR_fpathconf -1 0x20000c0 0x00c0 0x00c0 -1
+syscon nr __NR_fhopen -1 0x20000f8 0x012a 0x0108 -1
+syscon nr __NR_unmount -1 0x200009f 0x0016 0x0016 -1
+syscon nr __NR_issetugid -1 0x2000147 0x00fd 0x00fd -1
+syscon nr __NR_minherit -1 0x20000fa 0x00fa 0x00fa -1
+syscon nr __NR_pathconf -1 0x20000bf 0x00bf 0x00bf -1
+syscon nr __NR_sysctl -1 0x20000ca -1 0x00ca -1
+syscon nr __NR_ntp_adjtime -1 0x200020f 0x00b0 -1 -1
+syscon nr __NR_ntp_gettime -1 0x2000210 0x00f8 -1 -1
+syscon nr __NR_shm_unlink -1 0x200010b 0x01e3 -1 -1
+syscon nr __NR_shm_open -1 0x200010a 0x01e2 -1 -1
+syscon nr __NR_aio_read -1 0x200013e 0x013e -1 -1
+syscon nr __NR_aio_suspend -1 0x200013b 0x013b -1 -1
+syscon nr __NR_aio_cancel -1 0x200013c 0x013c -1 -1
+syscon nr __NR_aio_fsync -1 0x2000139 0x01d1 -1 -1
+syscon nr __NR_aio_error -1 0x200013d 0x013d -1 -1
+syscon nr __NR_aio_return -1 0x200013a 0x013a -1 -1
+syscon nr __NR_aio_write -1 0x200013f 0x013f -1 -1
+syscon nr __NR_aio_waitcomplete -1 -1 0x0167 -1 -1
+syscon nr __NR_aio_suspend_nocancel -1 0x20001a5 -1 -1 -1
+syscon nr __NR_aio_mlock -1 -1 0x021f -1 -1
+syscon nr __NR_sigwait -1 0x200014a 0x01ad -1 -1
+syscon nr __NR_undelete -1 0x20000cd 0x00cd -1 -1
+syscon nr __NR_getlogin -1 0x2000031 0x0031 -1 -1
+syscon nr __NR_getdtablesize -1 0x2000059 0x0059 -1 -1
+syscon nr __NR_setauid -1 0x2000162 0x01c0 -1 -1
+syscon nr __NR_audit -1 0x200015e 0x01bd -1 -1
+syscon nr __NR_auditctl -1 0x2000167 0x01c5 -1 -1
+syscon nr __NR_getaudit_addr -1 0x2000165 0x01c3 -1 -1
+syscon nr __NR_getdirentries -1 0x2000158 0x022a -1 -1
+syscon nr __NR_lio_listio -1 0x2000140 0x0140 -1 -1
+syscon nr __NR_setaudit_addr -1 0x2000166 0x01c4 -1 -1
+syscon nr __NR_getauid -1 0x2000161 0x01bf -1 -1
+syscon nr __NR_semsys -1 0x20000fb 0x00a9 -1 -1
+syscon nr __NR_auditon -1 0x200015f 0x01be -1 -1
+syscon nr __NR_msgsys -1 0x20000fc 0x00aa -1 -1
+syscon nr __NR_shmsys -1 0x20000fd 0x00ab -1 -1
+syscon nr __NR_fhstat -1 -1 0x0229 0x0126 -1
+syscon nr __NR_chflagsat -1 -1 0x021c 0x006b -1
+syscon nr __NR_profil -1 -1 0x002c 0x002c -1
+syscon nr __NR_fhstatfs -1 -1 0x022e 0x0041 -1
+syscon nr __NR_utrace -1 -1 0x014f 0x00d1 -1
+syscon nr __NR_closefrom -1 -1 0x01fd 0x011f -1
+syscon nr __NR_pthread_markcancel -1 0x200014c -1 -1 -1
+syscon nr __NR_pthread_kill -1 0x2000148 -1 -1 -1
+syscon nr __NR_pthread_fchdir -1 0x200015d -1 -1 -1
+syscon nr __NR_pthread_sigmask -1 0x2000149 -1 -1 -1
+syscon nr __NR_pthread_chdir -1 0x200015c -1 -1 -1
+syscon nr __NR_pthread_canceled -1 0x200014d -1 -1 -1
+syscon nr __NR_disable_threadsignal -1 0x200014b -1 -1 -1
+syscon nr __NR_abort_with_payload -1 0x2000209 -1 -1 -1
+syscon nr __NR_accept_nocancel -1 0x2000194 -1 -1 -1
+syscon nr __NR_access_extended -1 0x200011c -1 -1 -1
+syscon nr __NR_audit_session_join -1 0x20001ad -1 -1 -1
+syscon nr __NR_audit_session_port -1 0x20001b0 -1 -1 -1
+syscon nr __NR_audit_session_self -1 0x20001ac -1 -1 -1
+syscon nr __NR_bsdthread_create -1 0x2000168 -1 -1 -1
+syscon nr __NR_bsdthread_ctl -1 0x20001de -1 -1 -1
+syscon nr __NR_bsdthread_register -1 0x200016e -1 -1 -1
+syscon nr __NR_bsdthread_terminate -1 0x2000169 -1 -1 -1
+syscon nr __NR_change_fdguard_np -1 0x20001bc -1 -1 -1
+syscon nr __NR_chmod_extended -1 0x200011a -1 -1 -1
+syscon nr __NR_clonefileat -1 0x20001ce -1 -1 -1
+syscon nr __NR_close_nocancel -1 0x200018f -1 -1 -1
+syscon nr __NR_coalition -1 0x20001ca -1 -1 -1
+syscon nr __NR_coalition_info -1 0x20001cb -1 -1 -1
+syscon nr __NR_connect_nocancel -1 0x2000199 -1 -1 -1
+syscon nr __NR_connectx -1 0x20001bf -1 -1 -1
+syscon nr __NR_copyfile -1 0x20000e3 -1 -1 -1
+syscon nr __NR_csops -1 0x20000a9 -1 -1 -1
+syscon nr __NR_csops_audittoken -1 0x20000aa -1 -1 -1
+syscon nr __NR_csrctl -1 0x20001e3 -1 -1 -1
+syscon nr __NR_delete -1 0x20000e2 -1 -1 -1
+syscon nr __NR_disconnectx -1 0x20001c0 -1 -1 -1
+syscon nr __NR_exchangedata -1 0x20000df -1 -1 -1
+syscon nr __NR_fchmod_extended -1 0x200011b -1 -1 -1
+syscon nr __NR_fclonefileat -1 0x2000205 -1 -1 -1
+syscon nr __NR_fcntl_nocancel -1 0x2000196 -1 -1 -1
+syscon nr __NR_ffsctl -1 0x20000f5 -1 -1 -1
+syscon nr __NR_fgetattrlist -1 0x20000e4 -1 -1 -1
+syscon nr __NR_fileport_makefd -1 0x20001af -1 -1 -1
+syscon nr __NR_fileport_makeport -1 0x20001ae -1 -1 -1
+syscon nr __NR_fmount -1 0x200020e -1 -1 -1
+syscon nr __NR_fs_snapshot -1 0x2000206 -1 -1 -1
+syscon nr __NR_fsctl -1 0x20000f2 -1 -1 -1
+syscon nr __NR_fsetattrlist -1 0x20000e5 -1 -1 -1
+syscon nr __NR_fstat_extended -1 0x2000119 -1 -1 -1
+syscon nr __NR_fsync_nocancel -1 0x2000198 -1 -1 -1
+syscon nr __NR_getattrlist -1 0x20000dc -1 -1 -1
+syscon nr __NR_getattrlistat -1 0x20001dc -1 -1 -1
+syscon nr __NR_getattrlistbulk -1 0x20001cd -1 -1 -1
+syscon nr __NR_getdirentriesattr -1 0x20000de -1 -1 -1
+syscon nr __NR_gethostuuid -1 0x200008e -1 -1 -1
+syscon nr __NR_getsgroups -1 0x2000120 -1 -1 -1
+syscon nr __NR_getwgroups -1 0x2000122 -1 -1 -1
+syscon nr __NR_grab_pgo_data -1 0x20001ed -1 -1 -1
+syscon nr __NR_guarded_close_np -1 0x20001ba -1 -1 -1
+syscon nr __NR_guarded_kqueue_np -1 0x20001bb -1 -1 -1
+syscon nr __NR_guarded_open_np -1 0x20001b9 -1 -1 -1
+syscon nr __NR_guarded_pwrite_np -1 0x20001e6 -1 -1 -1
+syscon nr __NR_guarded_write_np -1 0x20001e5 -1 -1 -1
+syscon nr __NR_guarded_writev_np -1 0x20001e7 -1 -1 -1
+syscon nr __NR_identitysvc -1 0x2000125 -1 -1 -1
+syscon nr __NR_initgroups -1 0x20000f3 -1 -1 -1
+syscon nr __NR_iopolicysys -1 0x2000142 -1 -1 -1
+syscon nr __NR_kas_info -1 0x20001b7 -1 -1 -1
+syscon nr __NR_kdebug_trace -1 0x20000b3 -1 -1 -1
+syscon nr __NR_kdebug_trace_string -1 0x20000b2 -1 -1 -1
+syscon nr __NR_kdebug_typefilter -1 0x20000b1 -1 -1 -1
+syscon nr __NR_kevent_id -1 0x2000177 -1 -1 -1
+syscon nr __NR_kevent_qos -1 0x2000176 -1 -1 -1
+syscon nr __NR_ledger -1 0x2000175 -1 -1 -1
+syscon nr __NR_lstat_extended -1 0x2000156 -1 -1 -1
+syscon nr __NR_memorystatus_control -1 0x20001b8 -1 -1 -1
+syscon nr __NR_memorystatus_get_level -1 0x20001c5 -1 -1 -1
+syscon nr __NR_microstackshot -1 0x20001ec -1 -1 -1
+syscon nr __NR_mkdir_extended -1 0x2000124 -1 -1 -1
+syscon nr __NR_mkfifo_extended -1 0x2000123 -1 -1 -1
+syscon nr __NR_modwatch -1 0x20000e9 -1 -1 -1
+syscon nr __NR_mremap_encrypted -1 0x20001e9 -1 -1 -1
+syscon nr __NR_msgrcv_nocancel -1 0x20001a3 -1 -1 -1
+syscon nr __NR_msgsnd_nocancel -1 0x20001a2 -1 -1 -1
+syscon nr __NR_msync_nocancel -1 0x2000195 -1 -1 -1
+syscon nr __NR_necp_client_action -1 0x20001f6 -1 -1 -1
+syscon nr __NR_necp_match_policy -1 0x20001cc -1 -1 -1
+syscon nr __NR_necp_open -1 0x20001f5 -1 -1 -1
+syscon nr __NR_necp_session_action -1 0x200020b -1 -1 -1
+syscon nr __NR_necp_session_open -1 0x200020a -1 -1 -1
+syscon nr __NR_net_qos_guideline -1 0x200020d -1 -1 -1
+syscon nr __NR_netagent_trigger -1 0x20001ea -1 -1 -1
+syscon nr __NR_nfsclnt -1 0x20000f7 -1 -1 -1
+syscon nr __NR_open_dprotected_np -1 0x20000d8 -1 -1 -1
+syscon nr __NR_open_extended -1 0x2000115 -1 -1 -1
+syscon nr __NR_open_nocancel -1 0x200018e -1 -1 -1
+syscon nr __NR_openat_nocancel -1 0x20001d0 -1 -1 -1
+syscon nr __NR_openbyid_np -1 0x20001df -1 -1 -1
+syscon nr __NR_os_fault_with_payload -1 0x2000211 -1 -1 -1
+syscon nr __NR_peeloff -1 0x20001c1 -1 -1 -1
+syscon nr __NR_persona -1 0x20001ee -1 -1 -1
+syscon nr __NR_pid_hibernate -1 0x20001b3 -1 -1 -1
+syscon nr __NR_pid_resume -1 0x20001b2 -1 -1 -1
+syscon nr __NR_pid_shutdown_sockets -1 0x20001b4 -1 -1 -1
+syscon nr __NR_pid_suspend -1 0x20001b1 -1 -1 -1
+syscon nr __NR_poll_nocancel -1 0x20001a1 -1 -1 -1
+syscon nr __NR_pread_nocancel -1 0x200019e -1 -1 -1
+syscon nr __NR_proc_info -1 0x2000150 -1 -1 -1
+syscon nr __NR_proc_rlimit_control -1 0x20001be -1 -1 -1
+syscon nr __NR_proc_trace_log -1 0x20001dd -1 -1 -1
+syscon nr __NR_proc_uuid_policy -1 0x20001c4 -1 -1 -1
+syscon nr __NR_process_policy -1 0x2000143 -1 -1 -1
+syscon nr __NR_pselect_nocancel -1 0x200018b -1 -1 -1
+syscon nr __NR_psynch_cvbroad -1 0x200012f -1 -1 -1
+syscon nr __NR_psynch_cvclrprepost -1 0x2000138 -1 -1 -1
+syscon nr __NR_psynch_cvsignal -1 0x2000130 -1 -1 -1
+syscon nr __NR_psynch_mutexdrop -1 0x200012e -1 -1 -1
+syscon nr __NR_psynch_mutexwait -1 0x200012d -1 -1 -1
+syscon nr __NR_psynch_rw_downgrade -1 0x200012b -1 -1 -1
+syscon nr __NR_psynch_rw_longrdlock -1 0x2000129 -1 -1 -1
+syscon nr __NR_psynch_rw_rdlock -1 0x2000132 -1 -1 -1
+syscon nr __NR_psynch_rw_unlock -1 0x2000134 -1 -1 -1
+syscon nr __NR_psynch_rw_unlock2 -1 0x2000135 -1 -1 -1
+syscon nr __NR_psynch_rw_upgrade -1 0x200012c -1 -1 -1
+syscon nr __NR_psynch_rw_wrlock -1 0x2000133 -1 -1 -1
+syscon nr __NR_psynch_rw_yieldwrlock -1 0x200012a -1 -1 -1
+syscon nr __NR_pwrite_nocancel -1 0x200019f -1 -1 -1
+syscon nr __NR_read_nocancel -1 0x200018c -1 -1 -1
+syscon nr __NR_readv_nocancel -1 0x200019b -1 -1 -1
+syscon nr __NR_recvfrom_nocancel -1 0x2000193 -1 -1 -1
+syscon nr __NR_recvmsg_nocancel -1 0x2000191 -1 -1 -1
+syscon nr __NR_recvmsg_x -1 0x20001e0 -1 -1 -1
+syscon nr __NR_renameatx_np -1 0x20001e8 -1 -1 -1
+syscon nr __NR_searchfs -1 0x20000e1 -1 -1 -1
+syscon nr __NR_select_nocancel -1 0x2000197 -1 -1 -1
+syscon nr __NR_sem_close -1 0x200010d -1 -1 -1
+syscon nr __NR_sem_open -1 0x200010c -1 -1 -1
+syscon nr __NR_sem_post -1 0x2000111 -1 -1 -1
+syscon nr __NR_sem_trywait -1 0x2000110 -1 -1 -1
+syscon nr __NR_sem_unlink -1 0x200010e -1 -1 -1
+syscon nr __NR_sem_wait -1 0x200010f -1 -1 -1
+syscon nr __NR_sem_wait_nocancel -1 0x20001a4 -1 -1 -1
+syscon nr __NR_sendmsg_nocancel -1 0x2000192 -1 -1 -1
+syscon nr __NR_sendmsg_x -1 0x20001e1 -1 -1 -1
+syscon nr __NR_sendto_nocancel -1 0x200019d -1 -1 -1
+syscon nr __NR_setattrlist -1 0x20000dd -1 -1 -1
+syscon nr __NR_setattrlistat -1 0x200020c -1 -1 -1
+syscon nr __NR_setprivexec -1 0x2000098 -1 -1 -1
+syscon nr __NR_setsgroups -1 0x200011f -1 -1 -1
+syscon nr __NR_settid -1 0x200011d -1 -1 -1
+syscon nr __NR_settid_with_pid -1 0x2000137 -1 -1 -1
+syscon nr __NR_setwgroups -1 0x2000121 -1 -1 -1
+syscon nr __NR_sfi_ctl -1 0x20001c8 -1 -1 -1
+syscon nr __NR_sfi_pidctl -1 0x20001c9 -1 -1 -1
+syscon nr __NR_shared_region_check_np -1 0x2000126 -1 -1 -1
+syscon nr __NR_sigsuspend_nocancel -1 0x200019a -1 -1 -1
+syscon nr __NR_socket_delegate -1 0x20001c2 -1 -1 -1
+syscon nr __NR_stat_extended -1 0x2000155 -1 -1 -1
+syscon nr __NR_sysctlbyname -1 0x2000112 -1 -1 -1
+syscon nr __NR_system_override -1 0x20001c6 -1 -1 -1
+syscon nr __NR_telemetry -1 0x20001c3 -1 -1 -1
+syscon nr __NR_terminate_with_payload -1 0x2000208 -1 -1 -1
+syscon nr __NR_thread_selfcounts -1 0x20000ba -1 -1 -1
+syscon nr __NR_thread_selfid -1 0x2000174 -1 -1 -1
+syscon nr __NR_thread_selfusage -1 0x20001e2 -1 -1 -1
+syscon nr __NR_ulock_wait -1 0x2000203 -1 -1 -1
+syscon nr __NR_ulock_wake -1 0x2000204 -1 -1 -1
+syscon nr __NR_umask_extended -1 0x2000116 -1 -1 -1
+syscon nr __NR_usrctl -1 0x20001bd -1 -1 -1
+syscon nr __NR_vfs_purge -1 0x20001c7 -1 -1 -1
+syscon nr __NR_vm_pressure_monitor -1 0x2000128 -1 -1 -1
+syscon nr __NR_wait4_nocancel -1 0x2000190 -1 -1 -1
+syscon nr __NR_waitevent -1 0x20000e8 -1 -1 -1
+syscon nr __NR_waitid_nocancel -1 0x20001a0 -1 -1 -1
+syscon nr __NR_watchevent -1 0x20000e7 -1 -1 -1
+syscon nr __NR_work_interval_ctl -1 0x20001f3 -1 -1 -1
+syscon nr __NR_workq_kernreturn -1 0x2000170 -1 -1 -1
+syscon nr __NR_workq_open -1 0x200016f -1 -1 -1
+syscon nr __NR_write_nocancel -1 0x200018d -1 -1 -1
+syscon nr __NR_writev_nocancel -1 0x200019c -1 -1 -1
+syscon nr __NR_abort2 -1 -1 0x01cf -1 -1
+syscon nr __NR_afs3_syscall -1 -1 0x0179 -1 -1
+syscon nr __NR_bindat -1 -1 0x021a -1 -1
+syscon nr __NR_break -1 -1 0x0011 -1 -1
+syscon nr __NR_cap_enter -1 -1 0x0204 -1 -1
+syscon nr __NR_cap_fcntls_get -1 -1 0x0219 -1 -1
+syscon nr __NR_cap_fcntls_limit -1 -1 0x0218 -1 -1
+syscon nr __NR_cap_getmode -1 -1 0x0205 -1 -1
+syscon nr __NR_cap_ioctls_get -1 -1 0x0217 -1 -1
+syscon nr __NR_cap_ioctls_limit -1 -1 0x0216 -1 -1
+syscon nr __NR_cap_rights_limit -1 -1 0x0215 -1 -1
+syscon nr __NR_clock_getcpuclockid2 -1 -1 0x00f7 -1 -1
+syscon nr __NR_connectat -1 -1 0x021b -1 -1
+syscon nr __NR_cpuset -1 -1 0x01e4 -1 -1
+syscon nr __NR_cpuset_getdomain -1 -1 0x0231 -1 -1
+syscon nr __NR_cpuset_getid -1 -1 0x01e6 -1 -1
+syscon nr __NR_cpuset_setdomain -1 -1 0x0232 -1 -1
+syscon nr __NR_cpuset_setid -1 -1 0x01e5 -1 -1
+syscon nr __NR_eaccess -1 -1 0x0178 -1 -1
+syscon nr __NR_extattr_delete_fd -1 -1 0x0175 -1 -1
+syscon nr __NR_extattr_delete_file -1 -1 0x0166 -1 -1
+syscon nr __NR_extattr_delete_link -1 -1 0x019e -1 -1
+syscon nr __NR_extattr_get_fd -1 -1 0x0174 -1 -1
+syscon nr __NR_extattr_get_file -1 -1 0x0165 -1 -1
+syscon nr __NR_extattr_get_link -1 -1 0x019d -1 -1
+syscon nr __NR_extattr_list_fd -1 -1 0x01b5 -1 -1
+syscon nr __NR_extattr_list_file -1 -1 0x01b6 -1 -1
+syscon nr __NR_extattr_list_link -1 -1 0x01b7 -1 -1
+syscon nr __NR_extattr_set_fd -1 -1 0x0173 -1 -1
+syscon nr __NR_extattr_set_file -1 -1 0x0164 -1 -1
+syscon nr __NR_extattr_set_link -1 -1 0x019c -1 -1
+syscon nr __NR_extattrctl -1 -1 0x0163 -1 -1
+syscon nr __NR_fexecve -1 -1 0x01ec -1 -1
+syscon nr __NR_ffclock_getcounter -1 -1 0x00f1 -1 -1
+syscon nr __NR_ffclock_getestimate -1 -1 0x00f3 -1 -1
+syscon nr __NR_ffclock_setestimate -1 -1 0x00f2 -1 -1
+syscon nr __NR_fhlink -1 -1 0x0235 -1 -1
+syscon nr __NR_fhlinkat -1 -1 0x0236 -1 -1
+syscon nr __NR_fhreadlink -1 -1 0x0237 -1 -1
+syscon nr __NR_getaudit -1 -1 0x01c1 -1 -1
+syscon nr __NR_getcontext -1 -1 0x01a5 -1 -1
+syscon nr __NR_getfhat -1 -1 0x0234 -1 -1
+syscon nr __NR_gethostid -1 -1 0x008e -1 -1
+syscon nr __NR_getkerninfo -1 -1 0x003f -1 -1
+syscon nr __NR_getloginclass -1 -1 0x020b -1 -1
+syscon nr __NR_getpagesize -1 -1 0x0040 -1 -1
+syscon nr __NR_gssd_syscall -1 -1 0x01f9 -1 -1
+syscon nr __NR_jail -1 -1 0x0152 -1 -1
+syscon nr __NR_jail_attach -1 -1 0x01b4 -1 -1
+syscon nr __NR_jail_get -1 -1 0x01fa -1 -1
+syscon nr __NR_jail_remove -1 -1 0x01fc -1 -1
+syscon nr __NR_jail_set -1 -1 0x01fb -1 -1
+syscon nr __NR_kenv -1 -1 0x0186 -1 -1
+syscon nr __NR_kldfind -1 -1 0x0132 -1 -1
+syscon nr __NR_kldfirstmod -1 -1 0x0135 -1 -1
+syscon nr __NR_kldload -1 -1 0x0130 -1 -1
+syscon nr __NR_kldnext -1 -1 0x0133 -1 -1
+syscon nr __NR_kldstat -1 -1 0x0134 -1 -1
+syscon nr __NR_kldsym -1 -1 0x0151 -1 -1
+syscon nr __NR_kldunload -1 -1 0x0131 -1 -1
+syscon nr __NR_kldunloadf -1 -1 0x01bc -1 -1
+syscon nr __NR_kmq_notify -1 -1 0x01cd -1 -1
+syscon nr __NR_kmq_setattr -1 -1 0x01ca -1 -1
+syscon nr __NR_kmq_timedreceive -1 -1 0x01cb -1 -1
+syscon nr __NR_kmq_timedsend -1 -1 0x01cc -1 -1
+syscon nr __NR_kmq_unlink -1 -1 0x01ce -1 -1
+syscon nr __NR_ksem_close -1 -1 0x0190 -1 -1
+syscon nr __NR_ksem_destroy -1 -1 0x0198 -1 -1
+syscon nr __NR_ksem_getvalue -1 -1 0x0197 -1 -1
+syscon nr __NR_ksem_init -1 -1 0x0194 -1 -1
+syscon nr __NR_ksem_open -1 -1 0x0195 -1 -1
+syscon nr __NR_ksem_post -1 -1 0x0191 -1 -1
+syscon nr __NR_ksem_timedwait -1 -1 0x01b9 -1 -1
+syscon nr __NR_ksem_trywait -1 -1 0x0193 -1 -1
+syscon nr __NR_ksem_unlink -1 -1 0x0196 -1 -1
+syscon nr __NR_ksem_wait -1 -1 0x0192 -1 -1
+syscon nr __NR_ktimer_create -1 -1 0x00eb -1 -1
+syscon nr __NR_ktimer_delete -1 -1 0x00ec -1 -1
+syscon nr __NR_ktimer_getoverrun -1 -1 0x00ef -1 -1
+syscon nr __NR_ktimer_gettime -1 -1 0x00ee -1 -1
+syscon nr __NR_ktimer_settime -1 -1 0x00ed -1 -1
+syscon nr __NR_lchflags -1 -1 0x0187 -1 -1
+syscon nr __NR_lchmod -1 -1 0x0112 -1 -1
+syscon nr __NR_lgetfh -1 -1 0x00a0 -1 -1
+syscon nr __NR_lpathconf -1 -1 0x0201 -1 -1
+syscon nr __NR_lutimes -1 -1 0x0114 -1 -1
+syscon nr __NR_mac_syscall -1 -1 0x018a -1 -1
+syscon nr __NR_modfind -1 -1 0x012f -1 -1
+syscon nr __NR_modfnext -1 -1 0x012e -1 -1
+syscon nr __NR_modnext -1 -1 0x012c -1 -1
+syscon nr __NR_modstat -1 -1 0x012d -1 -1
+syscon nr __NR_nfstat -1 -1 0x0117 -1 -1
+syscon nr __NR_nlm_syscall -1 -1 0x009a -1 -1
+syscon nr __NR_nlstat -1 -1 0x0118 -1 -1
+syscon nr __NR_nmount -1 -1 0x017a -1 -1
+syscon nr __NR_nnpfs_syscall -1 -1 0x0153 -1 -1
+syscon nr __NR_nstat -1 -1 0x0116 -1 -1
+syscon nr __NR_pdfork -1 -1 0x0206 -1 -1
+syscon nr __NR_pdgetpid -1 -1 0x0208 -1 -1
+syscon nr __NR_pdkill -1 -1 0x0207 -1 -1
+syscon nr __NR_posix_openpt -1 -1 0x01f8 -1 -1
+syscon nr __NR_procctl -1 -1 0x0220 -1 -1
+syscon nr __NR_psynch_cvwait -1 0x2000131 -1 -1 -1
+syscon nr __NR_quota -1 -1 0x0095 -1 -1
+syscon nr __NR_rctl_add_rule -1 -1 0x0210 -1 -1
+syscon nr __NR_rctl_get_limits -1 -1 0x020f -1 -1
+syscon nr __NR_rctl_get_racct -1 -1 0x020d -1 -1
+syscon nr __NR_rctl_get_rules -1 -1 0x020e -1 -1
+syscon nr __NR_rctl_remove_rule -1 -1 0x0211 -1 -1
+syscon nr __NR_recv -1 -1 0x0066 -1 -1
+syscon nr __NR_rfork -1 -1 0x00fb -1 -1
+syscon nr __NR_rtprio -1 -1 0x00a6 -1 -1
+syscon nr __NR_rtprio_thread -1 -1 0x01d2 -1 -1
+syscon nr __NR_send -1 -1 0x0065 -1 -1
+syscon nr __NR_setaudit -1 -1 0x01c2 -1 -1
+syscon nr __NR_setcontext -1 -1 0x01a6 -1 -1
+syscon nr __NR_setfib -1 -1 0x00af -1 -1
+syscon nr __NR_sethostid -1 -1 0x008f -1 -1
+syscon nr __NR_setloginclass -1 -1 0x020c -1 -1
+syscon nr __NR_sigblock -1 -1 0x006d -1 -1
+syscon nr __NR_sigqueue -1 -1 0x01c8 -1 -1
+syscon nr __NR_sigsetmask -1 -1 0x006e -1 -1
+syscon nr __NR_sigstack -1 -1 0x0070 -1 -1
+syscon nr __NR_sigvec -1 -1 0x006c -1 -1
+syscon nr __NR_sigwaitinfo -1 -1 0x015a -1 -1
+syscon nr __NR_sstk -1 -1 0x0046 -1 -1
+syscon nr __NR_swapcontext -1 -1 0x01a7 -1 -1
+syscon nr __NR_thr_create -1 -1 0x01ae -1 -1
+syscon nr __NR_thr_exit -1 -1 0x01af -1 -1
+syscon nr __NR_thr_kill -1 -1 0x01b1 -1 -1
+syscon nr __NR_thr_kill2 -1 -1 0x01e1 -1 -1
+syscon nr __NR_thr_new -1 -1 0x01c7 -1 -1
+syscon nr __NR_thr_self -1 -1 0x01b0 -1 -1
+syscon nr __NR_thr_set_name -1 -1 0x01d0 -1 -1
+syscon nr __NR_thr_suspend -1 -1 0x01ba -1 -1
+syscon nr __NR_thr_wake -1 -1 0x01bb -1 -1
+syscon nr __NR_uuidgen -1 -1 0x0188 -1 -1
+syscon nr __NR_vadvise -1 -1 0x0048 -1 -1
+syscon nr __NR_wait -1 -1 0x0054 -1 -1
+syscon nr __NR_wait6 -1 -1 0x0214 -1 -1
+syscon nr __NR_yield -1 -1 0x0141 -1 -1
+syscon nr __NR_tfork -1 -1 -1 0x0008 -1
+syscon nr __NR_thrsleep -1 -1 -1 0x005e -1
+syscon nr __NR_thrwakeup -1 -1 -1 0x012d -1
+syscon nr __NR_threxit -1 -1 -1 0x012e -1
+syscon nr __NR_thrsigdivert -1 -1 -1 0x012f -1
+syscon nr __NR_set_tcb -1 -1 -1 0x0149 -1
+syscon nr __NR_get_tcb -1 -1 -1 0x014a -1
+syscon nr __NR_adjfreq -1 -1 -1 0x0131 -1
+syscon nr __NR_getdtablecount -1 -1 -1 0x0012 -1
+syscon nr __NR_getlogin_r -1 -1 -1 0x008d -1
+syscon nr __NR_getrtable -1 -1 -1 0x0137 -1
+syscon nr __NR_getthrid -1 -1 -1 0x012b -1
+syscon nr __NR_kbind -1 -1 -1 0x0056 -1
+syscon nr __NR_mquery -1 -1 -1 0x011e -1
+syscon nr __NR_obreak -1 -1 -1 0x0011 -1
+syscon nr __NR_sendsyslog -1 -1 -1 0x0070 -1
+syscon nr __NR_setrtable -1 -1 -1 0x0136 -1
+syscon nr __NR_swapctl -1 -1 -1 0x00c1 -1
+syscon nr __NR_thrkill -1 -1 -1 0x0077 -1
+syscon nr __NR_unveil -1 -1 -1 0x0072 -1
+syscon nr __NR_mac_get_link -1 0x2000180 0x019a -1 -1
+syscon nr __NR_mac_set_link -1 0x2000181 0x019b -1 -1
+syscon nr __NR_mac_get_fd -1 0x2000184 0x0182 -1 -1
+syscon nr __NR_mac_get_file -1 0x200017e 0x0183 -1 -1
+syscon nr __NR_mac_get_proc -1 0x2000182 0x0180 -1 -1
+syscon nr __NR_mac_set_fd -1 0x2000185 0x0184 -1 -1
+syscon nr __NR_mac_get_pid -1 0x2000186 0x0199 -1 -1
+syscon nr __NR_mac_set_proc -1 0x2000183 0x0181 -1 -1
+syscon nr __NR_mac_set_file -1 0x200017f 0x0185 -1 -1
+syscon nr __NR_mac_execve -1 0x200017c 0x019f -1 -1
+syscon nr __NR_acl_get_link -1 -1 0x01a9 -1 -1
+syscon nr __NR_sigwait_nocancel -1 0x20001a6 -1 -1 -1
+syscon nr __NR_cap_rights_get -1 -1 0x0203 -1 -1
+syscon nr __NR_semwait_signal -1 0x200014e -1 -1 -1
+syscon nr __NR_acl_set_link -1 -1 0x01aa -1 -1
+syscon nr __NR_acl_set_fd -1 -1 0x015e -1 -1
+syscon nr __NR_old_semwait_signal -1 0x2000172 -1 -1 -1
+syscon nr __NR_setugid -1 -1 0x0176 -1 -1
+syscon nr __NR_acl_aclcheck_fd -1 -1 0x0162 -1 -1
+syscon nr __NR_acl_get_fd -1 -1 0x015d -1 -1
+syscon nr __NR___sysctl -1 -1 0x00ca -1 -1
+syscon nr __NR_mac_getfsstat -1 0x20001aa -1 -1 -1
+syscon nr __NR_mac_get_mount -1 0x20001a9 -1 -1 -1
+syscon nr __NR_acl_delete_link -1 -1 0x01ab -1 -1
+syscon nr __NR_mac_mount -1 0x20001a8 -1 -1 -1
+syscon nr __NR_acl_get_file -1 -1 0x015b -1 -1
+syscon nr __NR_acl_aclcheck_file -1 -1 0x0161 -1 -1
+syscon nr __NR_acl_delete_fd -1 -1 0x0160 -1 -1
+syscon nr __NR_acl_aclcheck_link -1 -1 0x01ac -1 -1
+syscon nr __NR___mac_syscall -1 0x200017d -1 -1 -1
+syscon nr __NR_acl_set_file -1 -1 0x015c -1 -1
+syscon nr __NR_acl_delete_file -1 -1 0x015f -1 -1
+syscon nr __NR_syscall -1 -1 -1 0x00c6 -1
+syscon nr __NR__umtx_op -1 -1 0x01c6 -1 -1
+syscon nr __NR_semwait_signal_nocancel -1 0x20001a7 -1 -1 -1
+syscon nr __NR_old_semwait_signal_nocancel -1 0x2000173 -1 -1 -1
+syscon nr __NR_sctp_peeloff -1 -1 0x01d7 -1 -1
+syscon nr __NR_sctp_generic_recvmsg -1 -1 0x01da -1 -1
+syscon nr __NR_sctp_generic_sendmsg -1 -1 0x01d8 -1 -1
+syscon nr __NR_sctp_generic_sendmsg_iov -1 -1 0x01d9 -1 -1
+syscon nr __NR_shared_region_map_and_slide_np -1 0x20001b6 -1 -1 -1
+syscon nr __NR_guarded_open_dprotected_np -1 0x20001e4 -1 -1 -1
+syscon nr __NR_stack_snapshot_with_config -1 0x20001eb -1 -1 -1
# https://youtu.be/GUQUD3IMbb4?t=85
diff --git a/libc/sysv/consts/CLOCK_MONOTONIC.s b/libc/sysv/consts/CLOCK_MONOTONIC.s
index 2d42bac4..553f8deb 100644
--- a/libc/sysv/consts/CLOCK_MONOTONIC.s
+++ b/libc/sysv/consts/CLOCK_MONOTONIC.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon clock CLOCK_MONOTONIC 4 1 4 3 1
+.syscon clock CLOCK_MONOTONIC 1 1 4 3 1
diff --git a/libc/sysv/consts/PTRACE_ATTACH.s b/libc/sysv/consts/PTRACE_ATTACH.s
new file mode 100644
index 00000000..b9f82e63
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_ATTACH.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_ATTACH 16 10 10 9 -1
diff --git a/libc/sysv/consts/PT_ATTACH.s b/libc/sysv/consts/PTRACE_CONT.s
similarity index 50%
rename from libc/sysv/consts/PT_ATTACH.s
rename to libc/sysv/consts/PTRACE_CONT.s
index 88e925b6..0b9e395d 100644
--- a/libc/sysv/consts/PT_ATTACH.s
+++ b/libc/sysv/consts/PTRACE_CONT.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_ATTACH 0x10 10 10 9 0
+.syscon ptrace PTRACE_CONT 7 7 7 7 -1
diff --git a/libc/sysv/consts/PTRACE_DETACH.s b/libc/sysv/consts/PTRACE_DETACH.s
new file mode 100644
index 00000000..f074177d
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_DETACH.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_DETACH 17 11 11 10 -1
diff --git a/libc/sysv/consts/PTRACE_EVENT_CLONE.s b/libc/sysv/consts/PTRACE_EVENT_CLONE.s
new file mode 100644
index 00000000..ab860f4b
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_EVENT_CLONE.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_EVENT_CLONE 3 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_EVENT_EXEC.s b/libc/sysv/consts/PTRACE_EVENT_EXEC.s
new file mode 100644
index 00000000..be0847bd
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_EVENT_EXEC.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_EVENT_EXEC 4 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_EVENT_EXIT.s b/libc/sysv/consts/PTRACE_EVENT_EXIT.s
new file mode 100644
index 00000000..fcd29b80
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_EVENT_EXIT.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_EVENT_EXIT 6 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_EVENT_FORK.s b/libc/sysv/consts/PTRACE_EVENT_FORK.s
new file mode 100644
index 00000000..a38d00b4
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_EVENT_FORK.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_EVENT_FORK 1 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_EVENT_VFORK.s b/libc/sysv/consts/PTRACE_EVENT_VFORK.s
new file mode 100644
index 00000000..374f1675
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_EVENT_VFORK.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_EVENT_VFORK 2 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_EVENT_VFORK_DONE.s b/libc/sysv/consts/PTRACE_EVENT_VFORK_DONE.s
new file mode 100644
index 00000000..6e56553f
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_EVENT_VFORK_DONE.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_EVENT_VFORK_DONE 5 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_GETEVENTMSG.s b/libc/sysv/consts/PTRACE_GETEVENTMSG.s
new file mode 100644
index 00000000..6df8aa8e
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_GETEVENTMSG.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_GETEVENTMSG 0x4201 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_GETFPREGS.s b/libc/sysv/consts/PTRACE_GETFPREGS.s
new file mode 100644
index 00000000..83151635
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_GETFPREGS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_GETFPREGS 14 -1 35 35 -1
diff --git a/libc/sysv/consts/PTRACE_GETFPXREGS.s b/libc/sysv/consts/PTRACE_GETFPXREGS.s
new file mode 100644
index 00000000..ec64db9c
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_GETFPXREGS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_GETFPXREGS 18 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_GETREGS.s b/libc/sysv/consts/PTRACE_GETREGS.s
new file mode 100644
index 00000000..990f2deb
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_GETREGS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_GETREGS 12 -1 33 33 -1
diff --git a/libc/sysv/consts/PTRACE_GETREGSET.s b/libc/sysv/consts/PTRACE_GETREGSET.s
index 2f37ad75..b8c1be06 100644
--- a/libc/sysv/consts/PTRACE_GETREGSET.s
+++ b/libc/sysv/consts/PTRACE_GETREGSET.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_GETREGSET 0x4204 0 0 0 0
+.syscon ptrace PTRACE_GETREGSET 0x4204 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_GETSIGINFO.s b/libc/sysv/consts/PTRACE_GETSIGINFO.s
new file mode 100644
index 00000000..858e0c53
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_GETSIGINFO.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_GETSIGINFO 0x4202 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_GETSIGMASK.s b/libc/sysv/consts/PTRACE_GETSIGMASK.s
index 00ec0497..310c8f32 100644
--- a/libc/sysv/consts/PTRACE_GETSIGMASK.s
+++ b/libc/sysv/consts/PTRACE_GETSIGMASK.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_GETSIGMASK 0x420a 0 0 0 0
+.syscon ptrace PTRACE_GETSIGMASK 0x420a -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_INTERRUPT.s b/libc/sysv/consts/PTRACE_INTERRUPT.s
index 6d8d7d49..09dd0393 100644
--- a/libc/sysv/consts/PTRACE_INTERRUPT.s
+++ b/libc/sysv/consts/PTRACE_INTERRUPT.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_INTERRUPT 0x4207 0 0 0 0
+.syscon ptrace PTRACE_INTERRUPT 0x4207 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PT_CONTINUE.s b/libc/sysv/consts/PTRACE_KILL.s
similarity index 50%
rename from libc/sysv/consts/PT_CONTINUE.s
rename to libc/sysv/consts/PTRACE_KILL.s
index 3c1e2f1a..87d870d4 100644
--- a/libc/sysv/consts/PT_CONTINUE.s
+++ b/libc/sysv/consts/PTRACE_KILL.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_CONTINUE 7 7 7 7 0
+.syscon ptrace PTRACE_KILL 8 8 8 8 -1
diff --git a/libc/sysv/consts/PTRACE_LISTEN.s b/libc/sysv/consts/PTRACE_LISTEN.s
index 83c8fb8f..b9f3e87f 100644
--- a/libc/sysv/consts/PTRACE_LISTEN.s
+++ b/libc/sysv/consts/PTRACE_LISTEN.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_LISTEN 0x4208 0 0 0 0
+.syscon ptrace PTRACE_LISTEN 0x4208 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_MASK.s b/libc/sysv/consts/PTRACE_O_MASK.s
new file mode 100644
index 00000000..2af8df3f
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_MASK.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_MASK 0x007f -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACECLONE.s b/libc/sysv/consts/PTRACE_O_TRACECLONE.s
new file mode 100644
index 00000000..ab087c37
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACECLONE.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACECLONE 0x0008 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACEEXEC.s b/libc/sysv/consts/PTRACE_O_TRACEEXEC.s
new file mode 100644
index 00000000..a4d7bbd2
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACEEXEC.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACEEXEC 0x0010 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACEEXIT.s b/libc/sysv/consts/PTRACE_O_TRACEEXIT.s
new file mode 100644
index 00000000..83b8a7b1
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACEEXIT.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACEEXIT 0x0040 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACEFORK.s b/libc/sysv/consts/PTRACE_O_TRACEFORK.s
new file mode 100644
index 00000000..e0f25518
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACEFORK.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACEFORK 0x0002 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACESYSGOOD.s b/libc/sysv/consts/PTRACE_O_TRACESYSGOOD.s
new file mode 100644
index 00000000..a4a33c86
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACESYSGOOD.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACESYSGOOD 0x0001 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACEVFORK.s b/libc/sysv/consts/PTRACE_O_TRACEVFORK.s
new file mode 100644
index 00000000..b3ea27ce
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACEVFORK.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACEVFORK 0x0004 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_O_TRACEVFORKDONE.s b/libc/sysv/consts/PTRACE_O_TRACEVFORKDONE.s
new file mode 100644
index 00000000..17fc3b79
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_O_TRACEVFORKDONE.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_O_TRACEVFORKDONE 0x0020 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_PEEKDATA.s b/libc/sysv/consts/PTRACE_PEEKDATA.s
new file mode 100644
index 00000000..d2a44f72
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_PEEKDATA.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_PEEKDATA 2 2 2 2 -1
diff --git a/libc/sysv/consts/PTRACE_PEEKSIGINFO.s b/libc/sysv/consts/PTRACE_PEEKSIGINFO.s
index 028e6b20..a723285a 100644
--- a/libc/sysv/consts/PTRACE_PEEKSIGINFO.s
+++ b/libc/sysv/consts/PTRACE_PEEKSIGINFO.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_PEEKSIGINFO 0x4209 0 0 0 0
+.syscon ptrace PTRACE_PEEKSIGINFO 0x4209 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_PEEKTEXT.s b/libc/sysv/consts/PTRACE_PEEKTEXT.s
new file mode 100644
index 00000000..5e04db05
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_PEEKTEXT.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_PEEKTEXT 1 1 1 1 -1
diff --git a/libc/sysv/consts/PTRACE_PEEKUSER.s b/libc/sysv/consts/PTRACE_PEEKUSER.s
new file mode 100644
index 00000000..d568de87
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_PEEKUSER.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_PEEKUSER 3 3 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_POKEDATA.s b/libc/sysv/consts/PTRACE_POKEDATA.s
new file mode 100644
index 00000000..60c5061d
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_POKEDATA.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_POKEDATA 5 5 5 5 -1
diff --git a/libc/sysv/consts/PTRACE_POKETEXT.s b/libc/sysv/consts/PTRACE_POKETEXT.s
new file mode 100644
index 00000000..73d6314e
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_POKETEXT.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_POKETEXT 4 4 4 4 -1
diff --git a/libc/sysv/consts/PTRACE_POKEUSER.s b/libc/sysv/consts/PTRACE_POKEUSER.s
new file mode 100644
index 00000000..1ca71ea3
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_POKEUSER.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_POKEUSER 6 6 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SECCOMP_GET_FILTER.s b/libc/sysv/consts/PTRACE_SECCOMP_GET_FILTER.s
index 6c7b8a3c..57c810d1 100644
--- a/libc/sysv/consts/PTRACE_SECCOMP_GET_FILTER.s
+++ b/libc/sysv/consts/PTRACE_SECCOMP_GET_FILTER.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_SECCOMP_GET_FILTER 0x420c 0 0 0 0
+.syscon ptrace PTRACE_SECCOMP_GET_FILTER 0x420c -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SEIZE.s b/libc/sysv/consts/PTRACE_SEIZE.s
index 9e5510c7..aebc574d 100644
--- a/libc/sysv/consts/PTRACE_SEIZE.s
+++ b/libc/sysv/consts/PTRACE_SEIZE.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_SEIZE 0x4206 0 0 0 0
+.syscon ptrace PTRACE_SEIZE 0x4206 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SETFPREGS.s b/libc/sysv/consts/PTRACE_SETFPREGS.s
new file mode 100644
index 00000000..8ff22473
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_SETFPREGS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_SETFPREGS 15 -1 36 36 -1
diff --git a/libc/sysv/consts/PTRACE_SETFPXREGS.s b/libc/sysv/consts/PTRACE_SETFPXREGS.s
new file mode 100644
index 00000000..c9858977
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_SETFPXREGS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_SETFPXREGS 19 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SETOPTIONS.s b/libc/sysv/consts/PTRACE_SETOPTIONS.s
new file mode 100644
index 00000000..4da8ff83
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_SETOPTIONS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_SETOPTIONS 0x4200 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SETREGS.s b/libc/sysv/consts/PTRACE_SETREGS.s
new file mode 100644
index 00000000..534d65bd
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_SETREGS.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_SETREGS 13 -1 34 34 -1
diff --git a/libc/sysv/consts/PTRACE_SETREGSET.s b/libc/sysv/consts/PTRACE_SETREGSET.s
index ee13c650..5a3d4a95 100644
--- a/libc/sysv/consts/PTRACE_SETREGSET.s
+++ b/libc/sysv/consts/PTRACE_SETREGSET.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_SETREGSET 0x4205 0 0 0 0
+.syscon ptrace PTRACE_SETREGSET 0x4205 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SETSIGINFO.s b/libc/sysv/consts/PTRACE_SETSIGINFO.s
new file mode 100644
index 00000000..2127309e
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_SETSIGINFO.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_SETSIGINFO 0x4203 -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SETSIGMASK.s b/libc/sysv/consts/PTRACE_SETSIGMASK.s
index f9e4cb9b..dda80a92 100644
--- a/libc/sysv/consts/PTRACE_SETSIGMASK.s
+++ b/libc/sysv/consts/PTRACE_SETSIGMASK.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_SETSIGMASK 0x420b 0 0 0 0
+.syscon ptrace PTRACE_SETSIGMASK 0x420b -1 -1 -1 -1
diff --git a/libc/sysv/consts/PTRACE_SINGLESTEP.s b/libc/sysv/consts/PTRACE_SINGLESTEP.s
new file mode 100644
index 00000000..d2071d28
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_SINGLESTEP.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_SINGLESTEP 9 9 9 32 -1
diff --git a/libc/sysv/consts/PTRACE_SYSCALL.s b/libc/sysv/consts/PTRACE_SYSCALL.s
index 731496b5..27d9c84e 100644
--- a/libc/sysv/consts/PTRACE_SYSCALL.s
+++ b/libc/sysv/consts/PTRACE_SYSCALL.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon ptrace PTRACE_SYSCALL 0 0 6 0 0
+.syscon ptrace PTRACE_SYSCALL 24 -1 22 -1 -1
diff --git a/libc/sysv/consts/PTRACE_TRACEME.s b/libc/sysv/consts/PTRACE_TRACEME.s
new file mode 100644
index 00000000..ec496725
--- /dev/null
+++ b/libc/sysv/consts/PTRACE_TRACEME.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon ptrace PTRACE_TRACEME 0 0 0 0 -1
diff --git a/libc/sysv/consts/PT_GETEVENTMSG.s b/libc/sysv/consts/PT_GETEVENTMSG.s
deleted file mode 100644
index 09e5afd4..00000000
--- a/libc/sysv/consts/PT_GETEVENTMSG.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_GETEVENTMSG 0x4201 0 0 0 0
diff --git a/libc/sysv/consts/PT_GETFPXREGS.s b/libc/sysv/consts/PT_GETFPXREGS.s
deleted file mode 100644
index c9be44e9..00000000
--- a/libc/sysv/consts/PT_GETFPXREGS.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_GETFPXREGS 18 0 0 0 0
diff --git a/libc/sysv/consts/PT_GETREGS.s b/libc/sysv/consts/PT_GETREGS.s
deleted file mode 100644
index f1631c5a..00000000
--- a/libc/sysv/consts/PT_GETREGS.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_GETREGS 12 0 33 33 0
diff --git a/libc/sysv/consts/PT_GETSIGINFO.s b/libc/sysv/consts/PT_GETSIGINFO.s
deleted file mode 100644
index 0e35a3f4..00000000
--- a/libc/sysv/consts/PT_GETSIGINFO.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_GETSIGINFO 0x4202 0 0 0 0
diff --git a/libc/sysv/consts/PT_KILL.s b/libc/sysv/consts/PT_KILL.s
deleted file mode 100644
index 05a0754c..00000000
--- a/libc/sysv/consts/PT_KILL.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_KILL 8 8 8 8 0
diff --git a/libc/sysv/consts/PT_READ_D.s b/libc/sysv/consts/PT_READ_D.s
deleted file mode 100644
index 721bbbb5..00000000
--- a/libc/sysv/consts/PT_READ_D.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_READ_D 2 2 2 2 0
diff --git a/libc/sysv/consts/PT_READ_I.s b/libc/sysv/consts/PT_READ_I.s
deleted file mode 100644
index df66fb49..00000000
--- a/libc/sysv/consts/PT_READ_I.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_READ_I 1 1 1 1 0
diff --git a/libc/sysv/consts/PT_READ_U.s b/libc/sysv/consts/PT_READ_U.s
deleted file mode 100644
index 095b0f52..00000000
--- a/libc/sysv/consts/PT_READ_U.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_READ_U 3 3 0 0 0
diff --git a/libc/sysv/consts/PT_SETFPREGS.s b/libc/sysv/consts/PT_SETFPREGS.s
deleted file mode 100644
index 0df23c2e..00000000
--- a/libc/sysv/consts/PT_SETFPREGS.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_SETFPREGS 15 0 36 36 0
diff --git a/libc/sysv/consts/PT_SETFPXREGS.s b/libc/sysv/consts/PT_SETFPXREGS.s
deleted file mode 100644
index 8f4963b2..00000000
--- a/libc/sysv/consts/PT_SETFPXREGS.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_SETFPXREGS 19 0 0 0 0
diff --git a/libc/sysv/consts/PT_SETOPTIONS.s b/libc/sysv/consts/PT_SETOPTIONS.s
deleted file mode 100644
index d5ffd24f..00000000
--- a/libc/sysv/consts/PT_SETOPTIONS.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_SETOPTIONS 0x4200 0 0 0 0
diff --git a/libc/sysv/consts/PT_SETREGS.s b/libc/sysv/consts/PT_SETREGS.s
deleted file mode 100644
index 9496a820..00000000
--- a/libc/sysv/consts/PT_SETREGS.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_SETREGS 13 0 34 34 0
diff --git a/libc/sysv/consts/PT_SETSIGINFO.s b/libc/sysv/consts/PT_SETSIGINFO.s
deleted file mode 100644
index 55918484..00000000
--- a/libc/sysv/consts/PT_SETSIGINFO.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_SETSIGINFO 0x4203 0 0 0 0
diff --git a/libc/sysv/consts/PT_STEP.s b/libc/sysv/consts/PT_STEP.s
deleted file mode 100644
index 0f514018..00000000
--- a/libc/sysv/consts/PT_STEP.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_STEP 9 9 9 0x20 0
diff --git a/libc/sysv/consts/PT_SYSCALL.s b/libc/sysv/consts/PT_SYSCALL.s
deleted file mode 100644
index 5ad7ca0f..00000000
--- a/libc/sysv/consts/PT_SYSCALL.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_SYSCALL 24 0 22 0 0
diff --git a/libc/sysv/consts/PT_TRACE_ME.s b/libc/sysv/consts/PT_TRACE_ME.s
deleted file mode 100644
index 7ca997c2..00000000
--- a/libc/sysv/consts/PT_TRACE_ME.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_TRACE_ME 0 0 0 0 0
diff --git a/libc/sysv/consts/PT_WRITE_D.s b/libc/sysv/consts/PT_WRITE_D.s
deleted file mode 100644
index a6a0ffdc..00000000
--- a/libc/sysv/consts/PT_WRITE_D.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_WRITE_D 5 5 5 5 0
diff --git a/libc/sysv/consts/PT_WRITE_I.s b/libc/sysv/consts/PT_WRITE_I.s
deleted file mode 100644
index ff1f1b7b..00000000
--- a/libc/sysv/consts/PT_WRITE_I.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_WRITE_I 4 4 4 4 0
diff --git a/libc/sysv/consts/PT_WRITE_U.s b/libc/sysv/consts/PT_WRITE_U.s
deleted file mode 100644
index 366253cf..00000000
--- a/libc/sysv/consts/PT_WRITE_U.s
+++ /dev/null
@@ -1,2 +0,0 @@
-.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_WRITE_U 6 6 0 0 0
diff --git a/libc/sysv/consts/__NR___mac_syscall.s b/libc/sysv/consts/__NR___mac_syscall.s
new file mode 100644
index 00000000..a05a468b
--- /dev/null
+++ b/libc/sysv/consts/__NR___mac_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR___mac_syscall -1 0x200017d -1 -1 -1
diff --git a/libc/sysv/consts/__NR___sysctl.s b/libc/sysv/consts/__NR___sysctl.s
new file mode 100644
index 00000000..a0af422b
--- /dev/null
+++ b/libc/sysv/consts/__NR___sysctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR___sysctl -1 -1 0x00ca -1 -1
diff --git a/libc/sysv/consts/__NR__sysctl.s b/libc/sysv/consts/__NR__sysctl.s
new file mode 100644
index 00000000..630bbc27
--- /dev/null
+++ b/libc/sysv/consts/__NR__sysctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR__sysctl 0x009c -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR__umtx_op.s b/libc/sysv/consts/__NR__umtx_op.s
new file mode 100644
index 00000000..3cf8f402
--- /dev/null
+++ b/libc/sysv/consts/__NR__umtx_op.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR__umtx_op -1 -1 0x01c6 -1 -1
diff --git a/libc/sysv/consts/__NR_abort2.s b/libc/sysv/consts/__NR_abort2.s
new file mode 100644
index 00000000..598d0a34
--- /dev/null
+++ b/libc/sysv/consts/__NR_abort2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_abort2 -1 -1 0x01cf -1 -1
diff --git a/libc/sysv/consts/__NR_abort_with_payload.s b/libc/sysv/consts/__NR_abort_with_payload.s
new file mode 100644
index 00000000..9b135428
--- /dev/null
+++ b/libc/sysv/consts/__NR_abort_with_payload.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_abort_with_payload -1 0x2000209 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_accept.s b/libc/sysv/consts/__NR_accept.s
new file mode 100644
index 00000000..7573349b
--- /dev/null
+++ b/libc/sysv/consts/__NR_accept.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_accept 0x002b 0x200001e 0x0063 0x001e -1
diff --git a/libc/sysv/consts/__NR_accept4.s b/libc/sysv/consts/__NR_accept4.s
new file mode 100644
index 00000000..95b3eeba
--- /dev/null
+++ b/libc/sysv/consts/__NR_accept4.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_accept4 0x0120 -1 0x021d 0x005d -1
diff --git a/libc/sysv/consts/__NR_accept_nocancel.s b/libc/sysv/consts/__NR_accept_nocancel.s
new file mode 100644
index 00000000..1f113c0e
--- /dev/null
+++ b/libc/sysv/consts/__NR_accept_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_accept_nocancel -1 0x2000194 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_access_extended.s b/libc/sysv/consts/__NR_access_extended.s
new file mode 100644
index 00000000..73e58dd0
--- /dev/null
+++ b/libc/sysv/consts/__NR_access_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_access_extended -1 0x200011c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_acct.s b/libc/sysv/consts/__NR_acct.s
new file mode 100644
index 00000000..9c529a8b
--- /dev/null
+++ b/libc/sysv/consts/__NR_acct.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acct 0x00a3 0x2000033 0x0033 0x0033 -1
diff --git a/libc/sysv/consts/__NR_acl_aclcheck_fd.s b/libc/sysv/consts/__NR_acl_aclcheck_fd.s
new file mode 100644
index 00000000..6ac35b8f
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_aclcheck_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_aclcheck_fd -1 -1 0x0162 -1 -1
diff --git a/libc/sysv/consts/__NR_acl_aclcheck_file.s b/libc/sysv/consts/__NR_acl_aclcheck_file.s
new file mode 100644
index 00000000..a823bca0
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_aclcheck_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_aclcheck_file -1 -1 0x0161 -1 -1
diff --git a/libc/sysv/consts/__NR_acl_aclcheck_link.s b/libc/sysv/consts/__NR_acl_aclcheck_link.s
new file mode 100644
index 00000000..ae5efba5
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_aclcheck_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_aclcheck_link -1 -1 0x01ac -1 -1
diff --git a/libc/sysv/consts/__NR_acl_delete_fd.s b/libc/sysv/consts/__NR_acl_delete_fd.s
new file mode 100644
index 00000000..b95bc6b2
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_delete_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_delete_fd -1 -1 0x0160 -1 -1
diff --git a/libc/sysv/consts/__NR_acl_delete_file.s b/libc/sysv/consts/__NR_acl_delete_file.s
new file mode 100644
index 00000000..f1ab266d
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_delete_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_delete_file -1 -1 0x015f -1 -1
diff --git a/libc/sysv/consts/__NR_acl_delete_link.s b/libc/sysv/consts/__NR_acl_delete_link.s
new file mode 100644
index 00000000..0684879d
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_delete_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_delete_link -1 -1 0x01ab -1 -1
diff --git a/libc/sysv/consts/__NR_acl_get_fd.s b/libc/sysv/consts/__NR_acl_get_fd.s
new file mode 100644
index 00000000..8b675540
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_get_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_get_fd -1 -1 0x015d -1 -1
diff --git a/libc/sysv/consts/__NR_acl_get_file.s b/libc/sysv/consts/__NR_acl_get_file.s
new file mode 100644
index 00000000..1c62edf4
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_get_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_get_file -1 -1 0x015b -1 -1
diff --git a/libc/sysv/consts/__NR_acl_get_link.s b/libc/sysv/consts/__NR_acl_get_link.s
new file mode 100644
index 00000000..51d59cf4
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_get_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_get_link -1 -1 0x01a9 -1 -1
diff --git a/libc/sysv/consts/__NR_acl_set_fd.s b/libc/sysv/consts/__NR_acl_set_fd.s
new file mode 100644
index 00000000..84fad44d
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_set_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_set_fd -1 -1 0x015e -1 -1
diff --git a/libc/sysv/consts/__NR_acl_set_file.s b/libc/sysv/consts/__NR_acl_set_file.s
new file mode 100644
index 00000000..96641b5b
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_set_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_set_file -1 -1 0x015c -1 -1
diff --git a/libc/sysv/consts/__NR_acl_set_link.s b/libc/sysv/consts/__NR_acl_set_link.s
new file mode 100644
index 00000000..48ca9418
--- /dev/null
+++ b/libc/sysv/consts/__NR_acl_set_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_acl_set_link -1 -1 0x01aa -1 -1
diff --git a/libc/sysv/consts/__NR_add_key.s b/libc/sysv/consts/__NR_add_key.s
new file mode 100644
index 00000000..d70897b5
--- /dev/null
+++ b/libc/sysv/consts/__NR_add_key.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_add_key 0x00f8 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_adjfreq.s b/libc/sysv/consts/__NR_adjfreq.s
new file mode 100644
index 00000000..64ef9726
--- /dev/null
+++ b/libc/sysv/consts/__NR_adjfreq.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_adjfreq -1 -1 -1 0x0131 -1
diff --git a/libc/sysv/consts/__NR_adjtime.s b/libc/sysv/consts/__NR_adjtime.s
new file mode 100644
index 00000000..b142f7b8
--- /dev/null
+++ b/libc/sysv/consts/__NR_adjtime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_adjtime -1 0x200008c 0x008c 0x008c -1
diff --git a/libc/sysv/consts/__NR_adjtimex.s b/libc/sysv/consts/__NR_adjtimex.s
new file mode 100644
index 00000000..eed4c233
--- /dev/null
+++ b/libc/sysv/consts/__NR_adjtimex.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_adjtimex 0x009f -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_afs3_syscall.s b/libc/sysv/consts/__NR_afs3_syscall.s
new file mode 100644
index 00000000..e5ffd379
--- /dev/null
+++ b/libc/sysv/consts/__NR_afs3_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_afs3_syscall -1 -1 0x0179 -1 -1
diff --git a/libc/sysv/consts/__NR_aio_cancel.s b/libc/sysv/consts/__NR_aio_cancel.s
new file mode 100644
index 00000000..b57fa495
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_cancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_cancel -1 0x200013c 0x013c -1 -1
diff --git a/libc/sysv/consts/__NR_aio_error.s b/libc/sysv/consts/__NR_aio_error.s
new file mode 100644
index 00000000..51ea831d
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_error.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_error -1 0x200013d 0x013d -1 -1
diff --git a/libc/sysv/consts/__NR_aio_fsync.s b/libc/sysv/consts/__NR_aio_fsync.s
new file mode 100644
index 00000000..576d4116
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_fsync.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_fsync -1 0x2000139 0x01d1 -1 -1
diff --git a/libc/sysv/consts/__NR_aio_mlock.s b/libc/sysv/consts/__NR_aio_mlock.s
new file mode 100644
index 00000000..679c30c5
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_mlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_mlock -1 -1 0x021f -1 -1
diff --git a/libc/sysv/consts/__NR_aio_read.s b/libc/sysv/consts/__NR_aio_read.s
new file mode 100644
index 00000000..80c44cfb
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_read.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_read -1 0x200013e 0x013e -1 -1
diff --git a/libc/sysv/consts/__NR_aio_return.s b/libc/sysv/consts/__NR_aio_return.s
new file mode 100644
index 00000000..ac809d11
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_return.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_return -1 0x200013a 0x013a -1 -1
diff --git a/libc/sysv/consts/__NR_aio_suspend.s b/libc/sysv/consts/__NR_aio_suspend.s
new file mode 100644
index 00000000..128b68a7
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_suspend.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_suspend -1 0x200013b 0x013b -1 -1
diff --git a/libc/sysv/consts/__NR_aio_suspend_nocancel.s b/libc/sysv/consts/__NR_aio_suspend_nocancel.s
new file mode 100644
index 00000000..838bb6df
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_suspend_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_suspend_nocancel -1 0x20001a5 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_aio_waitcomplete.s b/libc/sysv/consts/__NR_aio_waitcomplete.s
new file mode 100644
index 00000000..01d34645
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_waitcomplete.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_waitcomplete -1 -1 0x0167 -1 -1
diff --git a/libc/sysv/consts/__NR_aio_write.s b/libc/sysv/consts/__NR_aio_write.s
new file mode 100644
index 00000000..9cf8ad49
--- /dev/null
+++ b/libc/sysv/consts/__NR_aio_write.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_aio_write -1 0x200013f 0x013f -1 -1
diff --git a/libc/sysv/consts/__NR_alarm.s b/libc/sysv/consts/__NR_alarm.s
new file mode 100644
index 00000000..bf4bd8a9
--- /dev/null
+++ b/libc/sysv/consts/__NR_alarm.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_alarm 0x0025 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_arch_prctl.s b/libc/sysv/consts/__NR_arch_prctl.s
index edaf6663..e6ad75e8 100644
--- a/libc/sysv/consts/__NR_arch_prctl.s
+++ b/libc/sysv/consts/__NR_arch_prctl.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_arch_prctl 0x009e 0x000ffff 0x00a5 0x00a5 -1
+.syscon nr __NR_arch_prctl 0x009e -1 0x00a5 0x00a5 -1
diff --git a/libc/sysv/consts/__NR_audit.s b/libc/sysv/consts/__NR_audit.s
new file mode 100644
index 00000000..34a5987a
--- /dev/null
+++ b/libc/sysv/consts/__NR_audit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_audit -1 0x200015e 0x01bd -1 -1
diff --git a/libc/sysv/consts/__NR_audit_session_join.s b/libc/sysv/consts/__NR_audit_session_join.s
new file mode 100644
index 00000000..b7bd8069
--- /dev/null
+++ b/libc/sysv/consts/__NR_audit_session_join.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_audit_session_join -1 0x20001ad -1 -1 -1
diff --git a/libc/sysv/consts/__NR_audit_session_port.s b/libc/sysv/consts/__NR_audit_session_port.s
new file mode 100644
index 00000000..fafd5fd5
--- /dev/null
+++ b/libc/sysv/consts/__NR_audit_session_port.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_audit_session_port -1 0x20001b0 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_audit_session_self.s b/libc/sysv/consts/__NR_audit_session_self.s
new file mode 100644
index 00000000..e737d45c
--- /dev/null
+++ b/libc/sysv/consts/__NR_audit_session_self.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_audit_session_self -1 0x20001ac -1 -1 -1
diff --git a/libc/sysv/consts/__NR_auditctl.s b/libc/sysv/consts/__NR_auditctl.s
new file mode 100644
index 00000000..5f80abe1
--- /dev/null
+++ b/libc/sysv/consts/__NR_auditctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_auditctl -1 0x2000167 0x01c5 -1 -1
diff --git a/libc/sysv/consts/__NR_auditon.s b/libc/sysv/consts/__NR_auditon.s
new file mode 100644
index 00000000..db581ac9
--- /dev/null
+++ b/libc/sysv/consts/__NR_auditon.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_auditon -1 0x200015f 0x01be -1 -1
diff --git a/libc/sysv/consts/__NR_bind.s b/libc/sysv/consts/__NR_bind.s
new file mode 100644
index 00000000..d2f69b07
--- /dev/null
+++ b/libc/sysv/consts/__NR_bind.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_bind 0x0031 0x2000068 0x0068 0x0068 -1
diff --git a/libc/sysv/consts/__NR_bindat.s b/libc/sysv/consts/__NR_bindat.s
new file mode 100644
index 00000000..fabb6cd8
--- /dev/null
+++ b/libc/sysv/consts/__NR_bindat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_bindat -1 -1 0x021a -1 -1
diff --git a/libc/sysv/consts/PT_DETACH.s b/libc/sysv/consts/__NR_bpf.s
similarity index 50%
rename from libc/sysv/consts/PT_DETACH.s
rename to libc/sysv/consts/__NR_bpf.s
index eb53d167..8e261a0d 100644
--- a/libc/sysv/consts/PT_DETACH.s
+++ b/libc/sysv/consts/__NR_bpf.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_DETACH 17 11 11 10 0
+.syscon nr __NR_bpf 0x0141 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_break.s b/libc/sysv/consts/__NR_break.s
new file mode 100644
index 00000000..8ade349f
--- /dev/null
+++ b/libc/sysv/consts/__NR_break.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_break -1 -1 0x0011 -1 -1
diff --git a/libc/sysv/consts/__NR_bsdthread_create.s b/libc/sysv/consts/__NR_bsdthread_create.s
new file mode 100644
index 00000000..b0170bc9
--- /dev/null
+++ b/libc/sysv/consts/__NR_bsdthread_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_bsdthread_create -1 0x2000168 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_bsdthread_ctl.s b/libc/sysv/consts/__NR_bsdthread_ctl.s
new file mode 100644
index 00000000..4ffb6cd5
--- /dev/null
+++ b/libc/sysv/consts/__NR_bsdthread_ctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_bsdthread_ctl -1 0x20001de -1 -1 -1
diff --git a/libc/sysv/consts/__NR_bsdthread_register.s b/libc/sysv/consts/__NR_bsdthread_register.s
new file mode 100644
index 00000000..56aa9bd7
--- /dev/null
+++ b/libc/sysv/consts/__NR_bsdthread_register.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_bsdthread_register -1 0x200016e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_bsdthread_terminate.s b/libc/sysv/consts/__NR_bsdthread_terminate.s
new file mode 100644
index 00000000..cce30788
--- /dev/null
+++ b/libc/sysv/consts/__NR_bsdthread_terminate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_bsdthread_terminate -1 0x2000169 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_enter.s b/libc/sysv/consts/__NR_cap_enter.s
new file mode 100644
index 00000000..b4b9b9f8
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_enter.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_enter -1 -1 0x0204 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_fcntls_get.s b/libc/sysv/consts/__NR_cap_fcntls_get.s
new file mode 100644
index 00000000..618ef5c1
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_fcntls_get.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_fcntls_get -1 -1 0x0219 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_fcntls_limit.s b/libc/sysv/consts/__NR_cap_fcntls_limit.s
new file mode 100644
index 00000000..221391c4
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_fcntls_limit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_fcntls_limit -1 -1 0x0218 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_getmode.s b/libc/sysv/consts/__NR_cap_getmode.s
new file mode 100644
index 00000000..dcf90ec9
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_getmode.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_getmode -1 -1 0x0205 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_ioctls_get.s b/libc/sysv/consts/__NR_cap_ioctls_get.s
new file mode 100644
index 00000000..b5459f9d
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_ioctls_get.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_ioctls_get -1 -1 0x0217 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_ioctls_limit.s b/libc/sysv/consts/__NR_cap_ioctls_limit.s
new file mode 100644
index 00000000..264f5a6e
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_ioctls_limit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_ioctls_limit -1 -1 0x0216 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_rights_get.s b/libc/sysv/consts/__NR_cap_rights_get.s
new file mode 100644
index 00000000..a0008825
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_rights_get.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_rights_get -1 -1 0x0203 -1 -1
diff --git a/libc/sysv/consts/__NR_cap_rights_limit.s b/libc/sysv/consts/__NR_cap_rights_limit.s
new file mode 100644
index 00000000..372bb041
--- /dev/null
+++ b/libc/sysv/consts/__NR_cap_rights_limit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cap_rights_limit -1 -1 0x0215 -1 -1
diff --git a/libc/sysv/consts/__NR_capget.s b/libc/sysv/consts/__NR_capget.s
new file mode 100644
index 00000000..5e17889a
--- /dev/null
+++ b/libc/sysv/consts/__NR_capget.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_capget 0x007d -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_capset.s b/libc/sysv/consts/__NR_capset.s
new file mode 100644
index 00000000..b9253199
--- /dev/null
+++ b/libc/sysv/consts/__NR_capset.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_capset 0x007e -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_change_fdguard_np.s b/libc/sysv/consts/__NR_change_fdguard_np.s
new file mode 100644
index 00000000..27d867be
--- /dev/null
+++ b/libc/sysv/consts/__NR_change_fdguard_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_change_fdguard_np -1 0x20001bc -1 -1 -1
diff --git a/libc/sysv/consts/__NR_chdir.s b/libc/sysv/consts/__NR_chdir.s
new file mode 100644
index 00000000..3664cb2c
--- /dev/null
+++ b/libc/sysv/consts/__NR_chdir.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chdir 0x0050 0x200000c 0x000c 0x000c -1
diff --git a/libc/sysv/consts/__NR_chflags.s b/libc/sysv/consts/__NR_chflags.s
new file mode 100644
index 00000000..214bb330
--- /dev/null
+++ b/libc/sysv/consts/__NR_chflags.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chflags -1 0x2000022 0x0022 0x0022 -1
diff --git a/libc/sysv/consts/__NR_chflagsat.s b/libc/sysv/consts/__NR_chflagsat.s
new file mode 100644
index 00000000..647ace9f
--- /dev/null
+++ b/libc/sysv/consts/__NR_chflagsat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chflagsat -1 -1 0x021c 0x006b -1
diff --git a/libc/sysv/consts/__NR_chmod.s b/libc/sysv/consts/__NR_chmod.s
new file mode 100644
index 00000000..4033d048
--- /dev/null
+++ b/libc/sysv/consts/__NR_chmod.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chmod 0x005a 0x200000f 0x000f 0x000f -1
diff --git a/libc/sysv/consts/__NR_chmod_extended.s b/libc/sysv/consts/__NR_chmod_extended.s
new file mode 100644
index 00000000..340d899a
--- /dev/null
+++ b/libc/sysv/consts/__NR_chmod_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chmod_extended -1 0x200011a -1 -1 -1
diff --git a/libc/sysv/consts/__NR_chown.s b/libc/sysv/consts/__NR_chown.s
new file mode 100644
index 00000000..8d308811
--- /dev/null
+++ b/libc/sysv/consts/__NR_chown.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chown 0x005c 0x2000010 0x0010 0x0010 -1
diff --git a/libc/sysv/consts/__NR_chroot.s b/libc/sysv/consts/__NR_chroot.s
new file mode 100644
index 00000000..de716208
--- /dev/null
+++ b/libc/sysv/consts/__NR_chroot.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_chroot 0x00a1 0x200003d 0x003d 0x003d -1
diff --git a/libc/sysv/consts/__NR_clock_adjtime.s b/libc/sysv/consts/__NR_clock_adjtime.s
new file mode 100644
index 00000000..e2c8ed27
--- /dev/null
+++ b/libc/sysv/consts/__NR_clock_adjtime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clock_adjtime 0x0131 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_clock_getcpuclockid2.s b/libc/sysv/consts/__NR_clock_getcpuclockid2.s
new file mode 100644
index 00000000..0f24ac79
--- /dev/null
+++ b/libc/sysv/consts/__NR_clock_getcpuclockid2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clock_getcpuclockid2 -1 -1 0x00f7 -1 -1
diff --git a/libc/sysv/consts/__NR_clock_getres.s b/libc/sysv/consts/__NR_clock_getres.s
new file mode 100644
index 00000000..36e48043
--- /dev/null
+++ b/libc/sysv/consts/__NR_clock_getres.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clock_getres 0x00e5 -1 0x00ea 0x0059 -1
diff --git a/libc/sysv/consts/__NR_clock_gettime.s b/libc/sysv/consts/__NR_clock_gettime.s
index d03f8976..f80f8144 100644
--- a/libc/sysv/consts/__NR_clock_gettime.s
+++ b/libc/sysv/consts/__NR_clock_gettime.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_clock_gettime 0x00e4 0x000ffff 0x00e8 0x0057 -1
+.syscon nr __NR_clock_gettime 0x00e4 -1 0x00e8 0x0057 -1
diff --git a/libc/sysv/consts/__NR_clock_nanosleep.s b/libc/sysv/consts/__NR_clock_nanosleep.s
new file mode 100644
index 00000000..31b0d35d
--- /dev/null
+++ b/libc/sysv/consts/__NR_clock_nanosleep.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clock_nanosleep 0x00e6 -1 0x00f4 -1 -1
diff --git a/libc/sysv/consts/__NR_clock_settime.s b/libc/sysv/consts/__NR_clock_settime.s
new file mode 100644
index 00000000..058afa84
--- /dev/null
+++ b/libc/sysv/consts/__NR_clock_settime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clock_settime 0x00e3 -1 0x00e9 0x0058 -1
diff --git a/libc/sysv/consts/__NR_clone.s b/libc/sysv/consts/__NR_clone.s
new file mode 100644
index 00000000..f2e42b14
--- /dev/null
+++ b/libc/sysv/consts/__NR_clone.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clone 0x0038 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_clonefileat.s b/libc/sysv/consts/__NR_clonefileat.s
new file mode 100644
index 00000000..d42f4f7b
--- /dev/null
+++ b/libc/sysv/consts/__NR_clonefileat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_clonefileat -1 0x20001ce -1 -1 -1
diff --git a/libc/sysv/consts/__NR_close_nocancel.s b/libc/sysv/consts/__NR_close_nocancel.s
new file mode 100644
index 00000000..315dfd1e
--- /dev/null
+++ b/libc/sysv/consts/__NR_close_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_close_nocancel -1 0x200018f -1 -1 -1
diff --git a/libc/sysv/consts/__NR_closefrom.s b/libc/sysv/consts/__NR_closefrom.s
new file mode 100644
index 00000000..9d93b873
--- /dev/null
+++ b/libc/sysv/consts/__NR_closefrom.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_closefrom -1 -1 0x01fd 0x011f -1
diff --git a/libc/sysv/consts/__NR_coalition.s b/libc/sysv/consts/__NR_coalition.s
new file mode 100644
index 00000000..982b2b84
--- /dev/null
+++ b/libc/sysv/consts/__NR_coalition.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_coalition -1 0x20001ca -1 -1 -1
diff --git a/libc/sysv/consts/__NR_coalition_info.s b/libc/sysv/consts/__NR_coalition_info.s
new file mode 100644
index 00000000..81a7d67f
--- /dev/null
+++ b/libc/sysv/consts/__NR_coalition_info.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_coalition_info -1 0x20001cb -1 -1 -1
diff --git a/libc/sysv/consts/__NR_connect.s b/libc/sysv/consts/__NR_connect.s
new file mode 100644
index 00000000..9091f5d4
--- /dev/null
+++ b/libc/sysv/consts/__NR_connect.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_connect 0x002a 0x2000062 0x0062 0x0062 -1
diff --git a/libc/sysv/consts/__NR_connect_nocancel.s b/libc/sysv/consts/__NR_connect_nocancel.s
new file mode 100644
index 00000000..92b17a71
--- /dev/null
+++ b/libc/sysv/consts/__NR_connect_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_connect_nocancel -1 0x2000199 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_connectat.s b/libc/sysv/consts/__NR_connectat.s
new file mode 100644
index 00000000..a12b5992
--- /dev/null
+++ b/libc/sysv/consts/__NR_connectat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_connectat -1 -1 0x021b -1 -1
diff --git a/libc/sysv/consts/__NR_connectx.s b/libc/sysv/consts/__NR_connectx.s
new file mode 100644
index 00000000..f982e29b
--- /dev/null
+++ b/libc/sysv/consts/__NR_connectx.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_connectx -1 0x20001bf -1 -1 -1
diff --git a/libc/sysv/consts/__NR_copy_file_range.s b/libc/sysv/consts/__NR_copy_file_range.s
new file mode 100644
index 00000000..49d796d0
--- /dev/null
+++ b/libc/sysv/consts/__NR_copy_file_range.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_copy_file_range 0x0146 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_copyfile.s b/libc/sysv/consts/__NR_copyfile.s
new file mode 100644
index 00000000..a336fe6c
--- /dev/null
+++ b/libc/sysv/consts/__NR_copyfile.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_copyfile -1 0x20000e3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset.s b/libc/sysv/consts/__NR_cpuset.s
new file mode 100644
index 00000000..fd26f329
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset -1 -1 0x01e4 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset_getaffinity.s b/libc/sysv/consts/__NR_cpuset_getaffinity.s
new file mode 100644
index 00000000..148a0ac2
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset_getaffinity.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset_getaffinity -1 -1 0x01e7 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset_getdomain.s b/libc/sysv/consts/__NR_cpuset_getdomain.s
new file mode 100644
index 00000000..fe151737
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset_getdomain.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset_getdomain -1 -1 0x0231 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset_getid.s b/libc/sysv/consts/__NR_cpuset_getid.s
new file mode 100644
index 00000000..3d87d500
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset_getid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset_getid -1 -1 0x01e6 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset_setaffinity.s b/libc/sysv/consts/__NR_cpuset_setaffinity.s
new file mode 100644
index 00000000..955cc76b
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset_setaffinity.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset_setaffinity -1 -1 0x01e8 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset_setdomain.s b/libc/sysv/consts/__NR_cpuset_setdomain.s
new file mode 100644
index 00000000..27669c60
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset_setdomain.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset_setdomain -1 -1 0x0232 -1 -1
diff --git a/libc/sysv/consts/__NR_cpuset_setid.s b/libc/sysv/consts/__NR_cpuset_setid.s
new file mode 100644
index 00000000..0a63efc6
--- /dev/null
+++ b/libc/sysv/consts/__NR_cpuset_setid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_cpuset_setid -1 -1 0x01e5 -1 -1
diff --git a/libc/sysv/consts/__NR_creat.s b/libc/sysv/consts/__NR_creat.s
new file mode 100644
index 00000000..a7838fc0
--- /dev/null
+++ b/libc/sysv/consts/__NR_creat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_creat 0x0055 -1 0x0008 -1 -1
diff --git a/libc/sysv/consts/__NR_csops.s b/libc/sysv/consts/__NR_csops.s
new file mode 100644
index 00000000..b2e9c12b
--- /dev/null
+++ b/libc/sysv/consts/__NR_csops.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_csops -1 0x20000a9 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_csops_audittoken.s b/libc/sysv/consts/__NR_csops_audittoken.s
new file mode 100644
index 00000000..b1a27dbf
--- /dev/null
+++ b/libc/sysv/consts/__NR_csops_audittoken.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_csops_audittoken -1 0x20000aa -1 -1 -1
diff --git a/libc/sysv/consts/__NR_csrctl.s b/libc/sysv/consts/__NR_csrctl.s
new file mode 100644
index 00000000..45ce217c
--- /dev/null
+++ b/libc/sysv/consts/__NR_csrctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_csrctl -1 0x20001e3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_delete.s b/libc/sysv/consts/__NR_delete.s
new file mode 100644
index 00000000..b9c9a554
--- /dev/null
+++ b/libc/sysv/consts/__NR_delete.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_delete -1 0x20000e2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_delete_module.s b/libc/sysv/consts/__NR_delete_module.s
new file mode 100644
index 00000000..28b5ad1b
--- /dev/null
+++ b/libc/sysv/consts/__NR_delete_module.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_delete_module 0x00b0 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_disable_threadsignal.s b/libc/sysv/consts/__NR_disable_threadsignal.s
new file mode 100644
index 00000000..805f9e94
--- /dev/null
+++ b/libc/sysv/consts/__NR_disable_threadsignal.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_disable_threadsignal -1 0x200014b -1 -1 -1
diff --git a/libc/sysv/consts/__NR_disconnectx.s b/libc/sysv/consts/__NR_disconnectx.s
new file mode 100644
index 00000000..b94200cf
--- /dev/null
+++ b/libc/sysv/consts/__NR_disconnectx.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_disconnectx -1 0x20001c0 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_dup.s b/libc/sysv/consts/__NR_dup.s
new file mode 100644
index 00000000..e2cd286f
--- /dev/null
+++ b/libc/sysv/consts/__NR_dup.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_dup 0x0020 0x2000029 0x0029 0x0029 -1
diff --git a/libc/sysv/consts/__NR_dup2.s b/libc/sysv/consts/__NR_dup2.s
new file mode 100644
index 00000000..9a440570
--- /dev/null
+++ b/libc/sysv/consts/__NR_dup2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_dup2 0x0021 0x200005a 0x005a 0x005a -1
diff --git a/libc/sysv/consts/__NR_dup3.s b/libc/sysv/consts/__NR_dup3.s
new file mode 100644
index 00000000..d28e5b92
--- /dev/null
+++ b/libc/sysv/consts/__NR_dup3.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_dup3 0x0124 -1 -1 0x0066 -1
diff --git a/libc/sysv/consts/__NR_eaccess.s b/libc/sysv/consts/__NR_eaccess.s
new file mode 100644
index 00000000..f912fa0e
--- /dev/null
+++ b/libc/sysv/consts/__NR_eaccess.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_eaccess -1 -1 0x0178 -1 -1
diff --git a/libc/sysv/consts/__NR_epoll_create.s b/libc/sysv/consts/__NR_epoll_create.s
new file mode 100644
index 00000000..d6ac88e7
--- /dev/null
+++ b/libc/sysv/consts/__NR_epoll_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_epoll_create 0x00d5 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_epoll_create1.s b/libc/sysv/consts/__NR_epoll_create1.s
new file mode 100644
index 00000000..917cc794
--- /dev/null
+++ b/libc/sysv/consts/__NR_epoll_create1.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_epoll_create1 0x0123 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_epoll_ctl.s b/libc/sysv/consts/__NR_epoll_ctl.s
new file mode 100644
index 00000000..3490827c
--- /dev/null
+++ b/libc/sysv/consts/__NR_epoll_ctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_epoll_ctl 0x00e9 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_epoll_pwait.s b/libc/sysv/consts/__NR_epoll_pwait.s
new file mode 100644
index 00000000..090f4d9a
--- /dev/null
+++ b/libc/sysv/consts/__NR_epoll_pwait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_epoll_pwait 0x0119 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_epoll_wait.s b/libc/sysv/consts/__NR_epoll_wait.s
new file mode 100644
index 00000000..da033658
--- /dev/null
+++ b/libc/sysv/consts/__NR_epoll_wait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_epoll_wait 0x00e8 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_eventfd.s b/libc/sysv/consts/__NR_eventfd.s
new file mode 100644
index 00000000..46313ac2
--- /dev/null
+++ b/libc/sysv/consts/__NR_eventfd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_eventfd 0x011c -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_eventfd2.s b/libc/sysv/consts/__NR_eventfd2.s
new file mode 100644
index 00000000..5ab12bb8
--- /dev/null
+++ b/libc/sysv/consts/__NR_eventfd2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_eventfd2 0x0122 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_exchangedata.s b/libc/sysv/consts/__NR_exchangedata.s
new file mode 100644
index 00000000..99491699
--- /dev/null
+++ b/libc/sysv/consts/__NR_exchangedata.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_exchangedata -1 0x20000df -1 -1 -1
diff --git a/libc/sysv/consts/__NR_execve.s b/libc/sysv/consts/__NR_execve.s
new file mode 100644
index 00000000..32121ba3
--- /dev/null
+++ b/libc/sysv/consts/__NR_execve.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_execve 0x003b 0x200003b 0x003b 0x003b -1
diff --git a/libc/sysv/consts/__NR_execveat.s b/libc/sysv/consts/__NR_execveat.s
new file mode 100644
index 00000000..3aa43838
--- /dev/null
+++ b/libc/sysv/consts/__NR_execveat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_execveat 0x0142 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_exit.s b/libc/sysv/consts/__NR_exit.s
index 020dc751..33f6f781 100644
--- a/libc/sysv/consts/__NR_exit.s
+++ b/libc/sysv/consts/__NR_exit.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_exit 0x00e7 0x2000001 0x0001 0x0001 -1
+.syscon nr __NR_exit 0x003c 0x2000001 0x0001 0x0001 -1
diff --git a/libc/sysv/consts/__NR_exit_group.s b/libc/sysv/consts/__NR_exit_group.s
new file mode 100644
index 00000000..020cb358
--- /dev/null
+++ b/libc/sysv/consts/__NR_exit_group.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_exit_group 0x00e7 0x2000001 0x0001 0x0001 -1
diff --git a/libc/sysv/consts/__NR_extattr_delete_fd.s b/libc/sysv/consts/__NR_extattr_delete_fd.s
new file mode 100644
index 00000000..06eb23ed
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_delete_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_delete_fd -1 -1 0x0175 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_delete_file.s b/libc/sysv/consts/__NR_extattr_delete_file.s
new file mode 100644
index 00000000..ba7576fe
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_delete_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_delete_file -1 -1 0x0166 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_delete_link.s b/libc/sysv/consts/__NR_extattr_delete_link.s
new file mode 100644
index 00000000..51feed4c
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_delete_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_delete_link -1 -1 0x019e -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_get_fd.s b/libc/sysv/consts/__NR_extattr_get_fd.s
new file mode 100644
index 00000000..d080ffb5
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_get_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_get_fd -1 -1 0x0174 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_get_file.s b/libc/sysv/consts/__NR_extattr_get_file.s
new file mode 100644
index 00000000..64136633
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_get_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_get_file -1 -1 0x0165 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_get_link.s b/libc/sysv/consts/__NR_extattr_get_link.s
new file mode 100644
index 00000000..5e696988
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_get_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_get_link -1 -1 0x019d -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_list_fd.s b/libc/sysv/consts/__NR_extattr_list_fd.s
new file mode 100644
index 00000000..c4f9fa24
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_list_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_list_fd -1 -1 0x01b5 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_list_file.s b/libc/sysv/consts/__NR_extattr_list_file.s
new file mode 100644
index 00000000..ba7e33d2
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_list_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_list_file -1 -1 0x01b6 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_list_link.s b/libc/sysv/consts/__NR_extattr_list_link.s
new file mode 100644
index 00000000..e3f44acb
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_list_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_list_link -1 -1 0x01b7 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_set_fd.s b/libc/sysv/consts/__NR_extattr_set_fd.s
new file mode 100644
index 00000000..76ff9703
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_set_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_set_fd -1 -1 0x0173 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_set_file.s b/libc/sysv/consts/__NR_extattr_set_file.s
new file mode 100644
index 00000000..857fed36
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_set_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_set_file -1 -1 0x0164 -1 -1
diff --git a/libc/sysv/consts/__NR_extattr_set_link.s b/libc/sysv/consts/__NR_extattr_set_link.s
new file mode 100644
index 00000000..963b8ee5
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattr_set_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattr_set_link -1 -1 0x019c -1 -1
diff --git a/libc/sysv/consts/__NR_extattrctl.s b/libc/sysv/consts/__NR_extattrctl.s
new file mode 100644
index 00000000..e72f0b12
--- /dev/null
+++ b/libc/sysv/consts/__NR_extattrctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_extattrctl -1 -1 0x0163 -1 -1
diff --git a/libc/sysv/consts/__NR_faccessat.s b/libc/sysv/consts/__NR_faccessat.s
new file mode 100644
index 00000000..0723e727
--- /dev/null
+++ b/libc/sysv/consts/__NR_faccessat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_faccessat 0x010d 0x20001d2 0x01e9 0x0139 -1
diff --git a/libc/sysv/consts/__NR_fadvise.s b/libc/sysv/consts/__NR_fadvise.s
index 5ad3384b..647a487a 100644
--- a/libc/sysv/consts/__NR_fadvise.s
+++ b/libc/sysv/consts/__NR_fadvise.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_fadvise 0x00dd 0x000ffff 0x0213 0xffff -1
+.syscon nr __NR_fadvise 0x00dd -1 0x0213 -1 -1
diff --git a/libc/sysv/consts/__NR_fallocate.s b/libc/sysv/consts/__NR_fallocate.s
new file mode 100644
index 00000000..286d7913
--- /dev/null
+++ b/libc/sysv/consts/__NR_fallocate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fallocate 0x011d -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fanotify_init.s b/libc/sysv/consts/__NR_fanotify_init.s
new file mode 100644
index 00000000..1392d03e
--- /dev/null
+++ b/libc/sysv/consts/__NR_fanotify_init.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fanotify_init 0x012c -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fanotify_mark.s b/libc/sysv/consts/__NR_fanotify_mark.s
new file mode 100644
index 00000000..38c44788
--- /dev/null
+++ b/libc/sysv/consts/__NR_fanotify_mark.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fanotify_mark 0x012d -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fchdir.s b/libc/sysv/consts/__NR_fchdir.s
new file mode 100644
index 00000000..2006ba0f
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchdir.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchdir 0x0051 0x200000d 0x000d 0x000d -1
diff --git a/libc/sysv/consts/__NR_fchflags.s b/libc/sysv/consts/__NR_fchflags.s
new file mode 100644
index 00000000..39e2be33
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchflags.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchflags -1 0x2000023 0x0023 0x0023 -1
diff --git a/libc/sysv/consts/__NR_fchmod.s b/libc/sysv/consts/__NR_fchmod.s
new file mode 100644
index 00000000..d59a7780
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchmod.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchmod 0x005b 0x200007c 0x007c 0x007c -1
diff --git a/libc/sysv/consts/__NR_fchmod_extended.s b/libc/sysv/consts/__NR_fchmod_extended.s
new file mode 100644
index 00000000..b05f6cfe
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchmod_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchmod_extended -1 0x200011b -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fchmodat.s b/libc/sysv/consts/__NR_fchmodat.s
new file mode 100644
index 00000000..01fdd258
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchmodat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchmodat 0x010c 0x20001d3 0x01ea 0x013a -1
diff --git a/libc/sysv/consts/__NR_fchown.s b/libc/sysv/consts/__NR_fchown.s
new file mode 100644
index 00000000..c754381e
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchown.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchown 0x005d 0x200007b 0x007b 0x007b -1
diff --git a/libc/sysv/consts/__NR_fchownat.s b/libc/sysv/consts/__NR_fchownat.s
new file mode 100644
index 00000000..83b0aede
--- /dev/null
+++ b/libc/sysv/consts/__NR_fchownat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fchownat 0x0104 0x20001d4 0x01eb 0x013b -1
diff --git a/libc/sysv/consts/__NR_fclonefileat.s b/libc/sysv/consts/__NR_fclonefileat.s
new file mode 100644
index 00000000..e10e10bd
--- /dev/null
+++ b/libc/sysv/consts/__NR_fclonefileat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fclonefileat -1 0x2000205 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fcntl.s b/libc/sysv/consts/__NR_fcntl.s
new file mode 100644
index 00000000..edc49d12
--- /dev/null
+++ b/libc/sysv/consts/__NR_fcntl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fcntl 0x0048 0x200005c 0x005c 0x005c -1
diff --git a/libc/sysv/consts/__NR_fcntl_nocancel.s b/libc/sysv/consts/__NR_fcntl_nocancel.s
new file mode 100644
index 00000000..9125950b
--- /dev/null
+++ b/libc/sysv/consts/__NR_fcntl_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fcntl_nocancel -1 0x2000196 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fdatasync.s b/libc/sysv/consts/__NR_fdatasync.s
new file mode 100644
index 00000000..c2809492
--- /dev/null
+++ b/libc/sysv/consts/__NR_fdatasync.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fdatasync 0x004b 0x20000bb 0x0226 0x005f -1
diff --git a/libc/sysv/consts/__NR_fexecve.s b/libc/sysv/consts/__NR_fexecve.s
new file mode 100644
index 00000000..d47072e1
--- /dev/null
+++ b/libc/sysv/consts/__NR_fexecve.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fexecve -1 -1 0x01ec -1 -1
diff --git a/libc/sysv/consts/__NR_ffclock_getcounter.s b/libc/sysv/consts/__NR_ffclock_getcounter.s
new file mode 100644
index 00000000..17e8117c
--- /dev/null
+++ b/libc/sysv/consts/__NR_ffclock_getcounter.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ffclock_getcounter -1 -1 0x00f1 -1 -1
diff --git a/libc/sysv/consts/__NR_ffclock_getestimate.s b/libc/sysv/consts/__NR_ffclock_getestimate.s
new file mode 100644
index 00000000..ddf85250
--- /dev/null
+++ b/libc/sysv/consts/__NR_ffclock_getestimate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ffclock_getestimate -1 -1 0x00f3 -1 -1
diff --git a/libc/sysv/consts/__NR_ffclock_setestimate.s b/libc/sysv/consts/__NR_ffclock_setestimate.s
new file mode 100644
index 00000000..688abf79
--- /dev/null
+++ b/libc/sysv/consts/__NR_ffclock_setestimate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ffclock_setestimate -1 -1 0x00f2 -1 -1
diff --git a/libc/sysv/consts/__NR_ffsctl.s b/libc/sysv/consts/__NR_ffsctl.s
new file mode 100644
index 00000000..5d1274f9
--- /dev/null
+++ b/libc/sysv/consts/__NR_ffsctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ffsctl -1 0x20000f5 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fgetattrlist.s b/libc/sysv/consts/__NR_fgetattrlist.s
new file mode 100644
index 00000000..d2afcb1a
--- /dev/null
+++ b/libc/sysv/consts/__NR_fgetattrlist.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fgetattrlist -1 0x20000e4 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fgetxattr.s b/libc/sysv/consts/__NR_fgetxattr.s
new file mode 100644
index 00000000..28e389fb
--- /dev/null
+++ b/libc/sysv/consts/__NR_fgetxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fgetxattr 0x00c1 0x20000eb -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fhlink.s b/libc/sysv/consts/__NR_fhlink.s
new file mode 100644
index 00000000..f5d9b751
--- /dev/null
+++ b/libc/sysv/consts/__NR_fhlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fhlink -1 -1 0x0235 -1 -1
diff --git a/libc/sysv/consts/__NR_fhlinkat.s b/libc/sysv/consts/__NR_fhlinkat.s
new file mode 100644
index 00000000..65482dc5
--- /dev/null
+++ b/libc/sysv/consts/__NR_fhlinkat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fhlinkat -1 -1 0x0236 -1 -1
diff --git a/libc/sysv/consts/__NR_fhopen.s b/libc/sysv/consts/__NR_fhopen.s
new file mode 100644
index 00000000..e6680d44
--- /dev/null
+++ b/libc/sysv/consts/__NR_fhopen.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fhopen -1 0x20000f8 0x012a 0x0108 -1
diff --git a/libc/sysv/consts/__NR_fhreadlink.s b/libc/sysv/consts/__NR_fhreadlink.s
new file mode 100644
index 00000000..92290ba9
--- /dev/null
+++ b/libc/sysv/consts/__NR_fhreadlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fhreadlink -1 -1 0x0237 -1 -1
diff --git a/libc/sysv/consts/__NR_fhstat.s b/libc/sysv/consts/__NR_fhstat.s
new file mode 100644
index 00000000..49958006
--- /dev/null
+++ b/libc/sysv/consts/__NR_fhstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fhstat -1 -1 0x0229 0x0126 -1
diff --git a/libc/sysv/consts/__NR_fhstatfs.s b/libc/sysv/consts/__NR_fhstatfs.s
new file mode 100644
index 00000000..8ddd85e7
--- /dev/null
+++ b/libc/sysv/consts/__NR_fhstatfs.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fhstatfs -1 -1 0x022e 0x0041 -1
diff --git a/libc/sysv/consts/__NR_fileport_makefd.s b/libc/sysv/consts/__NR_fileport_makefd.s
new file mode 100644
index 00000000..39d4d26f
--- /dev/null
+++ b/libc/sysv/consts/__NR_fileport_makefd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fileport_makefd -1 0x20001af -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fileport_makeport.s b/libc/sysv/consts/__NR_fileport_makeport.s
new file mode 100644
index 00000000..8a22423d
--- /dev/null
+++ b/libc/sysv/consts/__NR_fileport_makeport.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fileport_makeport -1 0x20001ae -1 -1 -1
diff --git a/libc/sysv/consts/__NR_finit_module.s b/libc/sysv/consts/__NR_finit_module.s
new file mode 100644
index 00000000..fbf35fd9
--- /dev/null
+++ b/libc/sysv/consts/__NR_finit_module.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_finit_module 0x0139 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_flistxattr.s b/libc/sysv/consts/__NR_flistxattr.s
new file mode 100644
index 00000000..594eb34b
--- /dev/null
+++ b/libc/sysv/consts/__NR_flistxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_flistxattr 0x00c4 0x20000f1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_flock.s b/libc/sysv/consts/__NR_flock.s
new file mode 100644
index 00000000..1b7c545a
--- /dev/null
+++ b/libc/sysv/consts/__NR_flock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_flock 0x0049 0x2000083 0x0083 0x0083 -1
diff --git a/libc/sysv/consts/__NR_fmount.s b/libc/sysv/consts/__NR_fmount.s
new file mode 100644
index 00000000..1bec6db6
--- /dev/null
+++ b/libc/sysv/consts/__NR_fmount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fmount -1 0x200020e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fpathconf.s b/libc/sysv/consts/__NR_fpathconf.s
new file mode 100644
index 00000000..f0d2e6bf
--- /dev/null
+++ b/libc/sysv/consts/__NR_fpathconf.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fpathconf -1 0x20000c0 0x00c0 0x00c0 -1
diff --git a/libc/sysv/consts/__NR_fremovexattr.s b/libc/sysv/consts/__NR_fremovexattr.s
new file mode 100644
index 00000000..9d314a6b
--- /dev/null
+++ b/libc/sysv/consts/__NR_fremovexattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fremovexattr 0x00c7 0x20000ef -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fs_snapshot.s b/libc/sysv/consts/__NR_fs_snapshot.s
new file mode 100644
index 00000000..86892f8b
--- /dev/null
+++ b/libc/sysv/consts/__NR_fs_snapshot.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fs_snapshot -1 0x2000206 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fsctl.s b/libc/sysv/consts/__NR_fsctl.s
new file mode 100644
index 00000000..7d4bec46
--- /dev/null
+++ b/libc/sysv/consts/__NR_fsctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fsctl -1 0x20000f2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fsetattrlist.s b/libc/sysv/consts/__NR_fsetattrlist.s
new file mode 100644
index 00000000..c3de4194
--- /dev/null
+++ b/libc/sysv/consts/__NR_fsetattrlist.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fsetattrlist -1 0x20000e5 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fsetxattr.s b/libc/sysv/consts/__NR_fsetxattr.s
new file mode 100644
index 00000000..b664a919
--- /dev/null
+++ b/libc/sysv/consts/__NR_fsetxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fsetxattr 0x00be 0x20000ed -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fstat_extended.s b/libc/sysv/consts/__NR_fstat_extended.s
new file mode 100644
index 00000000..dd337e7a
--- /dev/null
+++ b/libc/sysv/consts/__NR_fstat_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fstat_extended -1 0x2000119 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_fstatat.s b/libc/sysv/consts/__NR_fstatat.s
new file mode 100644
index 00000000..dfe5b76b
--- /dev/null
+++ b/libc/sysv/consts/__NR_fstatat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fstatat 0x0106 0x20001d6 0x0228 0x002a -1
diff --git a/libc/sysv/consts/__NR_fstatfs.s b/libc/sysv/consts/__NR_fstatfs.s
new file mode 100644
index 00000000..d75e8b31
--- /dev/null
+++ b/libc/sysv/consts/__NR_fstatfs.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fstatfs 0x008a 0x200015a 0x022c 0x0040 -1
diff --git a/libc/sysv/consts/__NR_fsync.s b/libc/sysv/consts/__NR_fsync.s
new file mode 100644
index 00000000..84934a41
--- /dev/null
+++ b/libc/sysv/consts/__NR_fsync.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fsync 0x004a 0x200005f 0x005f 0x005f -1
diff --git a/libc/sysv/consts/__NR_fsync_nocancel.s b/libc/sysv/consts/__NR_fsync_nocancel.s
new file mode 100644
index 00000000..0cd1cdff
--- /dev/null
+++ b/libc/sysv/consts/__NR_fsync_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_fsync_nocancel -1 0x2000198 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ftruncate.s b/libc/sysv/consts/__NR_ftruncate.s
new file mode 100644
index 00000000..a88bfd85
--- /dev/null
+++ b/libc/sysv/consts/__NR_ftruncate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ftruncate 0x004d 0x20000c9 0x01e0 0x00c9 -1
diff --git a/libc/sysv/consts/__NR_futex.s b/libc/sysv/consts/__NR_futex.s
new file mode 100644
index 00000000..7d41a0f3
--- /dev/null
+++ b/libc/sysv/consts/__NR_futex.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_futex 0x00ca -1 -1 0x0053 -1
diff --git a/libc/sysv/consts/__NR_futimens.s b/libc/sysv/consts/__NR_futimens.s
new file mode 100644
index 00000000..dd0ea475
--- /dev/null
+++ b/libc/sysv/consts/__NR_futimens.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_futimens -1 -1 0x0222 0x0055 -1
diff --git a/libc/sysv/consts/__NR_futimes.s b/libc/sysv/consts/__NR_futimes.s
new file mode 100644
index 00000000..074d9c95
--- /dev/null
+++ b/libc/sysv/consts/__NR_futimes.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_futimes -1 0x200008b 0x00ce 0x004d -1
diff --git a/libc/sysv/consts/__NR_futimesat.s b/libc/sysv/consts/__NR_futimesat.s
new file mode 100644
index 00000000..f6994384
--- /dev/null
+++ b/libc/sysv/consts/__NR_futimesat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_futimesat 0x0105 -1 0x01ee -1 -1
diff --git a/libc/sysv/consts/__NR_get_mempolicy.s b/libc/sysv/consts/__NR_get_mempolicy.s
new file mode 100644
index 00000000..adc23eaf
--- /dev/null
+++ b/libc/sysv/consts/__NR_get_mempolicy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_get_mempolicy 0x00ef -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_get_robust_list.s b/libc/sysv/consts/__NR_get_robust_list.s
new file mode 100644
index 00000000..20c65477
--- /dev/null
+++ b/libc/sysv/consts/__NR_get_robust_list.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_get_robust_list 0x0112 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_get_tcb.s b/libc/sysv/consts/__NR_get_tcb.s
new file mode 100644
index 00000000..b1ad8161
--- /dev/null
+++ b/libc/sysv/consts/__NR_get_tcb.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_get_tcb -1 -1 -1 0x014a -1
diff --git a/libc/sysv/consts/__NR_getattrlist.s b/libc/sysv/consts/__NR_getattrlist.s
new file mode 100644
index 00000000..8f832ded
--- /dev/null
+++ b/libc/sysv/consts/__NR_getattrlist.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getattrlist -1 0x20000dc -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getattrlistat.s b/libc/sysv/consts/__NR_getattrlistat.s
new file mode 100644
index 00000000..188ce575
--- /dev/null
+++ b/libc/sysv/consts/__NR_getattrlistat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getattrlistat -1 0x20001dc -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getattrlistbulk.s b/libc/sysv/consts/__NR_getattrlistbulk.s
new file mode 100644
index 00000000..b5f23612
--- /dev/null
+++ b/libc/sysv/consts/__NR_getattrlistbulk.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getattrlistbulk -1 0x20001cd -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getaudit.s b/libc/sysv/consts/__NR_getaudit.s
new file mode 100644
index 00000000..97c98a99
--- /dev/null
+++ b/libc/sysv/consts/__NR_getaudit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getaudit -1 -1 0x01c1 -1 -1
diff --git a/libc/sysv/consts/__NR_getaudit_addr.s b/libc/sysv/consts/__NR_getaudit_addr.s
new file mode 100644
index 00000000..7f6b6677
--- /dev/null
+++ b/libc/sysv/consts/__NR_getaudit_addr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getaudit_addr -1 0x2000165 0x01c3 -1 -1
diff --git a/libc/sysv/consts/__NR_getauid.s b/libc/sysv/consts/__NR_getauid.s
new file mode 100644
index 00000000..8cc94e90
--- /dev/null
+++ b/libc/sysv/consts/__NR_getauid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getauid -1 0x2000161 0x01bf -1 -1
diff --git a/libc/sysv/consts/__NR_getcontext.s b/libc/sysv/consts/__NR_getcontext.s
new file mode 100644
index 00000000..27e66190
--- /dev/null
+++ b/libc/sysv/consts/__NR_getcontext.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getcontext -1 -1 0x01a5 -1 -1
diff --git a/libc/sysv/consts/__NR_getcpu.s b/libc/sysv/consts/__NR_getcpu.s
new file mode 100644
index 00000000..df6e5537
--- /dev/null
+++ b/libc/sysv/consts/__NR_getcpu.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getcpu 0x0135 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getcwd.s b/libc/sysv/consts/__NR_getcwd.s
new file mode 100644
index 00000000..b535c81e
--- /dev/null
+++ b/libc/sysv/consts/__NR_getcwd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getcwd 0x004f -1 0x0146 0x0130 -1
diff --git a/libc/sysv/consts/__NR_getdents.s b/libc/sysv/consts/__NR_getdents.s
new file mode 100644
index 00000000..d236fca8
--- /dev/null
+++ b/libc/sysv/consts/__NR_getdents.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getdents 0x00d9 -1 0x0110 0x0063 -1
diff --git a/libc/sysv/consts/__NR_getdirentries.s b/libc/sysv/consts/__NR_getdirentries.s
new file mode 100644
index 00000000..6f19ec5f
--- /dev/null
+++ b/libc/sysv/consts/__NR_getdirentries.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getdirentries -1 0x2000158 0x022a -1 -1
diff --git a/libc/sysv/consts/__NR_getdirentriesattr.s b/libc/sysv/consts/__NR_getdirentriesattr.s
new file mode 100644
index 00000000..45b1e342
--- /dev/null
+++ b/libc/sysv/consts/__NR_getdirentriesattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getdirentriesattr -1 0x20000de -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getdtablecount.s b/libc/sysv/consts/__NR_getdtablecount.s
new file mode 100644
index 00000000..831b9290
--- /dev/null
+++ b/libc/sysv/consts/__NR_getdtablecount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getdtablecount -1 -1 -1 0x0012 -1
diff --git a/libc/sysv/consts/__NR_getdtablesize.s b/libc/sysv/consts/__NR_getdtablesize.s
new file mode 100644
index 00000000..33758079
--- /dev/null
+++ b/libc/sysv/consts/__NR_getdtablesize.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getdtablesize -1 0x2000059 0x0059 -1 -1
diff --git a/libc/sysv/consts/__NR_getfh.s b/libc/sysv/consts/__NR_getfh.s
new file mode 100644
index 00000000..0399250e
--- /dev/null
+++ b/libc/sysv/consts/__NR_getfh.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getfh -1 0x20000a1 0x00a1 0x00a1 -1
diff --git a/libc/sysv/consts/__NR_getfhat.s b/libc/sysv/consts/__NR_getfhat.s
new file mode 100644
index 00000000..2fc5f00f
--- /dev/null
+++ b/libc/sysv/consts/__NR_getfhat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getfhat -1 -1 0x0234 -1 -1
diff --git a/libc/sysv/consts/__NR_getfsstat.s b/libc/sysv/consts/__NR_getfsstat.s
new file mode 100644
index 00000000..edc39d9d
--- /dev/null
+++ b/libc/sysv/consts/__NR_getfsstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getfsstat -1 0x200015b 0x022d 0x003e -1
diff --git a/libc/sysv/consts/__NR_getgroups.s b/libc/sysv/consts/__NR_getgroups.s
new file mode 100644
index 00000000..a53c1916
--- /dev/null
+++ b/libc/sysv/consts/__NR_getgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getgroups 0x0073 0x200004f 0x004f 0x004f -1
diff --git a/libc/sysv/consts/__NR_gethostid.s b/libc/sysv/consts/__NR_gethostid.s
new file mode 100644
index 00000000..7a537d51
--- /dev/null
+++ b/libc/sysv/consts/__NR_gethostid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_gethostid -1 -1 0x008e -1 -1
diff --git a/libc/sysv/consts/__NR_gethostuuid.s b/libc/sysv/consts/__NR_gethostuuid.s
new file mode 100644
index 00000000..3d53ef83
--- /dev/null
+++ b/libc/sysv/consts/__NR_gethostuuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_gethostuuid -1 0x200008e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getitimer.s b/libc/sysv/consts/__NR_getitimer.s
new file mode 100644
index 00000000..740c5a71
--- /dev/null
+++ b/libc/sysv/consts/__NR_getitimer.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getitimer 0x0024 0x2000056 0x0056 0x0046 -1
diff --git a/libc/sysv/consts/__NR_getkerninfo.s b/libc/sysv/consts/__NR_getkerninfo.s
new file mode 100644
index 00000000..acae98b2
--- /dev/null
+++ b/libc/sysv/consts/__NR_getkerninfo.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getkerninfo -1 -1 0x003f -1 -1
diff --git a/libc/sysv/consts/__NR_getlogin.s b/libc/sysv/consts/__NR_getlogin.s
new file mode 100644
index 00000000..1aa9436d
--- /dev/null
+++ b/libc/sysv/consts/__NR_getlogin.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getlogin -1 0x2000031 0x0031 -1 -1
diff --git a/libc/sysv/consts/__NR_getlogin_r.s b/libc/sysv/consts/__NR_getlogin_r.s
new file mode 100644
index 00000000..fd205744
--- /dev/null
+++ b/libc/sysv/consts/__NR_getlogin_r.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getlogin_r -1 -1 -1 0x008d -1
diff --git a/libc/sysv/consts/__NR_getloginclass.s b/libc/sysv/consts/__NR_getloginclass.s
new file mode 100644
index 00000000..e732d3b7
--- /dev/null
+++ b/libc/sysv/consts/__NR_getloginclass.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getloginclass -1 -1 0x020b -1 -1
diff --git a/libc/sysv/consts/__NR_getpagesize.s b/libc/sysv/consts/__NR_getpagesize.s
new file mode 100644
index 00000000..86a28ba1
--- /dev/null
+++ b/libc/sysv/consts/__NR_getpagesize.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getpagesize -1 -1 0x0040 -1 -1
diff --git a/libc/sysv/consts/__NR_getpeername.s b/libc/sysv/consts/__NR_getpeername.s
new file mode 100644
index 00000000..b9d3e7d6
--- /dev/null
+++ b/libc/sysv/consts/__NR_getpeername.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getpeername 0x0034 0x200001f 0x008d 0x001f -1
diff --git a/libc/sysv/consts/__NR_getpgid.s b/libc/sysv/consts/__NR_getpgid.s
new file mode 100644
index 00000000..cdd77bb6
--- /dev/null
+++ b/libc/sysv/consts/__NR_getpgid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getpgid 0x0079 0x2000097 0x00cf 0x00cf -1
diff --git a/libc/sysv/consts/__NR_getpgrp.s b/libc/sysv/consts/__NR_getpgrp.s
new file mode 100644
index 00000000..9aa47dbc
--- /dev/null
+++ b/libc/sysv/consts/__NR_getpgrp.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getpgrp 0x006f 0x2000051 0x0051 0x0051 -1
diff --git a/libc/sysv/consts/__NR_getppid.s b/libc/sysv/consts/__NR_getppid.s
new file mode 100644
index 00000000..365ae4a6
--- /dev/null
+++ b/libc/sysv/consts/__NR_getppid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getppid 0x006e 0x2000027 0x0027 0x0027 -1
diff --git a/libc/sysv/consts/__NR_getpriority.s b/libc/sysv/consts/__NR_getpriority.s
new file mode 100644
index 00000000..a9e8188e
--- /dev/null
+++ b/libc/sysv/consts/__NR_getpriority.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getpriority 0x008c 0x2000064 0x0064 0x0064 -1
diff --git a/libc/sysv/consts/__NR_getrandom.s b/libc/sysv/consts/__NR_getrandom.s
new file mode 100644
index 00000000..a5f35c86
--- /dev/null
+++ b/libc/sysv/consts/__NR_getrandom.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getrandom 0x013e 0x20001f4 0x0233 0x0007 -1
diff --git a/libc/sysv/consts/__NR_getresgid.s b/libc/sysv/consts/__NR_getresgid.s
new file mode 100644
index 00000000..d80d03c3
--- /dev/null
+++ b/libc/sysv/consts/__NR_getresgid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getresgid 0x0078 -1 0x0169 0x011b -1
diff --git a/libc/sysv/consts/__NR_getresuid.s b/libc/sysv/consts/__NR_getresuid.s
new file mode 100644
index 00000000..d8143cef
--- /dev/null
+++ b/libc/sysv/consts/__NR_getresuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getresuid 0x0076 -1 0x0168 0x0119 -1
diff --git a/libc/sysv/consts/__NR_getrlimit.s b/libc/sysv/consts/__NR_getrlimit.s
new file mode 100644
index 00000000..f6360497
--- /dev/null
+++ b/libc/sysv/consts/__NR_getrlimit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getrlimit 0x0061 0x20000c2 0x00c2 0x00c2 -1
diff --git a/libc/sysv/consts/__NR_getrtable.s b/libc/sysv/consts/__NR_getrtable.s
new file mode 100644
index 00000000..da65dbe3
--- /dev/null
+++ b/libc/sysv/consts/__NR_getrtable.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getrtable -1 -1 -1 0x0137 -1
diff --git a/libc/sysv/consts/__NR_getrusage.s b/libc/sysv/consts/__NR_getrusage.s
new file mode 100644
index 00000000..8e7213ae
--- /dev/null
+++ b/libc/sysv/consts/__NR_getrusage.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getrusage 0x0062 0x2000075 0x0075 0x0013 -1
diff --git a/libc/sysv/consts/__NR_getsgroups.s b/libc/sysv/consts/__NR_getsgroups.s
new file mode 100644
index 00000000..eb438e0b
--- /dev/null
+++ b/libc/sysv/consts/__NR_getsgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getsgroups -1 0x2000120 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getsid.s b/libc/sysv/consts/__NR_getsid.s
new file mode 100644
index 00000000..bc514713
--- /dev/null
+++ b/libc/sysv/consts/__NR_getsid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getsid 0x007c 0x2000136 0x0136 0x00ff -1
diff --git a/libc/sysv/consts/__NR_getsockname.s b/libc/sysv/consts/__NR_getsockname.s
new file mode 100644
index 00000000..0d8bf25b
--- /dev/null
+++ b/libc/sysv/consts/__NR_getsockname.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getsockname 0x0033 0x2000020 0x0020 0x0020 -1
diff --git a/libc/sysv/consts/__NR_getsockopt.s b/libc/sysv/consts/__NR_getsockopt.s
new file mode 100644
index 00000000..b8a84711
--- /dev/null
+++ b/libc/sysv/consts/__NR_getsockopt.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getsockopt 0x0037 0x2000076 0x0076 0x0076 -1
diff --git a/libc/sysv/consts/__NR_getthrid.s b/libc/sysv/consts/__NR_getthrid.s
new file mode 100644
index 00000000..f7525b9a
--- /dev/null
+++ b/libc/sysv/consts/__NR_getthrid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getthrid -1 -1 -1 0x012b -1
diff --git a/libc/sysv/consts/__NR_gettid.s b/libc/sysv/consts/__NR_gettid.s
index ac05fda1..efbf1f9c 100644
--- a/libc/sysv/consts/__NR_gettid.s
+++ b/libc/sysv/consts/__NR_gettid.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_gettid 0x00ba 0x200011e 0xffff 0xffff -1
+.syscon nr __NR_gettid 0x00ba 0x200011e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getwgroups.s b/libc/sysv/consts/__NR_getwgroups.s
new file mode 100644
index 00000000..82b8fae8
--- /dev/null
+++ b/libc/sysv/consts/__NR_getwgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getwgroups -1 0x2000122 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_getxattr.s b/libc/sysv/consts/__NR_getxattr.s
new file mode 100644
index 00000000..b9ae2672
--- /dev/null
+++ b/libc/sysv/consts/__NR_getxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_getxattr 0x00bf 0x20000ea -1 -1 -1
diff --git a/libc/sysv/consts/__NR_grab_pgo_data.s b/libc/sysv/consts/__NR_grab_pgo_data.s
new file mode 100644
index 00000000..5e313974
--- /dev/null
+++ b/libc/sysv/consts/__NR_grab_pgo_data.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_grab_pgo_data -1 0x20001ed -1 -1 -1
diff --git a/libc/sysv/consts/__NR_gssd_syscall.s b/libc/sysv/consts/__NR_gssd_syscall.s
new file mode 100644
index 00000000..a5474dfc
--- /dev/null
+++ b/libc/sysv/consts/__NR_gssd_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_gssd_syscall -1 -1 0x01f9 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_close_np.s b/libc/sysv/consts/__NR_guarded_close_np.s
new file mode 100644
index 00000000..598e8f11
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_close_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_close_np -1 0x20001ba -1 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_kqueue_np.s b/libc/sysv/consts/__NR_guarded_kqueue_np.s
new file mode 100644
index 00000000..1650d98b
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_kqueue_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_kqueue_np -1 0x20001bb -1 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_open_dprotected_np.s b/libc/sysv/consts/__NR_guarded_open_dprotected_np.s
new file mode 100644
index 00000000..31726293
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_open_dprotected_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_open_dprotected_np -1 0x20001e4 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_open_np.s b/libc/sysv/consts/__NR_guarded_open_np.s
new file mode 100644
index 00000000..dfc62212
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_open_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_open_np -1 0x20001b9 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_pwrite_np.s b/libc/sysv/consts/__NR_guarded_pwrite_np.s
new file mode 100644
index 00000000..1ed0c5f3
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_pwrite_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_pwrite_np -1 0x20001e6 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_write_np.s b/libc/sysv/consts/__NR_guarded_write_np.s
new file mode 100644
index 00000000..89364713
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_write_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_write_np -1 0x20001e5 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_guarded_writev_np.s b/libc/sysv/consts/__NR_guarded_writev_np.s
new file mode 100644
index 00000000..428dac08
--- /dev/null
+++ b/libc/sysv/consts/__NR_guarded_writev_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_guarded_writev_np -1 0x20001e7 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_identitysvc.s b/libc/sysv/consts/__NR_identitysvc.s
new file mode 100644
index 00000000..9e979b87
--- /dev/null
+++ b/libc/sysv/consts/__NR_identitysvc.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_identitysvc -1 0x2000125 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_init_module.s b/libc/sysv/consts/__NR_init_module.s
new file mode 100644
index 00000000..ced1090e
--- /dev/null
+++ b/libc/sysv/consts/__NR_init_module.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_init_module 0x00af -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_initgroups.s b/libc/sysv/consts/__NR_initgroups.s
new file mode 100644
index 00000000..b9f7b756
--- /dev/null
+++ b/libc/sysv/consts/__NR_initgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_initgroups -1 0x20000f3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_inotify_add_watch.s b/libc/sysv/consts/__NR_inotify_add_watch.s
new file mode 100644
index 00000000..780e8397
--- /dev/null
+++ b/libc/sysv/consts/__NR_inotify_add_watch.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_inotify_add_watch 0x00fe -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_inotify_init.s b/libc/sysv/consts/__NR_inotify_init.s
new file mode 100644
index 00000000..88ef375b
--- /dev/null
+++ b/libc/sysv/consts/__NR_inotify_init.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_inotify_init 0x00fd -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_inotify_init1.s b/libc/sysv/consts/__NR_inotify_init1.s
new file mode 100644
index 00000000..3106d48e
--- /dev/null
+++ b/libc/sysv/consts/__NR_inotify_init1.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_inotify_init1 0x0126 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_inotify_rm_watch.s b/libc/sysv/consts/__NR_inotify_rm_watch.s
new file mode 100644
index 00000000..cf136bc2
--- /dev/null
+++ b/libc/sysv/consts/__NR_inotify_rm_watch.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_inotify_rm_watch 0x00ff -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_cancel.s b/libc/sysv/consts/__NR_io_cancel.s
new file mode 100644
index 00000000..fe01a17b
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_cancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_cancel 0x00d2 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_destroy.s b/libc/sysv/consts/__NR_io_destroy.s
new file mode 100644
index 00000000..69ba75da
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_destroy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_destroy 0x00cf -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_getevents.s b/libc/sysv/consts/__NR_io_getevents.s
new file mode 100644
index 00000000..9aa453f7
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_getevents.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_getevents 0x00d0 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_pgetevents.s b/libc/sysv/consts/__NR_io_pgetevents.s
new file mode 100644
index 00000000..c05c0db5
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_pgetevents.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_pgetevents 0x014d -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_setup.s b/libc/sysv/consts/__NR_io_setup.s
new file mode 100644
index 00000000..445e98d1
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_setup.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_setup 0x00ce -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_submit.s b/libc/sysv/consts/__NR_io_submit.s
new file mode 100644
index 00000000..95361e28
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_submit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_submit 0x00d1 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_uring_enter.s b/libc/sysv/consts/__NR_io_uring_enter.s
new file mode 100644
index 00000000..d3b28cab
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_uring_enter.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_uring_enter 0x01aa -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_uring_register.s b/libc/sysv/consts/__NR_io_uring_register.s
new file mode 100644
index 00000000..4e01ddc8
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_uring_register.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_uring_register 0x01ab -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_io_uring_setup.s b/libc/sysv/consts/__NR_io_uring_setup.s
new file mode 100644
index 00000000..4f18aba8
--- /dev/null
+++ b/libc/sysv/consts/__NR_io_uring_setup.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_io_uring_setup 0x01a9 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ioctl.s b/libc/sysv/consts/__NR_ioctl.s
new file mode 100644
index 00000000..541c576f
--- /dev/null
+++ b/libc/sysv/consts/__NR_ioctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ioctl 0x0010 0x2000036 0x0036 0x0036 -1
diff --git a/libc/sysv/consts/__NR_ioperm.s b/libc/sysv/consts/__NR_ioperm.s
new file mode 100644
index 00000000..3435ae1d
--- /dev/null
+++ b/libc/sysv/consts/__NR_ioperm.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ioperm 0x00ad -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_iopl.s b/libc/sysv/consts/__NR_iopl.s
new file mode 100644
index 00000000..e2b0da47
--- /dev/null
+++ b/libc/sysv/consts/__NR_iopl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_iopl 0x00ac -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_iopolicysys.s b/libc/sysv/consts/__NR_iopolicysys.s
new file mode 100644
index 00000000..6a5c4718
--- /dev/null
+++ b/libc/sysv/consts/__NR_iopolicysys.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_iopolicysys -1 0x2000142 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ioprio_get.s b/libc/sysv/consts/__NR_ioprio_get.s
new file mode 100644
index 00000000..604c04b4
--- /dev/null
+++ b/libc/sysv/consts/__NR_ioprio_get.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ioprio_get 0x00fc -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ioprio_set.s b/libc/sysv/consts/__NR_ioprio_set.s
new file mode 100644
index 00000000..48ddfa19
--- /dev/null
+++ b/libc/sysv/consts/__NR_ioprio_set.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ioprio_set 0x00fb -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_issetugid.s b/libc/sysv/consts/__NR_issetugid.s
new file mode 100644
index 00000000..28b46669
--- /dev/null
+++ b/libc/sysv/consts/__NR_issetugid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_issetugid -1 0x2000147 0x00fd 0x00fd -1
diff --git a/libc/sysv/consts/__NR_jail.s b/libc/sysv/consts/__NR_jail.s
new file mode 100644
index 00000000..770a0cc8
--- /dev/null
+++ b/libc/sysv/consts/__NR_jail.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_jail -1 -1 0x0152 -1 -1
diff --git a/libc/sysv/consts/__NR_jail_attach.s b/libc/sysv/consts/__NR_jail_attach.s
new file mode 100644
index 00000000..7f519bb7
--- /dev/null
+++ b/libc/sysv/consts/__NR_jail_attach.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_jail_attach -1 -1 0x01b4 -1 -1
diff --git a/libc/sysv/consts/__NR_jail_get.s b/libc/sysv/consts/__NR_jail_get.s
new file mode 100644
index 00000000..50b721f2
--- /dev/null
+++ b/libc/sysv/consts/__NR_jail_get.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_jail_get -1 -1 0x01fa -1 -1
diff --git a/libc/sysv/consts/__NR_jail_remove.s b/libc/sysv/consts/__NR_jail_remove.s
new file mode 100644
index 00000000..f25efa38
--- /dev/null
+++ b/libc/sysv/consts/__NR_jail_remove.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_jail_remove -1 -1 0x01fc -1 -1
diff --git a/libc/sysv/consts/__NR_jail_set.s b/libc/sysv/consts/__NR_jail_set.s
new file mode 100644
index 00000000..0120c8ea
--- /dev/null
+++ b/libc/sysv/consts/__NR_jail_set.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_jail_set -1 -1 0x01fb -1 -1
diff --git a/libc/sysv/consts/__NR_kas_info.s b/libc/sysv/consts/__NR_kas_info.s
new file mode 100644
index 00000000..c4c681a5
--- /dev/null
+++ b/libc/sysv/consts/__NR_kas_info.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kas_info -1 0x20001b7 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kbind.s b/libc/sysv/consts/__NR_kbind.s
new file mode 100644
index 00000000..20b109c7
--- /dev/null
+++ b/libc/sysv/consts/__NR_kbind.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kbind -1 -1 -1 0x0056 -1
diff --git a/libc/sysv/consts/__NR_kcmp.s b/libc/sysv/consts/__NR_kcmp.s
new file mode 100644
index 00000000..ee611ea4
--- /dev/null
+++ b/libc/sysv/consts/__NR_kcmp.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kcmp 0x0138 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kdebug_trace.s b/libc/sysv/consts/__NR_kdebug_trace.s
new file mode 100644
index 00000000..7e57e9d9
--- /dev/null
+++ b/libc/sysv/consts/__NR_kdebug_trace.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kdebug_trace -1 0x20000b3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kdebug_trace_string.s b/libc/sysv/consts/__NR_kdebug_trace_string.s
new file mode 100644
index 00000000..c1d5cd24
--- /dev/null
+++ b/libc/sysv/consts/__NR_kdebug_trace_string.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kdebug_trace_string -1 0x20000b2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kdebug_typefilter.s b/libc/sysv/consts/__NR_kdebug_typefilter.s
new file mode 100644
index 00000000..dcd2b622
--- /dev/null
+++ b/libc/sysv/consts/__NR_kdebug_typefilter.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kdebug_typefilter -1 0x20000b1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kenv.s b/libc/sysv/consts/__NR_kenv.s
new file mode 100644
index 00000000..7b243c98
--- /dev/null
+++ b/libc/sysv/consts/__NR_kenv.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kenv -1 -1 0x0186 -1 -1
diff --git a/libc/sysv/consts/__NR_kevent.s b/libc/sysv/consts/__NR_kevent.s
new file mode 100644
index 00000000..5552814a
--- /dev/null
+++ b/libc/sysv/consts/__NR_kevent.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kevent -1 0x2000171 0x0230 0x0048 -1
diff --git a/libc/sysv/consts/__NR_kevent_id.s b/libc/sysv/consts/__NR_kevent_id.s
new file mode 100644
index 00000000..ae99d94f
--- /dev/null
+++ b/libc/sysv/consts/__NR_kevent_id.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kevent_id -1 0x2000177 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kevent_qos.s b/libc/sysv/consts/__NR_kevent_qos.s
new file mode 100644
index 00000000..59d9a7ce
--- /dev/null
+++ b/libc/sysv/consts/__NR_kevent_qos.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kevent_qos -1 0x2000176 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kexec_file_load.s b/libc/sysv/consts/__NR_kexec_file_load.s
new file mode 100644
index 00000000..b651f70f
--- /dev/null
+++ b/libc/sysv/consts/__NR_kexec_file_load.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kexec_file_load 0x0140 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_kexec_load.s b/libc/sysv/consts/__NR_kexec_load.s
new file mode 100644
index 00000000..481ea6af
--- /dev/null
+++ b/libc/sysv/consts/__NR_kexec_load.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kexec_load 0x00f6 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_keyctl.s b/libc/sysv/consts/__NR_keyctl.s
new file mode 100644
index 00000000..8123272e
--- /dev/null
+++ b/libc/sysv/consts/__NR_keyctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_keyctl 0x00fa -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_killpg.s b/libc/sysv/consts/__NR_killpg.s
new file mode 100644
index 00000000..05cd2646
--- /dev/null
+++ b/libc/sysv/consts/__NR_killpg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_killpg -1 -1 0x0092 -1 -1
diff --git a/libc/sysv/consts/__NR_kldfind.s b/libc/sysv/consts/__NR_kldfind.s
new file mode 100644
index 00000000..67c5aec0
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldfind.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldfind -1 -1 0x0132 -1 -1
diff --git a/libc/sysv/consts/__NR_kldfirstmod.s b/libc/sysv/consts/__NR_kldfirstmod.s
new file mode 100644
index 00000000..9f1dddc6
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldfirstmod.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldfirstmod -1 -1 0x0135 -1 -1
diff --git a/libc/sysv/consts/__NR_kldload.s b/libc/sysv/consts/__NR_kldload.s
new file mode 100644
index 00000000..904c3c76
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldload.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldload -1 -1 0x0130 -1 -1
diff --git a/libc/sysv/consts/__NR_kldnext.s b/libc/sysv/consts/__NR_kldnext.s
new file mode 100644
index 00000000..3e802ed0
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldnext.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldnext -1 -1 0x0133 -1 -1
diff --git a/libc/sysv/consts/__NR_kldstat.s b/libc/sysv/consts/__NR_kldstat.s
new file mode 100644
index 00000000..6cb012d7
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldstat -1 -1 0x0134 -1 -1
diff --git a/libc/sysv/consts/__NR_kldsym.s b/libc/sysv/consts/__NR_kldsym.s
new file mode 100644
index 00000000..1cea909d
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldsym.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldsym -1 -1 0x0151 -1 -1
diff --git a/libc/sysv/consts/__NR_kldunload.s b/libc/sysv/consts/__NR_kldunload.s
new file mode 100644
index 00000000..46b8f750
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldunload.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldunload -1 -1 0x0131 -1 -1
diff --git a/libc/sysv/consts/__NR_kldunloadf.s b/libc/sysv/consts/__NR_kldunloadf.s
new file mode 100644
index 00000000..9c5fc461
--- /dev/null
+++ b/libc/sysv/consts/__NR_kldunloadf.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kldunloadf -1 -1 0x01bc -1 -1
diff --git a/libc/sysv/consts/__NR_kmq_notify.s b/libc/sysv/consts/__NR_kmq_notify.s
new file mode 100644
index 00000000..fadb415f
--- /dev/null
+++ b/libc/sysv/consts/__NR_kmq_notify.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kmq_notify -1 -1 0x01cd -1 -1
diff --git a/libc/sysv/consts/__NR_kmq_setattr.s b/libc/sysv/consts/__NR_kmq_setattr.s
new file mode 100644
index 00000000..431bd7e1
--- /dev/null
+++ b/libc/sysv/consts/__NR_kmq_setattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kmq_setattr -1 -1 0x01ca -1 -1
diff --git a/libc/sysv/consts/__NR_kmq_timedreceive.s b/libc/sysv/consts/__NR_kmq_timedreceive.s
new file mode 100644
index 00000000..e83bec97
--- /dev/null
+++ b/libc/sysv/consts/__NR_kmq_timedreceive.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kmq_timedreceive -1 -1 0x01cb -1 -1
diff --git a/libc/sysv/consts/__NR_kmq_timedsend.s b/libc/sysv/consts/__NR_kmq_timedsend.s
new file mode 100644
index 00000000..5c4eee1f
--- /dev/null
+++ b/libc/sysv/consts/__NR_kmq_timedsend.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kmq_timedsend -1 -1 0x01cc -1 -1
diff --git a/libc/sysv/consts/__NR_kmq_unlink.s b/libc/sysv/consts/__NR_kmq_unlink.s
new file mode 100644
index 00000000..6b64843b
--- /dev/null
+++ b/libc/sysv/consts/__NR_kmq_unlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kmq_unlink -1 -1 0x01ce -1 -1
diff --git a/libc/sysv/consts/__NR_kqueue.s b/libc/sysv/consts/__NR_kqueue.s
new file mode 100644
index 00000000..4c89efde
--- /dev/null
+++ b/libc/sysv/consts/__NR_kqueue.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_kqueue -1 0x200016a 0x016a 0x010d -1
diff --git a/libc/sysv/consts/__NR_ksem_close.s b/libc/sysv/consts/__NR_ksem_close.s
new file mode 100644
index 00000000..dfd29aa3
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_close.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_close -1 -1 0x0190 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_destroy.s b/libc/sysv/consts/__NR_ksem_destroy.s
new file mode 100644
index 00000000..12bbdc2c
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_destroy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_destroy -1 -1 0x0198 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_getvalue.s b/libc/sysv/consts/__NR_ksem_getvalue.s
new file mode 100644
index 00000000..4019db67
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_getvalue.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_getvalue -1 -1 0x0197 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_init.s b/libc/sysv/consts/__NR_ksem_init.s
new file mode 100644
index 00000000..ededc99b
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_init.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_init -1 -1 0x0194 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_open.s b/libc/sysv/consts/__NR_ksem_open.s
new file mode 100644
index 00000000..59a9d14f
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_open -1 -1 0x0195 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_post.s b/libc/sysv/consts/__NR_ksem_post.s
new file mode 100644
index 00000000..c22ae3ea
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_post.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_post -1 -1 0x0191 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_timedwait.s b/libc/sysv/consts/__NR_ksem_timedwait.s
new file mode 100644
index 00000000..69995320
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_timedwait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_timedwait -1 -1 0x01b9 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_trywait.s b/libc/sysv/consts/__NR_ksem_trywait.s
new file mode 100644
index 00000000..9f79daa9
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_trywait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_trywait -1 -1 0x0193 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_unlink.s b/libc/sysv/consts/__NR_ksem_unlink.s
new file mode 100644
index 00000000..cd51d8ae
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_unlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_unlink -1 -1 0x0196 -1 -1
diff --git a/libc/sysv/consts/__NR_ksem_wait.s b/libc/sysv/consts/__NR_ksem_wait.s
new file mode 100644
index 00000000..1a4e1f30
--- /dev/null
+++ b/libc/sysv/consts/__NR_ksem_wait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ksem_wait -1 -1 0x0192 -1 -1
diff --git a/libc/sysv/consts/__NR_ktimer_create.s b/libc/sysv/consts/__NR_ktimer_create.s
new file mode 100644
index 00000000..69101448
--- /dev/null
+++ b/libc/sysv/consts/__NR_ktimer_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ktimer_create -1 -1 0x00eb -1 -1
diff --git a/libc/sysv/consts/__NR_ktimer_delete.s b/libc/sysv/consts/__NR_ktimer_delete.s
new file mode 100644
index 00000000..197acb55
--- /dev/null
+++ b/libc/sysv/consts/__NR_ktimer_delete.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ktimer_delete -1 -1 0x00ec -1 -1
diff --git a/libc/sysv/consts/__NR_ktimer_getoverrun.s b/libc/sysv/consts/__NR_ktimer_getoverrun.s
new file mode 100644
index 00000000..abd29fcc
--- /dev/null
+++ b/libc/sysv/consts/__NR_ktimer_getoverrun.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ktimer_getoverrun -1 -1 0x00ef -1 -1
diff --git a/libc/sysv/consts/__NR_ktimer_gettime.s b/libc/sysv/consts/__NR_ktimer_gettime.s
new file mode 100644
index 00000000..0fb3ca0e
--- /dev/null
+++ b/libc/sysv/consts/__NR_ktimer_gettime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ktimer_gettime -1 -1 0x00ee -1 -1
diff --git a/libc/sysv/consts/__NR_ktimer_settime.s b/libc/sysv/consts/__NR_ktimer_settime.s
new file mode 100644
index 00000000..4c44a8c4
--- /dev/null
+++ b/libc/sysv/consts/__NR_ktimer_settime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ktimer_settime -1 -1 0x00ed -1 -1
diff --git a/libc/sysv/consts/__NR_ktrace.s b/libc/sysv/consts/__NR_ktrace.s
new file mode 100644
index 00000000..a8297eb2
--- /dev/null
+++ b/libc/sysv/consts/__NR_ktrace.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ktrace -1 -1 0x002d 0x002d -1
diff --git a/libc/sysv/consts/__NR_lchflags.s b/libc/sysv/consts/__NR_lchflags.s
new file mode 100644
index 00000000..db828b7d
--- /dev/null
+++ b/libc/sysv/consts/__NR_lchflags.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lchflags -1 -1 0x0187 -1 -1
diff --git a/libc/sysv/consts/__NR_lchmod.s b/libc/sysv/consts/__NR_lchmod.s
new file mode 100644
index 00000000..782d6a83
--- /dev/null
+++ b/libc/sysv/consts/__NR_lchmod.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lchmod -1 -1 0x0112 -1 -1
diff --git a/libc/sysv/consts/__NR_lchown.s b/libc/sysv/consts/__NR_lchown.s
new file mode 100644
index 00000000..c0137a38
--- /dev/null
+++ b/libc/sysv/consts/__NR_lchown.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lchown 0x005e 0x200016c 0x00fe 0x00fe -1
diff --git a/libc/sysv/consts/__NR_ledger.s b/libc/sysv/consts/__NR_ledger.s
new file mode 100644
index 00000000..46e7d77a
--- /dev/null
+++ b/libc/sysv/consts/__NR_ledger.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ledger -1 0x2000175 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_lgetfh.s b/libc/sysv/consts/__NR_lgetfh.s
new file mode 100644
index 00000000..75600b8c
--- /dev/null
+++ b/libc/sysv/consts/__NR_lgetfh.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lgetfh -1 -1 0x00a0 -1 -1
diff --git a/libc/sysv/consts/__NR_lgetxattr.s b/libc/sysv/consts/__NR_lgetxattr.s
new file mode 100644
index 00000000..03fee42b
--- /dev/null
+++ b/libc/sysv/consts/__NR_lgetxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lgetxattr 0x00c0 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_link.s b/libc/sysv/consts/__NR_link.s
new file mode 100644
index 00000000..c35751fb
--- /dev/null
+++ b/libc/sysv/consts/__NR_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_link 0x0056 0x2000009 0x0009 0x0009 -1
diff --git a/libc/sysv/consts/__NR_linkat.s b/libc/sysv/consts/__NR_linkat.s
new file mode 100644
index 00000000..fba9610b
--- /dev/null
+++ b/libc/sysv/consts/__NR_linkat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_linkat 0x0109 0x20001d7 0x01ef 0x013d -1
diff --git a/libc/sysv/consts/__NR_lio_listio.s b/libc/sysv/consts/__NR_lio_listio.s
new file mode 100644
index 00000000..dc0a0e60
--- /dev/null
+++ b/libc/sysv/consts/__NR_lio_listio.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lio_listio -1 0x2000140 0x0140 -1 -1
diff --git a/libc/sysv/consts/__NR_listen.s b/libc/sysv/consts/__NR_listen.s
new file mode 100644
index 00000000..a31604a7
--- /dev/null
+++ b/libc/sysv/consts/__NR_listen.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_listen 0x0032 0x200006a 0x006a 0x006a -1
diff --git a/libc/sysv/consts/__NR_listxattr.s b/libc/sysv/consts/__NR_listxattr.s
new file mode 100644
index 00000000..d4e9aaed
--- /dev/null
+++ b/libc/sysv/consts/__NR_listxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_listxattr 0x00c2 0x20000f0 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_llistxattr.s b/libc/sysv/consts/__NR_llistxattr.s
new file mode 100644
index 00000000..370913f6
--- /dev/null
+++ b/libc/sysv/consts/__NR_llistxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_llistxattr 0x00c3 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_lookup_dcookie.s b/libc/sysv/consts/__NR_lookup_dcookie.s
new file mode 100644
index 00000000..c8be32e2
--- /dev/null
+++ b/libc/sysv/consts/__NR_lookup_dcookie.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lookup_dcookie 0x00d4 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_lpathconf.s b/libc/sysv/consts/__NR_lpathconf.s
new file mode 100644
index 00000000..feefd888
--- /dev/null
+++ b/libc/sysv/consts/__NR_lpathconf.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lpathconf -1 -1 0x0201 -1 -1
diff --git a/libc/sysv/consts/__NR_lremovexattr.s b/libc/sysv/consts/__NR_lremovexattr.s
new file mode 100644
index 00000000..a04f1f83
--- /dev/null
+++ b/libc/sysv/consts/__NR_lremovexattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lremovexattr 0x00c6 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_lseek.s b/libc/sysv/consts/__NR_lseek.s
new file mode 100644
index 00000000..ddb9f987
--- /dev/null
+++ b/libc/sysv/consts/__NR_lseek.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lseek 0x0008 0x20000c7 0x01de 0x00c7 -1
diff --git a/libc/sysv/consts/__NR_lsetxattr.s b/libc/sysv/consts/__NR_lsetxattr.s
new file mode 100644
index 00000000..b55dbf11
--- /dev/null
+++ b/libc/sysv/consts/__NR_lsetxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lsetxattr 0x00bd -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_lstat_extended.s b/libc/sysv/consts/__NR_lstat_extended.s
new file mode 100644
index 00000000..bfbafd26
--- /dev/null
+++ b/libc/sysv/consts/__NR_lstat_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lstat_extended -1 0x2000156 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_lutimes.s b/libc/sysv/consts/__NR_lutimes.s
new file mode 100644
index 00000000..a840528a
--- /dev/null
+++ b/libc/sysv/consts/__NR_lutimes.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_lutimes -1 -1 0x0114 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_execve.s b/libc/sysv/consts/__NR_mac_execve.s
new file mode 100644
index 00000000..66900134
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_execve.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_execve -1 0x200017c 0x019f -1 -1
diff --git a/libc/sysv/consts/__NR_mac_get_fd.s b/libc/sysv/consts/__NR_mac_get_fd.s
new file mode 100644
index 00000000..ada5f03a
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_get_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_get_fd -1 0x2000184 0x0182 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_get_file.s b/libc/sysv/consts/__NR_mac_get_file.s
new file mode 100644
index 00000000..b67e1dae
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_get_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_get_file -1 0x200017e 0x0183 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_get_link.s b/libc/sysv/consts/__NR_mac_get_link.s
new file mode 100644
index 00000000..7a8cf490
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_get_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_get_link -1 0x2000180 0x019a -1 -1
diff --git a/libc/sysv/consts/__NR_mac_get_mount.s b/libc/sysv/consts/__NR_mac_get_mount.s
new file mode 100644
index 00000000..6ce3a14d
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_get_mount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_get_mount -1 0x20001a9 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_get_pid.s b/libc/sysv/consts/__NR_mac_get_pid.s
new file mode 100644
index 00000000..c1185b62
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_get_pid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_get_pid -1 0x2000186 0x0199 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_get_proc.s b/libc/sysv/consts/__NR_mac_get_proc.s
new file mode 100644
index 00000000..03af869e
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_get_proc.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_get_proc -1 0x2000182 0x0180 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_getfsstat.s b/libc/sysv/consts/__NR_mac_getfsstat.s
new file mode 100644
index 00000000..93338bd7
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_getfsstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_getfsstat -1 0x20001aa -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_mount.s b/libc/sysv/consts/__NR_mac_mount.s
new file mode 100644
index 00000000..c9c5850c
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_mount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_mount -1 0x20001a8 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_set_fd.s b/libc/sysv/consts/__NR_mac_set_fd.s
new file mode 100644
index 00000000..90463ada
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_set_fd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_set_fd -1 0x2000185 0x0184 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_set_file.s b/libc/sysv/consts/__NR_mac_set_file.s
new file mode 100644
index 00000000..2ba8d75a
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_set_file.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_set_file -1 0x200017f 0x0185 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_set_link.s b/libc/sysv/consts/__NR_mac_set_link.s
new file mode 100644
index 00000000..e41ac1ee
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_set_link.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_set_link -1 0x2000181 0x019b -1 -1
diff --git a/libc/sysv/consts/__NR_mac_set_proc.s b/libc/sysv/consts/__NR_mac_set_proc.s
new file mode 100644
index 00000000..6852f05e
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_set_proc.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_set_proc -1 0x2000183 0x0181 -1 -1
diff --git a/libc/sysv/consts/__NR_mac_syscall.s b/libc/sysv/consts/__NR_mac_syscall.s
new file mode 100644
index 00000000..cae81988
--- /dev/null
+++ b/libc/sysv/consts/__NR_mac_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mac_syscall -1 -1 0x018a -1 -1
diff --git a/libc/sysv/consts/__NR_mbind.s b/libc/sysv/consts/__NR_mbind.s
new file mode 100644
index 00000000..aab7b635
--- /dev/null
+++ b/libc/sysv/consts/__NR_mbind.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mbind 0x00ed -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_membarrier.s b/libc/sysv/consts/__NR_membarrier.s
new file mode 100644
index 00000000..f00cba05
--- /dev/null
+++ b/libc/sysv/consts/__NR_membarrier.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_membarrier 0x0144 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_memfd_create.s b/libc/sysv/consts/__NR_memfd_create.s
new file mode 100644
index 00000000..40db47a5
--- /dev/null
+++ b/libc/sysv/consts/__NR_memfd_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_memfd_create 0x013f -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_memorystatus_control.s b/libc/sysv/consts/__NR_memorystatus_control.s
new file mode 100644
index 00000000..d56644c7
--- /dev/null
+++ b/libc/sysv/consts/__NR_memorystatus_control.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_memorystatus_control -1 0x20001b8 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_memorystatus_get_level.s b/libc/sysv/consts/__NR_memorystatus_get_level.s
new file mode 100644
index 00000000..df56fa26
--- /dev/null
+++ b/libc/sysv/consts/__NR_memorystatus_get_level.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_memorystatus_get_level -1 0x20001c5 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_microstackshot.s b/libc/sysv/consts/__NR_microstackshot.s
new file mode 100644
index 00000000..cab3ba81
--- /dev/null
+++ b/libc/sysv/consts/__NR_microstackshot.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_microstackshot -1 0x20001ec -1 -1 -1
diff --git a/libc/sysv/consts/__NR_migrate_pages.s b/libc/sysv/consts/__NR_migrate_pages.s
new file mode 100644
index 00000000..6e16839f
--- /dev/null
+++ b/libc/sysv/consts/__NR_migrate_pages.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_migrate_pages 0x0100 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mincore.s b/libc/sysv/consts/__NR_mincore.s
new file mode 100644
index 00000000..3fb6c1db
--- /dev/null
+++ b/libc/sysv/consts/__NR_mincore.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mincore 0x001b 0x200004e 0x004e 0x004e -1
diff --git a/libc/sysv/consts/__NR_minherit.s b/libc/sysv/consts/__NR_minherit.s
new file mode 100644
index 00000000..28f08538
--- /dev/null
+++ b/libc/sysv/consts/__NR_minherit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_minherit -1 0x20000fa 0x00fa 0x00fa -1
diff --git a/libc/sysv/consts/__NR_mkdir.s b/libc/sysv/consts/__NR_mkdir.s
new file mode 100644
index 00000000..dde8ede6
--- /dev/null
+++ b/libc/sysv/consts/__NR_mkdir.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mkdir 0x0053 0x2000088 0x0088 0x0088 -1
diff --git a/libc/sysv/consts/__NR_mkdir_extended.s b/libc/sysv/consts/__NR_mkdir_extended.s
new file mode 100644
index 00000000..3e8bb619
--- /dev/null
+++ b/libc/sysv/consts/__NR_mkdir_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mkdir_extended -1 0x2000124 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mkdirat.s b/libc/sysv/consts/__NR_mkdirat.s
new file mode 100644
index 00000000..868ee1be
--- /dev/null
+++ b/libc/sysv/consts/__NR_mkdirat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mkdirat 0x0102 0x20001db 0x01f0 0x013e -1
diff --git a/libc/sysv/consts/__NR_mkfifo.s b/libc/sysv/consts/__NR_mkfifo.s
new file mode 100644
index 00000000..abacf61b
--- /dev/null
+++ b/libc/sysv/consts/__NR_mkfifo.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mkfifo -1 0x2000084 0x0084 0x0084 -1
diff --git a/libc/sysv/consts/__NR_mkfifo_extended.s b/libc/sysv/consts/__NR_mkfifo_extended.s
new file mode 100644
index 00000000..85f1cd8c
--- /dev/null
+++ b/libc/sysv/consts/__NR_mkfifo_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mkfifo_extended -1 0x2000123 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mkfifoat.s b/libc/sysv/consts/__NR_mkfifoat.s
new file mode 100644
index 00000000..6eea0eb4
--- /dev/null
+++ b/libc/sysv/consts/__NR_mkfifoat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mkfifoat -1 -1 0x01f1 0x013f -1
diff --git a/libc/sysv/consts/__NR_mknod.s b/libc/sysv/consts/__NR_mknod.s
new file mode 100644
index 00000000..1561f157
--- /dev/null
+++ b/libc/sysv/consts/__NR_mknod.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mknod 0x0085 0x200000e 0x000e 0x000e -1
diff --git a/libc/sysv/consts/__NR_mknodat.s b/libc/sysv/consts/__NR_mknodat.s
new file mode 100644
index 00000000..9c4739b9
--- /dev/null
+++ b/libc/sysv/consts/__NR_mknodat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mknodat 0x0103 -1 0x22ff 0x0140 -1
diff --git a/libc/sysv/consts/__NR_mlock.s b/libc/sysv/consts/__NR_mlock.s
new file mode 100644
index 00000000..eadef315
--- /dev/null
+++ b/libc/sysv/consts/__NR_mlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mlock 0x0095 0x20000cb 0x00cb 0x00cb -1
diff --git a/libc/sysv/consts/__NR_mlock2.s b/libc/sysv/consts/__NR_mlock2.s
new file mode 100644
index 00000000..a0625753
--- /dev/null
+++ b/libc/sysv/consts/__NR_mlock2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mlock2 0x0145 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mlockall.s b/libc/sysv/consts/__NR_mlockall.s
new file mode 100644
index 00000000..1769a5a5
--- /dev/null
+++ b/libc/sysv/consts/__NR_mlockall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mlockall 0x0097 0x2000144 0x0144 0x010f -1
diff --git a/libc/sysv/consts/__NR_modfind.s b/libc/sysv/consts/__NR_modfind.s
new file mode 100644
index 00000000..c5a380cf
--- /dev/null
+++ b/libc/sysv/consts/__NR_modfind.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_modfind -1 -1 0x012f -1 -1
diff --git a/libc/sysv/consts/__NR_modfnext.s b/libc/sysv/consts/__NR_modfnext.s
new file mode 100644
index 00000000..ea2b1100
--- /dev/null
+++ b/libc/sysv/consts/__NR_modfnext.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_modfnext -1 -1 0x012e -1 -1
diff --git a/libc/sysv/consts/__NR_modify_ldt.s b/libc/sysv/consts/__NR_modify_ldt.s
new file mode 100644
index 00000000..9e6a1d6d
--- /dev/null
+++ b/libc/sysv/consts/__NR_modify_ldt.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_modify_ldt 0x009a -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_modnext.s b/libc/sysv/consts/__NR_modnext.s
new file mode 100644
index 00000000..3ff02af6
--- /dev/null
+++ b/libc/sysv/consts/__NR_modnext.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_modnext -1 -1 0x012c -1 -1
diff --git a/libc/sysv/consts/__NR_modstat.s b/libc/sysv/consts/__NR_modstat.s
new file mode 100644
index 00000000..f6162611
--- /dev/null
+++ b/libc/sysv/consts/__NR_modstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_modstat -1 -1 0x012d -1 -1
diff --git a/libc/sysv/consts/__NR_modwatch.s b/libc/sysv/consts/__NR_modwatch.s
new file mode 100644
index 00000000..1f1aa93c
--- /dev/null
+++ b/libc/sysv/consts/__NR_modwatch.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_modwatch -1 0x20000e9 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mount.s b/libc/sysv/consts/__NR_mount.s
new file mode 100644
index 00000000..1fe15215
--- /dev/null
+++ b/libc/sysv/consts/__NR_mount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mount 0x00a5 0x20000a7 0x0015 0x0015 -1
diff --git a/libc/sysv/consts/__NR_move_pages.s b/libc/sysv/consts/__NR_move_pages.s
new file mode 100644
index 00000000..9aa0f083
--- /dev/null
+++ b/libc/sysv/consts/__NR_move_pages.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_move_pages 0x0117 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mq_getsetattr.s b/libc/sysv/consts/__NR_mq_getsetattr.s
new file mode 100644
index 00000000..ab34ee5a
--- /dev/null
+++ b/libc/sysv/consts/__NR_mq_getsetattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mq_getsetattr 0x00f5 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mq_notify.s b/libc/sysv/consts/__NR_mq_notify.s
new file mode 100644
index 00000000..6c10b872
--- /dev/null
+++ b/libc/sysv/consts/__NR_mq_notify.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mq_notify 0x00f4 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mq_open.s b/libc/sysv/consts/__NR_mq_open.s
new file mode 100644
index 00000000..f9a64dcf
--- /dev/null
+++ b/libc/sysv/consts/__NR_mq_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mq_open 0x00f0 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mq_timedreceive.s b/libc/sysv/consts/__NR_mq_timedreceive.s
new file mode 100644
index 00000000..8466d269
--- /dev/null
+++ b/libc/sysv/consts/__NR_mq_timedreceive.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mq_timedreceive 0x00f3 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mq_timedsend.s b/libc/sysv/consts/__NR_mq_timedsend.s
new file mode 100644
index 00000000..eb1c0556
--- /dev/null
+++ b/libc/sysv/consts/__NR_mq_timedsend.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mq_timedsend 0x00f2 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mq_unlink.s b/libc/sysv/consts/__NR_mq_unlink.s
new file mode 100644
index 00000000..b9c9676c
--- /dev/null
+++ b/libc/sysv/consts/__NR_mq_unlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mq_unlink 0x00f1 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mquery.s b/libc/sysv/consts/__NR_mquery.s
new file mode 100644
index 00000000..aae7cdd3
--- /dev/null
+++ b/libc/sysv/consts/__NR_mquery.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mquery -1 -1 -1 0x011e -1
diff --git a/libc/sysv/consts/__NR_mremap.s b/libc/sysv/consts/__NR_mremap.s
new file mode 100644
index 00000000..92b6b091
--- /dev/null
+++ b/libc/sysv/consts/__NR_mremap.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mremap 0x0019 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_mremap_encrypted.s b/libc/sysv/consts/__NR_mremap_encrypted.s
new file mode 100644
index 00000000..0a35d98c
--- /dev/null
+++ b/libc/sysv/consts/__NR_mremap_encrypted.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_mremap_encrypted -1 0x20001e9 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_msgctl.s b/libc/sysv/consts/__NR_msgctl.s
new file mode 100644
index 00000000..b80225b9
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgctl 0x0047 0x2000102 0x01ff 0x0129 -1
diff --git a/libc/sysv/consts/__NR_msgget.s b/libc/sysv/consts/__NR_msgget.s
new file mode 100644
index 00000000..3ce05c46
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgget.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgget 0x0044 0x2000103 0x00e1 0x00e1 -1
diff --git a/libc/sysv/consts/__NR_msgrcv.s b/libc/sysv/consts/__NR_msgrcv.s
new file mode 100644
index 00000000..1da085ec
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgrcv.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgrcv 0x0046 0x2000105 0x00e3 0x00e3 -1
diff --git a/libc/sysv/consts/__NR_msgrcv_nocancel.s b/libc/sysv/consts/__NR_msgrcv_nocancel.s
new file mode 100644
index 00000000..02795254
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgrcv_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgrcv_nocancel -1 0x20001a3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_msgsnd.s b/libc/sysv/consts/__NR_msgsnd.s
new file mode 100644
index 00000000..11733d20
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgsnd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgsnd 0x0045 0x2000104 0x00e2 0x00e2 -1
diff --git a/libc/sysv/consts/__NR_msgsnd_nocancel.s b/libc/sysv/consts/__NR_msgsnd_nocancel.s
new file mode 100644
index 00000000..bfbfa36e
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgsnd_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgsnd_nocancel -1 0x20001a2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_msgsys.s b/libc/sysv/consts/__NR_msgsys.s
new file mode 100644
index 00000000..a1f4970b
--- /dev/null
+++ b/libc/sysv/consts/__NR_msgsys.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msgsys -1 0x20000fc 0x00aa -1 -1
diff --git a/libc/sysv/consts/__NR_msync.s b/libc/sysv/consts/__NR_msync.s
new file mode 100644
index 00000000..19d67c76
--- /dev/null
+++ b/libc/sysv/consts/__NR_msync.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msync 0x001a 0x2000041 0x0041 0x0100 -1
diff --git a/libc/sysv/consts/__NR_msync_nocancel.s b/libc/sysv/consts/__NR_msync_nocancel.s
new file mode 100644
index 00000000..60c86a96
--- /dev/null
+++ b/libc/sysv/consts/__NR_msync_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_msync_nocancel -1 0x2000195 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_munlock.s b/libc/sysv/consts/__NR_munlock.s
new file mode 100644
index 00000000..162a3ed6
--- /dev/null
+++ b/libc/sysv/consts/__NR_munlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_munlock 0x0096 0x20000cc 0x00cc 0x00cc -1
diff --git a/libc/sysv/consts/__NR_munlockall.s b/libc/sysv/consts/__NR_munlockall.s
new file mode 100644
index 00000000..2b4a4e19
--- /dev/null
+++ b/libc/sysv/consts/__NR_munlockall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_munlockall 0x0098 0x2000145 0x0145 0x0110 -1
diff --git a/libc/sysv/consts/__NR_name_to_handle_at.s b/libc/sysv/consts/__NR_name_to_handle_at.s
new file mode 100644
index 00000000..9eae2b77
--- /dev/null
+++ b/libc/sysv/consts/__NR_name_to_handle_at.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_name_to_handle_at 0x012f -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_nanosleep.s b/libc/sysv/consts/__NR_nanosleep.s
new file mode 100644
index 00000000..5726872c
--- /dev/null
+++ b/libc/sysv/consts/__NR_nanosleep.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nanosleep 0x0023 -1 0x00f0 0x005b -1
diff --git a/libc/sysv/consts/__NR_necp_client_action.s b/libc/sysv/consts/__NR_necp_client_action.s
new file mode 100644
index 00000000..7d163392
--- /dev/null
+++ b/libc/sysv/consts/__NR_necp_client_action.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_necp_client_action -1 0x20001f6 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_necp_match_policy.s b/libc/sysv/consts/__NR_necp_match_policy.s
new file mode 100644
index 00000000..892b3096
--- /dev/null
+++ b/libc/sysv/consts/__NR_necp_match_policy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_necp_match_policy -1 0x20001cc -1 -1 -1
diff --git a/libc/sysv/consts/__NR_necp_open.s b/libc/sysv/consts/__NR_necp_open.s
new file mode 100644
index 00000000..362469a2
--- /dev/null
+++ b/libc/sysv/consts/__NR_necp_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_necp_open -1 0x20001f5 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_necp_session_action.s b/libc/sysv/consts/__NR_necp_session_action.s
new file mode 100644
index 00000000..cf1671c7
--- /dev/null
+++ b/libc/sysv/consts/__NR_necp_session_action.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_necp_session_action -1 0x200020b -1 -1 -1
diff --git a/libc/sysv/consts/__NR_necp_session_open.s b/libc/sysv/consts/__NR_necp_session_open.s
new file mode 100644
index 00000000..b3171314
--- /dev/null
+++ b/libc/sysv/consts/__NR_necp_session_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_necp_session_open -1 0x200020a -1 -1 -1
diff --git a/libc/sysv/consts/__NR_net_qos_guideline.s b/libc/sysv/consts/__NR_net_qos_guideline.s
new file mode 100644
index 00000000..255d7050
--- /dev/null
+++ b/libc/sysv/consts/__NR_net_qos_guideline.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_net_qos_guideline -1 0x200020d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_netagent_trigger.s b/libc/sysv/consts/__NR_netagent_trigger.s
new file mode 100644
index 00000000..cefce2e8
--- /dev/null
+++ b/libc/sysv/consts/__NR_netagent_trigger.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_netagent_trigger -1 0x20001ea -1 -1 -1
diff --git a/libc/sysv/consts/__NR_nfsclnt.s b/libc/sysv/consts/__NR_nfsclnt.s
new file mode 100644
index 00000000..92c813dd
--- /dev/null
+++ b/libc/sysv/consts/__NR_nfsclnt.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nfsclnt -1 0x20000f7 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_nfssvc.s b/libc/sysv/consts/__NR_nfssvc.s
new file mode 100644
index 00000000..4e51667e
--- /dev/null
+++ b/libc/sysv/consts/__NR_nfssvc.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nfssvc -1 0x200009b 0x009b 0x009b -1
diff --git a/libc/sysv/consts/__NR_nfstat.s b/libc/sysv/consts/__NR_nfstat.s
new file mode 100644
index 00000000..b1a77d4d
--- /dev/null
+++ b/libc/sysv/consts/__NR_nfstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nfstat -1 -1 0x0117 -1 -1
diff --git a/libc/sysv/consts/__NR_nlm_syscall.s b/libc/sysv/consts/__NR_nlm_syscall.s
new file mode 100644
index 00000000..8862f68f
--- /dev/null
+++ b/libc/sysv/consts/__NR_nlm_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nlm_syscall -1 -1 0x009a -1 -1
diff --git a/libc/sysv/consts/__NR_nlstat.s b/libc/sysv/consts/__NR_nlstat.s
new file mode 100644
index 00000000..23d8a6e4
--- /dev/null
+++ b/libc/sysv/consts/__NR_nlstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nlstat -1 -1 0x0118 -1 -1
diff --git a/libc/sysv/consts/__NR_nmount.s b/libc/sysv/consts/__NR_nmount.s
new file mode 100644
index 00000000..20220a61
--- /dev/null
+++ b/libc/sysv/consts/__NR_nmount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nmount -1 -1 0x017a -1 -1
diff --git a/libc/sysv/consts/__NR_nnpfs_syscall.s b/libc/sysv/consts/__NR_nnpfs_syscall.s
new file mode 100644
index 00000000..33f56138
--- /dev/null
+++ b/libc/sysv/consts/__NR_nnpfs_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nnpfs_syscall -1 -1 0x0153 -1 -1
diff --git a/libc/sysv/consts/__NR_nstat.s b/libc/sysv/consts/__NR_nstat.s
new file mode 100644
index 00000000..a27174f0
--- /dev/null
+++ b/libc/sysv/consts/__NR_nstat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_nstat -1 -1 0x0116 -1 -1
diff --git a/libc/sysv/consts/__NR_ntp_adjtime.s b/libc/sysv/consts/__NR_ntp_adjtime.s
new file mode 100644
index 00000000..fd016685
--- /dev/null
+++ b/libc/sysv/consts/__NR_ntp_adjtime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ntp_adjtime -1 0x200020f 0x00b0 -1 -1
diff --git a/libc/sysv/consts/__NR_ntp_gettime.s b/libc/sysv/consts/__NR_ntp_gettime.s
new file mode 100644
index 00000000..f830646c
--- /dev/null
+++ b/libc/sysv/consts/__NR_ntp_gettime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ntp_gettime -1 0x2000210 0x00f8 -1 -1
diff --git a/libc/sysv/consts/__NR_obreak.s b/libc/sysv/consts/__NR_obreak.s
new file mode 100644
index 00000000..ca99e74b
--- /dev/null
+++ b/libc/sysv/consts/__NR_obreak.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_obreak -1 -1 -1 0x0011 -1
diff --git a/libc/sysv/consts/__NR_old_semwait_signal.s b/libc/sysv/consts/__NR_old_semwait_signal.s
new file mode 100644
index 00000000..7655d5a1
--- /dev/null
+++ b/libc/sysv/consts/__NR_old_semwait_signal.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_old_semwait_signal -1 0x2000172 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_old_semwait_signal_nocancel.s b/libc/sysv/consts/__NR_old_semwait_signal_nocancel.s
new file mode 100644
index 00000000..fadefbb3
--- /dev/null
+++ b/libc/sysv/consts/__NR_old_semwait_signal_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_old_semwait_signal_nocancel -1 0x2000173 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_open_by_handle_at.s b/libc/sysv/consts/__NR_open_by_handle_at.s
new file mode 100644
index 00000000..b2e0645f
--- /dev/null
+++ b/libc/sysv/consts/__NR_open_by_handle_at.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_open_by_handle_at 0x0130 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_open_dprotected_np.s b/libc/sysv/consts/__NR_open_dprotected_np.s
new file mode 100644
index 00000000..6b53c25c
--- /dev/null
+++ b/libc/sysv/consts/__NR_open_dprotected_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_open_dprotected_np -1 0x20000d8 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_open_extended.s b/libc/sysv/consts/__NR_open_extended.s
new file mode 100644
index 00000000..e7e098d5
--- /dev/null
+++ b/libc/sysv/consts/__NR_open_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_open_extended -1 0x2000115 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_open_nocancel.s b/libc/sysv/consts/__NR_open_nocancel.s
new file mode 100644
index 00000000..a0fe8d19
--- /dev/null
+++ b/libc/sysv/consts/__NR_open_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_open_nocancel -1 0x200018e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_openat.s b/libc/sysv/consts/__NR_openat.s
new file mode 100644
index 00000000..66f7e1ff
--- /dev/null
+++ b/libc/sysv/consts/__NR_openat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_openat 0x0101 0x20001cf 0x01f3 0x0141 -1
diff --git a/libc/sysv/consts/__NR_openat_nocancel.s b/libc/sysv/consts/__NR_openat_nocancel.s
new file mode 100644
index 00000000..772f7253
--- /dev/null
+++ b/libc/sysv/consts/__NR_openat_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_openat_nocancel -1 0x20001d0 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_openbyid_np.s b/libc/sysv/consts/__NR_openbyid_np.s
new file mode 100644
index 00000000..10d85e64
--- /dev/null
+++ b/libc/sysv/consts/__NR_openbyid_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_openbyid_np -1 0x20001df -1 -1 -1
diff --git a/libc/sysv/consts/__NR_os_fault_with_payload.s b/libc/sysv/consts/__NR_os_fault_with_payload.s
new file mode 100644
index 00000000..c4e84e15
--- /dev/null
+++ b/libc/sysv/consts/__NR_os_fault_with_payload.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_os_fault_with_payload -1 0x2000211 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pathconf.s b/libc/sysv/consts/__NR_pathconf.s
new file mode 100644
index 00000000..e44094c9
--- /dev/null
+++ b/libc/sysv/consts/__NR_pathconf.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pathconf -1 0x20000bf 0x00bf 0x00bf -1
diff --git a/libc/sysv/consts/__NR_pause.s b/libc/sysv/consts/__NR_pause.s
new file mode 100644
index 00000000..72b24698
--- /dev/null
+++ b/libc/sysv/consts/__NR_pause.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pause 0x0022 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pdfork.s b/libc/sysv/consts/__NR_pdfork.s
new file mode 100644
index 00000000..23f2b58a
--- /dev/null
+++ b/libc/sysv/consts/__NR_pdfork.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pdfork -1 -1 0x0206 -1 -1
diff --git a/libc/sysv/consts/__NR_pdgetpid.s b/libc/sysv/consts/__NR_pdgetpid.s
new file mode 100644
index 00000000..6672d40b
--- /dev/null
+++ b/libc/sysv/consts/__NR_pdgetpid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pdgetpid -1 -1 0x0208 -1 -1
diff --git a/libc/sysv/consts/__NR_pdkill.s b/libc/sysv/consts/__NR_pdkill.s
new file mode 100644
index 00000000..275d39b3
--- /dev/null
+++ b/libc/sysv/consts/__NR_pdkill.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pdkill -1 -1 0x0207 -1 -1
diff --git a/libc/sysv/consts/__NR_peeloff.s b/libc/sysv/consts/__NR_peeloff.s
new file mode 100644
index 00000000..b74d2cd0
--- /dev/null
+++ b/libc/sysv/consts/__NR_peeloff.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_peeloff -1 0x20001c1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_perf_event_open.s b/libc/sysv/consts/__NR_perf_event_open.s
new file mode 100644
index 00000000..e7d0329e
--- /dev/null
+++ b/libc/sysv/consts/__NR_perf_event_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_perf_event_open 0x012a -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_persona.s b/libc/sysv/consts/__NR_persona.s
new file mode 100644
index 00000000..5e5f92a9
--- /dev/null
+++ b/libc/sysv/consts/__NR_persona.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_persona -1 0x20001ee -1 -1 -1
diff --git a/libc/sysv/consts/__NR_personality.s b/libc/sysv/consts/__NR_personality.s
new file mode 100644
index 00000000..2a4bc18d
--- /dev/null
+++ b/libc/sysv/consts/__NR_personality.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_personality 0x0087 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pid_hibernate.s b/libc/sysv/consts/__NR_pid_hibernate.s
new file mode 100644
index 00000000..b5e0107d
--- /dev/null
+++ b/libc/sysv/consts/__NR_pid_hibernate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pid_hibernate -1 0x20001b3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pid_resume.s b/libc/sysv/consts/__NR_pid_resume.s
new file mode 100644
index 00000000..85267ae1
--- /dev/null
+++ b/libc/sysv/consts/__NR_pid_resume.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pid_resume -1 0x20001b2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pid_shutdown_sockets.s b/libc/sysv/consts/__NR_pid_shutdown_sockets.s
new file mode 100644
index 00000000..092cc0c2
--- /dev/null
+++ b/libc/sysv/consts/__NR_pid_shutdown_sockets.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pid_shutdown_sockets -1 0x20001b4 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pid_suspend.s b/libc/sysv/consts/__NR_pid_suspend.s
new file mode 100644
index 00000000..b23cb09c
--- /dev/null
+++ b/libc/sysv/consts/__NR_pid_suspend.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pid_suspend -1 0x20001b1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pidfd_send_signal.s b/libc/sysv/consts/__NR_pidfd_send_signal.s
new file mode 100644
index 00000000..94d0e3aa
--- /dev/null
+++ b/libc/sysv/consts/__NR_pidfd_send_signal.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pidfd_send_signal 0x01a8 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pipe.s b/libc/sysv/consts/__NR_pipe.s
new file mode 100644
index 00000000..59b69675
--- /dev/null
+++ b/libc/sysv/consts/__NR_pipe.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pipe 0x0016 0x200002a 0x021e 0x0107 -1
diff --git a/libc/sysv/consts/__NR_pipe2.s b/libc/sysv/consts/__NR_pipe2.s
new file mode 100644
index 00000000..5b6bb748
--- /dev/null
+++ b/libc/sysv/consts/__NR_pipe2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pipe2 0x0125 -1 0x021e 0x0065 -1
diff --git a/libc/sysv/consts/__NR_pivot_root.s b/libc/sysv/consts/__NR_pivot_root.s
new file mode 100644
index 00000000..ce22c3a3
--- /dev/null
+++ b/libc/sysv/consts/__NR_pivot_root.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pivot_root 0x009b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pkey_alloc.s b/libc/sysv/consts/__NR_pkey_alloc.s
new file mode 100644
index 00000000..948921ec
--- /dev/null
+++ b/libc/sysv/consts/__NR_pkey_alloc.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pkey_alloc 0x014a -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pkey_free.s b/libc/sysv/consts/__NR_pkey_free.s
new file mode 100644
index 00000000..012ede2d
--- /dev/null
+++ b/libc/sysv/consts/__NR_pkey_free.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pkey_free 0x014b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pkey_mprotect.s b/libc/sysv/consts/__NR_pkey_mprotect.s
new file mode 100644
index 00000000..259a6a37
--- /dev/null
+++ b/libc/sysv/consts/__NR_pkey_mprotect.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pkey_mprotect 0x0149 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pledge.s b/libc/sysv/consts/__NR_pledge.s
new file mode 100644
index 00000000..567f3240
--- /dev/null
+++ b/libc/sysv/consts/__NR_pledge.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pledge -1 -1 -1 0x006c -1
diff --git a/libc/sysv/consts/__NR_poll.s b/libc/sysv/consts/__NR_poll.s
new file mode 100644
index 00000000..6ed6720c
--- /dev/null
+++ b/libc/sysv/consts/__NR_poll.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_poll 0x0007 0x20000e6 0x00d1 0x00fc -1
diff --git a/libc/sysv/consts/__NR_poll_nocancel.s b/libc/sysv/consts/__NR_poll_nocancel.s
new file mode 100644
index 00000000..5dcc38ac
--- /dev/null
+++ b/libc/sysv/consts/__NR_poll_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_poll_nocancel -1 0x20001a1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_posix_fallocate.s b/libc/sysv/consts/__NR_posix_fallocate.s
new file mode 100644
index 00000000..bb45e113
--- /dev/null
+++ b/libc/sysv/consts/__NR_posix_fallocate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_posix_fallocate -1 -1 0x0212 -1 -1
diff --git a/libc/sysv/consts/__NR_posix_openpt.s b/libc/sysv/consts/__NR_posix_openpt.s
new file mode 100644
index 00000000..58082780
--- /dev/null
+++ b/libc/sysv/consts/__NR_posix_openpt.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_posix_openpt -1 -1 0x01f8 -1 -1
diff --git a/libc/sysv/consts/__NR_posix_spawn.s b/libc/sysv/consts/__NR_posix_spawn.s
new file mode 100644
index 00000000..e1bc3916
--- /dev/null
+++ b/libc/sysv/consts/__NR_posix_spawn.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_posix_spawn -1 0x20000f4 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ppoll.s b/libc/sysv/consts/__NR_ppoll.s
new file mode 100644
index 00000000..7098115b
--- /dev/null
+++ b/libc/sysv/consts/__NR_ppoll.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ppoll 0x010f -1 0x0221 0x006d -1
diff --git a/libc/sysv/consts/__NR_prctl.s b/libc/sysv/consts/__NR_prctl.s
new file mode 100644
index 00000000..55144718
--- /dev/null
+++ b/libc/sysv/consts/__NR_prctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_prctl 0x009d -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pread_nocancel.s b/libc/sysv/consts/__NR_pread_nocancel.s
new file mode 100644
index 00000000..793539e1
--- /dev/null
+++ b/libc/sysv/consts/__NR_pread_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pread_nocancel -1 0x200019e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_preadv.s b/libc/sysv/consts/__NR_preadv.s
new file mode 100644
index 00000000..a8b52263
--- /dev/null
+++ b/libc/sysv/consts/__NR_preadv.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_preadv 0x0127 -1 0x0121 0x010b -1
diff --git a/libc/sysv/consts/__NR_preadv2.s b/libc/sysv/consts/__NR_preadv2.s
new file mode 100644
index 00000000..7e2a308f
--- /dev/null
+++ b/libc/sysv/consts/__NR_preadv2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_preadv2 0x0147 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_prlimit.s b/libc/sysv/consts/__NR_prlimit.s
new file mode 100644
index 00000000..da0b9835
--- /dev/null
+++ b/libc/sysv/consts/__NR_prlimit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_prlimit 0x012e -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_proc_info.s b/libc/sysv/consts/__NR_proc_info.s
new file mode 100644
index 00000000..9ac684f6
--- /dev/null
+++ b/libc/sysv/consts/__NR_proc_info.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_proc_info -1 0x2000150 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_proc_rlimit_control.s b/libc/sysv/consts/__NR_proc_rlimit_control.s
new file mode 100644
index 00000000..6ae2208c
--- /dev/null
+++ b/libc/sysv/consts/__NR_proc_rlimit_control.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_proc_rlimit_control -1 0x20001be -1 -1 -1
diff --git a/libc/sysv/consts/__NR_proc_trace_log.s b/libc/sysv/consts/__NR_proc_trace_log.s
new file mode 100644
index 00000000..8a23c35b
--- /dev/null
+++ b/libc/sysv/consts/__NR_proc_trace_log.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_proc_trace_log -1 0x20001dd -1 -1 -1
diff --git a/libc/sysv/consts/__NR_proc_uuid_policy.s b/libc/sysv/consts/__NR_proc_uuid_policy.s
new file mode 100644
index 00000000..4721f99c
--- /dev/null
+++ b/libc/sysv/consts/__NR_proc_uuid_policy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_proc_uuid_policy -1 0x20001c4 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_procctl.s b/libc/sysv/consts/__NR_procctl.s
new file mode 100644
index 00000000..7d58aeef
--- /dev/null
+++ b/libc/sysv/consts/__NR_procctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_procctl -1 -1 0x0220 -1 -1
diff --git a/libc/sysv/consts/__NR_process_policy.s b/libc/sysv/consts/__NR_process_policy.s
new file mode 100644
index 00000000..d496a768
--- /dev/null
+++ b/libc/sysv/consts/__NR_process_policy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_process_policy -1 0x2000143 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_process_vm_readv.s b/libc/sysv/consts/__NR_process_vm_readv.s
new file mode 100644
index 00000000..6df5ea46
--- /dev/null
+++ b/libc/sysv/consts/__NR_process_vm_readv.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_process_vm_readv 0x0136 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_process_vm_writev.s b/libc/sysv/consts/__NR_process_vm_writev.s
new file mode 100644
index 00000000..a121bc3c
--- /dev/null
+++ b/libc/sysv/consts/__NR_process_vm_writev.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_process_vm_writev 0x0137 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_profil.s b/libc/sysv/consts/__NR_profil.s
new file mode 100644
index 00000000..88513114
--- /dev/null
+++ b/libc/sysv/consts/__NR_profil.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_profil -1 -1 0x002c 0x002c -1
diff --git a/libc/sysv/consts/__NR_pselect.s b/libc/sysv/consts/__NR_pselect.s
new file mode 100644
index 00000000..a5ba60e4
--- /dev/null
+++ b/libc/sysv/consts/__NR_pselect.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pselect -1 0x200018a 0x020a 0x006e -1
diff --git a/libc/sysv/consts/__NR_pselect6.s b/libc/sysv/consts/__NR_pselect6.s
new file mode 100644
index 00000000..59b4d1f4
--- /dev/null
+++ b/libc/sysv/consts/__NR_pselect6.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pselect6 0x010e -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pselect_nocancel.s b/libc/sysv/consts/__NR_pselect_nocancel.s
new file mode 100644
index 00000000..a5ba9be7
--- /dev/null
+++ b/libc/sysv/consts/__NR_pselect_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pselect_nocancel -1 0x200018b -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_cvbroad.s b/libc/sysv/consts/__NR_psynch_cvbroad.s
new file mode 100644
index 00000000..722c53a3
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_cvbroad.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_cvbroad -1 0x200012f -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_cvclrprepost.s b/libc/sysv/consts/__NR_psynch_cvclrprepost.s
new file mode 100644
index 00000000..e6aba09d
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_cvclrprepost.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_cvclrprepost -1 0x2000138 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_cvsignal.s b/libc/sysv/consts/__NR_psynch_cvsignal.s
new file mode 100644
index 00000000..e7cf4b56
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_cvsignal.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_cvsignal -1 0x2000130 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_cvwait.s b/libc/sysv/consts/__NR_psynch_cvwait.s
new file mode 100644
index 00000000..c2294cb7
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_cvwait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_cvwait -1 0x2000131 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_mutexdrop.s b/libc/sysv/consts/__NR_psynch_mutexdrop.s
new file mode 100644
index 00000000..0cfe024a
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_mutexdrop.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_mutexdrop -1 0x200012e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_mutexwait.s b/libc/sysv/consts/__NR_psynch_mutexwait.s
new file mode 100644
index 00000000..f29a2e07
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_mutexwait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_mutexwait -1 0x200012d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_downgrade.s b/libc/sysv/consts/__NR_psynch_rw_downgrade.s
new file mode 100644
index 00000000..22891e7f
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_downgrade.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_downgrade -1 0x200012b -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_longrdlock.s b/libc/sysv/consts/__NR_psynch_rw_longrdlock.s
new file mode 100644
index 00000000..bf8d62a5
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_longrdlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_longrdlock -1 0x2000129 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_rdlock.s b/libc/sysv/consts/__NR_psynch_rw_rdlock.s
new file mode 100644
index 00000000..01f0177d
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_rdlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_rdlock -1 0x2000132 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_unlock.s b/libc/sysv/consts/__NR_psynch_rw_unlock.s
new file mode 100644
index 00000000..b59bd181
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_unlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_unlock -1 0x2000134 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_unlock2.s b/libc/sysv/consts/__NR_psynch_rw_unlock2.s
new file mode 100644
index 00000000..118133dd
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_unlock2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_unlock2 -1 0x2000135 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_upgrade.s b/libc/sysv/consts/__NR_psynch_rw_upgrade.s
new file mode 100644
index 00000000..09a64d4f
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_upgrade.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_upgrade -1 0x200012c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_wrlock.s b/libc/sysv/consts/__NR_psynch_rw_wrlock.s
new file mode 100644
index 00000000..bff237df
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_wrlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_wrlock -1 0x2000133 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_psynch_rw_yieldwrlock.s b/libc/sysv/consts/__NR_psynch_rw_yieldwrlock.s
new file mode 100644
index 00000000..0cdd7c71
--- /dev/null
+++ b/libc/sysv/consts/__NR_psynch_rw_yieldwrlock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_psynch_rw_yieldwrlock -1 0x200012a -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pthread_canceled.s b/libc/sysv/consts/__NR_pthread_canceled.s
new file mode 100644
index 00000000..b3ac5136
--- /dev/null
+++ b/libc/sysv/consts/__NR_pthread_canceled.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pthread_canceled -1 0x200014d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pthread_chdir.s b/libc/sysv/consts/__NR_pthread_chdir.s
new file mode 100644
index 00000000..ba2d0e6c
--- /dev/null
+++ b/libc/sysv/consts/__NR_pthread_chdir.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pthread_chdir -1 0x200015c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pthread_fchdir.s b/libc/sysv/consts/__NR_pthread_fchdir.s
new file mode 100644
index 00000000..f370a16e
--- /dev/null
+++ b/libc/sysv/consts/__NR_pthread_fchdir.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pthread_fchdir -1 0x200015d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pthread_kill.s b/libc/sysv/consts/__NR_pthread_kill.s
new file mode 100644
index 00000000..ea1ad846
--- /dev/null
+++ b/libc/sysv/consts/__NR_pthread_kill.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pthread_kill -1 0x2000148 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pthread_markcancel.s b/libc/sysv/consts/__NR_pthread_markcancel.s
new file mode 100644
index 00000000..92311d9f
--- /dev/null
+++ b/libc/sysv/consts/__NR_pthread_markcancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pthread_markcancel -1 0x200014c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pthread_sigmask.s b/libc/sysv/consts/__NR_pthread_sigmask.s
new file mode 100644
index 00000000..487b29e3
--- /dev/null
+++ b/libc/sysv/consts/__NR_pthread_sigmask.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pthread_sigmask -1 0x2000149 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ptrace.s b/libc/sysv/consts/__NR_ptrace.s
new file mode 100644
index 00000000..8fecb494
--- /dev/null
+++ b/libc/sysv/consts/__NR_ptrace.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ptrace 0x0065 0x200001a 0x001a 0x001a -1
diff --git a/libc/sysv/consts/__NR_pwrite_nocancel.s b/libc/sysv/consts/__NR_pwrite_nocancel.s
new file mode 100644
index 00000000..48dde7e6
--- /dev/null
+++ b/libc/sysv/consts/__NR_pwrite_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pwrite_nocancel -1 0x200019f -1 -1 -1
diff --git a/libc/sysv/consts/__NR_pwritev.s b/libc/sysv/consts/__NR_pwritev.s
new file mode 100644
index 00000000..177f564a
--- /dev/null
+++ b/libc/sysv/consts/__NR_pwritev.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pwritev 0x0128 -1 0x0122 0x010c -1
diff --git a/libc/sysv/consts/__NR_pwritev2.s b/libc/sysv/consts/__NR_pwritev2.s
new file mode 100644
index 00000000..2c58e337
--- /dev/null
+++ b/libc/sysv/consts/__NR_pwritev2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_pwritev2 0x0148 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_quota.s b/libc/sysv/consts/__NR_quota.s
new file mode 100644
index 00000000..cef98042
--- /dev/null
+++ b/libc/sysv/consts/__NR_quota.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_quota -1 -1 0x0095 -1 -1
diff --git a/libc/sysv/consts/__NR_quotactl.s b/libc/sysv/consts/__NR_quotactl.s
new file mode 100644
index 00000000..06743bf2
--- /dev/null
+++ b/libc/sysv/consts/__NR_quotactl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_quotactl 0x00b3 0x20000a5 0x0094 0x0094 -1
diff --git a/libc/sysv/consts/__NR_rctl_add_rule.s b/libc/sysv/consts/__NR_rctl_add_rule.s
new file mode 100644
index 00000000..456058b7
--- /dev/null
+++ b/libc/sysv/consts/__NR_rctl_add_rule.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rctl_add_rule -1 -1 0x0210 -1 -1
diff --git a/libc/sysv/consts/__NR_rctl_get_limits.s b/libc/sysv/consts/__NR_rctl_get_limits.s
new file mode 100644
index 00000000..3ee6f343
--- /dev/null
+++ b/libc/sysv/consts/__NR_rctl_get_limits.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rctl_get_limits -1 -1 0x020f -1 -1
diff --git a/libc/sysv/consts/__NR_rctl_get_racct.s b/libc/sysv/consts/__NR_rctl_get_racct.s
new file mode 100644
index 00000000..d60d6790
--- /dev/null
+++ b/libc/sysv/consts/__NR_rctl_get_racct.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rctl_get_racct -1 -1 0x020d -1 -1
diff --git a/libc/sysv/consts/__NR_rctl_get_rules.s b/libc/sysv/consts/__NR_rctl_get_rules.s
new file mode 100644
index 00000000..ae81eaea
--- /dev/null
+++ b/libc/sysv/consts/__NR_rctl_get_rules.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rctl_get_rules -1 -1 0x020e -1 -1
diff --git a/libc/sysv/consts/__NR_rctl_remove_rule.s b/libc/sysv/consts/__NR_rctl_remove_rule.s
new file mode 100644
index 00000000..4b3ee3a7
--- /dev/null
+++ b/libc/sysv/consts/__NR_rctl_remove_rule.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rctl_remove_rule -1 -1 0x0211 -1 -1
diff --git a/libc/sysv/consts/__NR_read_nocancel.s b/libc/sysv/consts/__NR_read_nocancel.s
new file mode 100644
index 00000000..631186a6
--- /dev/null
+++ b/libc/sysv/consts/__NR_read_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_read_nocancel -1 0x200018c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_readahead.s b/libc/sysv/consts/__NR_readahead.s
new file mode 100644
index 00000000..aa8957aa
--- /dev/null
+++ b/libc/sysv/consts/__NR_readahead.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_readahead 0x00bb -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_readlink.s b/libc/sysv/consts/__NR_readlink.s
new file mode 100644
index 00000000..3beeb4c2
--- /dev/null
+++ b/libc/sysv/consts/__NR_readlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_readlink 0x0059 0x200003a 0x003a 0x003a -1
diff --git a/libc/sysv/consts/__NR_readlinkat.s b/libc/sysv/consts/__NR_readlinkat.s
new file mode 100644
index 00000000..b27a3f51
--- /dev/null
+++ b/libc/sysv/consts/__NR_readlinkat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_readlinkat 0x010b 0x20001d9 0x01f4 0x0142 -1
diff --git a/libc/sysv/consts/__NR_readv.s b/libc/sysv/consts/__NR_readv.s
new file mode 100644
index 00000000..bf59c2c6
--- /dev/null
+++ b/libc/sysv/consts/__NR_readv.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_readv 0x0013 0x2000078 0x0078 0x0078 -1
diff --git a/libc/sysv/consts/__NR_readv_nocancel.s b/libc/sysv/consts/__NR_readv_nocancel.s
new file mode 100644
index 00000000..79446870
--- /dev/null
+++ b/libc/sysv/consts/__NR_readv_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_readv_nocancel -1 0x200019b -1 -1 -1
diff --git a/libc/sysv/consts/__NR_reboot.s b/libc/sysv/consts/__NR_reboot.s
new file mode 100644
index 00000000..162a5654
--- /dev/null
+++ b/libc/sysv/consts/__NR_reboot.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_reboot 0x00a9 0x2000037 0x0037 0x0037 -1
diff --git a/libc/sysv/consts/__NR_recv.s b/libc/sysv/consts/__NR_recv.s
new file mode 100644
index 00000000..23f2945c
--- /dev/null
+++ b/libc/sysv/consts/__NR_recv.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recv -1 -1 0x0066 -1 -1
diff --git a/libc/sysv/consts/__NR_recvfrom.s b/libc/sysv/consts/__NR_recvfrom.s
new file mode 100644
index 00000000..7a33aac1
--- /dev/null
+++ b/libc/sysv/consts/__NR_recvfrom.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recvfrom 0x002d 0x200001d 0x001d 0x001d -1
diff --git a/libc/sysv/consts/__NR_recvfrom_nocancel.s b/libc/sysv/consts/__NR_recvfrom_nocancel.s
new file mode 100644
index 00000000..171dc6d3
--- /dev/null
+++ b/libc/sysv/consts/__NR_recvfrom_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recvfrom_nocancel -1 0x2000193 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_recvmmsg.s b/libc/sysv/consts/__NR_recvmmsg.s
new file mode 100644
index 00000000..e105aa3e
--- /dev/null
+++ b/libc/sysv/consts/__NR_recvmmsg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recvmmsg 0x012b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_recvmsg.s b/libc/sysv/consts/__NR_recvmsg.s
new file mode 100644
index 00000000..e874c078
--- /dev/null
+++ b/libc/sysv/consts/__NR_recvmsg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recvmsg 0x002f 0x200001b 0x001b 0x001b -1
diff --git a/libc/sysv/consts/__NR_recvmsg_nocancel.s b/libc/sysv/consts/__NR_recvmsg_nocancel.s
new file mode 100644
index 00000000..e4d2ff4e
--- /dev/null
+++ b/libc/sysv/consts/__NR_recvmsg_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recvmsg_nocancel -1 0x2000191 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_recvmsg_x.s b/libc/sysv/consts/__NR_recvmsg_x.s
new file mode 100644
index 00000000..476d206f
--- /dev/null
+++ b/libc/sysv/consts/__NR_recvmsg_x.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_recvmsg_x -1 0x20001e0 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_removexattr.s b/libc/sysv/consts/__NR_removexattr.s
new file mode 100644
index 00000000..c163a6ac
--- /dev/null
+++ b/libc/sysv/consts/__NR_removexattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_removexattr 0x00c5 0x20000ee -1 -1 -1
diff --git a/libc/sysv/consts/__NR_rename.s b/libc/sysv/consts/__NR_rename.s
new file mode 100644
index 00000000..bbcf6369
--- /dev/null
+++ b/libc/sysv/consts/__NR_rename.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rename 0x0052 0x2000080 0x0080 0x0080 -1
diff --git a/libc/sysv/consts/__NR_renameat.s b/libc/sysv/consts/__NR_renameat.s
new file mode 100644
index 00000000..a3efcb52
--- /dev/null
+++ b/libc/sysv/consts/__NR_renameat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_renameat 0x0108 0x20001d1 0x01f5 0x0143 -1
diff --git a/libc/sysv/consts/__NR_renameat2.s b/libc/sysv/consts/__NR_renameat2.s
new file mode 100644
index 00000000..dc8983ab
--- /dev/null
+++ b/libc/sysv/consts/__NR_renameat2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_renameat2 0x013c -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_renameatx_np.s b/libc/sysv/consts/__NR_renameatx_np.s
new file mode 100644
index 00000000..6d60bb19
--- /dev/null
+++ b/libc/sysv/consts/__NR_renameatx_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_renameatx_np -1 0x20001e8 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_request_key.s b/libc/sysv/consts/__NR_request_key.s
new file mode 100644
index 00000000..534fde61
--- /dev/null
+++ b/libc/sysv/consts/__NR_request_key.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_request_key 0x00f9 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_restart_syscall.s b/libc/sysv/consts/__NR_restart_syscall.s
new file mode 100644
index 00000000..12710b06
--- /dev/null
+++ b/libc/sysv/consts/__NR_restart_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_restart_syscall 0x00db -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_revoke.s b/libc/sysv/consts/__NR_revoke.s
new file mode 100644
index 00000000..0c7fe548
--- /dev/null
+++ b/libc/sysv/consts/__NR_revoke.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_revoke -1 0x2000038 0x0038 0x0038 -1
diff --git a/libc/sysv/consts/__NR_rfork.s b/libc/sysv/consts/__NR_rfork.s
new file mode 100644
index 00000000..265ed0ec
--- /dev/null
+++ b/libc/sysv/consts/__NR_rfork.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rfork -1 -1 0x00fb -1 -1
diff --git a/libc/sysv/consts/__NR_rmdir.s b/libc/sysv/consts/__NR_rmdir.s
new file mode 100644
index 00000000..6b298d39
--- /dev/null
+++ b/libc/sysv/consts/__NR_rmdir.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rmdir 0x0054 0x2000089 0x0089 0x0089 -1
diff --git a/libc/sysv/consts/__NR_rseq.s b/libc/sysv/consts/__NR_rseq.s
new file mode 100644
index 00000000..9750d15d
--- /dev/null
+++ b/libc/sysv/consts/__NR_rseq.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rseq 0x014e -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_rt_sigqueueinfo.s b/libc/sysv/consts/__NR_rt_sigqueueinfo.s
new file mode 100644
index 00000000..5cf6f53b
--- /dev/null
+++ b/libc/sysv/consts/__NR_rt_sigqueueinfo.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rt_sigqueueinfo 0x0081 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_rt_tgsigqueueinfo.s b/libc/sysv/consts/__NR_rt_tgsigqueueinfo.s
new file mode 100644
index 00000000..ffcedf1d
--- /dev/null
+++ b/libc/sysv/consts/__NR_rt_tgsigqueueinfo.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rt_tgsigqueueinfo 0x0129 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_rtprio.s b/libc/sysv/consts/__NR_rtprio.s
new file mode 100644
index 00000000..b510b7f3
--- /dev/null
+++ b/libc/sysv/consts/__NR_rtprio.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rtprio -1 -1 0x00a6 -1 -1
diff --git a/libc/sysv/consts/__NR_rtprio_thread.s b/libc/sysv/consts/__NR_rtprio_thread.s
new file mode 100644
index 00000000..e9238751
--- /dev/null
+++ b/libc/sysv/consts/__NR_rtprio_thread.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_rtprio_thread -1 -1 0x01d2 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_get_priority_max.s b/libc/sysv/consts/__NR_sched_get_priority_max.s
new file mode 100644
index 00000000..82849324
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_get_priority_max.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_get_priority_max 0x0092 -1 0x014c -1 -1
diff --git a/libc/sysv/consts/__NR_sched_get_priority_min.s b/libc/sysv/consts/__NR_sched_get_priority_min.s
new file mode 100644
index 00000000..213dc8f2
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_get_priority_min.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_get_priority_min 0x0093 -1 0x014d -1 -1
diff --git a/libc/sysv/consts/__NR_sched_getaffinity.s b/libc/sysv/consts/__NR_sched_getaffinity.s
new file mode 100644
index 00000000..ac41dedd
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_getaffinity.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_getaffinity 0x00cc -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_getattr.s b/libc/sysv/consts/__NR_sched_getattr.s
new file mode 100644
index 00000000..e7b40b85
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_getattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_getattr 0x013b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_getparam.s b/libc/sysv/consts/__NR_sched_getparam.s
new file mode 100644
index 00000000..d871e4b9
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_getparam.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_getparam 0x008f -1 0x0148 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_getscheduler.s b/libc/sysv/consts/__NR_sched_getscheduler.s
new file mode 100644
index 00000000..64202667
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_getscheduler.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_getscheduler 0x0091 -1 0x014a -1 -1
diff --git a/libc/sysv/consts/__NR_sched_rr_get_interval.s b/libc/sysv/consts/__NR_sched_rr_get_interval.s
new file mode 100644
index 00000000..0dd927d0
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_rr_get_interval.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_rr_get_interval 0x0094 -1 0x014e -1 -1
diff --git a/libc/sysv/consts/__NR_sched_setaffinity.s b/libc/sysv/consts/__NR_sched_setaffinity.s
new file mode 100644
index 00000000..d69ee012
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_setaffinity.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_setaffinity 0x00cb -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_setattr.s b/libc/sysv/consts/__NR_sched_setattr.s
new file mode 100644
index 00000000..bc22ad2e
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_setattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_setattr 0x013a -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_setparam.s b/libc/sysv/consts/__NR_sched_setparam.s
new file mode 100644
index 00000000..e74e870c
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_setparam.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_setparam 0x008e -1 0x0147 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_setscheduler.s b/libc/sysv/consts/__NR_sched_setscheduler.s
new file mode 100644
index 00000000..f473b92d
--- /dev/null
+++ b/libc/sysv/consts/__NR_sched_setscheduler.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sched_setscheduler 0x0090 -1 0x0149 -1 -1
diff --git a/libc/sysv/consts/__NR_sched_yield.s b/libc/sysv/consts/__NR_sched_yield.s
index 3075031a..6b81834b 100644
--- a/libc/sysv/consts/__NR_sched_yield.s
+++ b/libc/sysv/consts/__NR_sched_yield.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_sched_yield 0x0018 0x100003c 0x014b 0x012a -1
+.syscon nr __NR_sched_yield 0x0018 0x010003c 0x014b 0x012a -1
diff --git a/libc/sysv/consts/__NR_sctp_generic_recvmsg.s b/libc/sysv/consts/__NR_sctp_generic_recvmsg.s
new file mode 100644
index 00000000..cc1f71ec
--- /dev/null
+++ b/libc/sysv/consts/__NR_sctp_generic_recvmsg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sctp_generic_recvmsg -1 -1 0x01da -1 -1
diff --git a/libc/sysv/consts/__NR_sctp_generic_sendmsg.s b/libc/sysv/consts/__NR_sctp_generic_sendmsg.s
new file mode 100644
index 00000000..a531fc31
--- /dev/null
+++ b/libc/sysv/consts/__NR_sctp_generic_sendmsg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sctp_generic_sendmsg -1 -1 0x01d8 -1 -1
diff --git a/libc/sysv/consts/__NR_sctp_generic_sendmsg_iov.s b/libc/sysv/consts/__NR_sctp_generic_sendmsg_iov.s
new file mode 100644
index 00000000..7f54df38
--- /dev/null
+++ b/libc/sysv/consts/__NR_sctp_generic_sendmsg_iov.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sctp_generic_sendmsg_iov -1 -1 0x01d9 -1 -1
diff --git a/libc/sysv/consts/__NR_sctp_peeloff.s b/libc/sysv/consts/__NR_sctp_peeloff.s
new file mode 100644
index 00000000..11205618
--- /dev/null
+++ b/libc/sysv/consts/__NR_sctp_peeloff.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sctp_peeloff -1 -1 0x01d7 -1 -1
diff --git a/libc/sysv/consts/__NR_searchfs.s b/libc/sysv/consts/__NR_searchfs.s
new file mode 100644
index 00000000..5fbcf891
--- /dev/null
+++ b/libc/sysv/consts/__NR_searchfs.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_searchfs -1 0x20000e1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_seccomp.s b/libc/sysv/consts/__NR_seccomp.s
new file mode 100644
index 00000000..0cc51a76
--- /dev/null
+++ b/libc/sysv/consts/__NR_seccomp.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_seccomp 0x013d -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_select.s b/libc/sysv/consts/__NR_select.s
new file mode 100644
index 00000000..96addc25
--- /dev/null
+++ b/libc/sysv/consts/__NR_select.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_select 0x0017 0x200005d 0x005d 0x0047 -1
diff --git a/libc/sysv/consts/__NR_select_nocancel.s b/libc/sysv/consts/__NR_select_nocancel.s
new file mode 100644
index 00000000..a4de51b5
--- /dev/null
+++ b/libc/sysv/consts/__NR_select_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_select_nocancel -1 0x2000197 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_close.s b/libc/sysv/consts/__NR_sem_close.s
new file mode 100644
index 00000000..6af52c03
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_close.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_close -1 0x200010d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_open.s b/libc/sysv/consts/__NR_sem_open.s
new file mode 100644
index 00000000..9ad61c17
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_open -1 0x200010c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_post.s b/libc/sysv/consts/__NR_sem_post.s
new file mode 100644
index 00000000..fbf5bea7
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_post.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_post -1 0x2000111 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_trywait.s b/libc/sysv/consts/__NR_sem_trywait.s
new file mode 100644
index 00000000..10f394b1
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_trywait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_trywait -1 0x2000110 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_unlink.s b/libc/sysv/consts/__NR_sem_unlink.s
new file mode 100644
index 00000000..8fae6d6f
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_unlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_unlink -1 0x200010e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_wait.s b/libc/sysv/consts/__NR_sem_wait.s
new file mode 100644
index 00000000..088f93ba
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_wait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_wait -1 0x200010f -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sem_wait_nocancel.s b/libc/sysv/consts/__NR_sem_wait_nocancel.s
new file mode 100644
index 00000000..3205bcae
--- /dev/null
+++ b/libc/sysv/consts/__NR_sem_wait_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sem_wait_nocancel -1 0x20001a4 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_semctl.s b/libc/sysv/consts/__NR_semctl.s
new file mode 100644
index 00000000..f82dc062
--- /dev/null
+++ b/libc/sysv/consts/__NR_semctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semctl 0x0042 0x20000fe 0x01fe 0x0127 -1
diff --git a/libc/sysv/consts/__NR_semget.s b/libc/sysv/consts/__NR_semget.s
new file mode 100644
index 00000000..a43098db
--- /dev/null
+++ b/libc/sysv/consts/__NR_semget.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semget 0x0040 0x20000ff 0x00dd 0x00dd -1
diff --git a/libc/sysv/consts/__NR_semop.s b/libc/sysv/consts/__NR_semop.s
new file mode 100644
index 00000000..c5991f12
--- /dev/null
+++ b/libc/sysv/consts/__NR_semop.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semop 0x0041 0x2000100 0x00de 0x0122 -1
diff --git a/libc/sysv/consts/__NR_semsys.s b/libc/sysv/consts/__NR_semsys.s
new file mode 100644
index 00000000..f9f9d4a4
--- /dev/null
+++ b/libc/sysv/consts/__NR_semsys.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semsys -1 0x20000fb 0x00a9 -1 -1
diff --git a/libc/sysv/consts/__NR_semtimedop.s b/libc/sysv/consts/__NR_semtimedop.s
new file mode 100644
index 00000000..9e9a0af1
--- /dev/null
+++ b/libc/sysv/consts/__NR_semtimedop.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semtimedop 0x00dc -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_semwait_signal.s b/libc/sysv/consts/__NR_semwait_signal.s
new file mode 100644
index 00000000..bd63c1ad
--- /dev/null
+++ b/libc/sysv/consts/__NR_semwait_signal.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semwait_signal -1 0x200014e -1 -1 -1
diff --git a/libc/sysv/consts/__NR_semwait_signal_nocancel.s b/libc/sysv/consts/__NR_semwait_signal_nocancel.s
new file mode 100644
index 00000000..535654c4
--- /dev/null
+++ b/libc/sysv/consts/__NR_semwait_signal_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_semwait_signal_nocancel -1 0x20001a7 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_send.s b/libc/sysv/consts/__NR_send.s
new file mode 100644
index 00000000..362590fc
--- /dev/null
+++ b/libc/sysv/consts/__NR_send.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_send -1 -1 0x0065 -1 -1
diff --git a/libc/sysv/consts/__NR_sendfile.s b/libc/sysv/consts/__NR_sendfile.s
index fee67f0c..39c21949 100644
--- a/libc/sysv/consts/__NR_sendfile.s
+++ b/libc/sysv/consts/__NR_sendfile.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_sendfile 0x0028 0x2000151 0x0189 0xffff -1
+.syscon nr __NR_sendfile 0x0028 0x2000151 0x0189 -1 -1
diff --git a/libc/sysv/consts/__NR_sendmmsg.s b/libc/sysv/consts/__NR_sendmmsg.s
new file mode 100644
index 00000000..2acd021f
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendmmsg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendmmsg 0x0133 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sendmsg.s b/libc/sysv/consts/__NR_sendmsg.s
new file mode 100644
index 00000000..38812d71
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendmsg.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendmsg 0x002e 0x200001c 0x001c 0x001c -1
diff --git a/libc/sysv/consts/__NR_sendmsg_nocancel.s b/libc/sysv/consts/__NR_sendmsg_nocancel.s
new file mode 100644
index 00000000..28ef97e9
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendmsg_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendmsg_nocancel -1 0x2000192 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sendmsg_x.s b/libc/sysv/consts/__NR_sendmsg_x.s
new file mode 100644
index 00000000..5f587887
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendmsg_x.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendmsg_x -1 0x20001e1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sendsyslog.s b/libc/sysv/consts/__NR_sendsyslog.s
new file mode 100644
index 00000000..1639fa3c
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendsyslog.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendsyslog -1 -1 -1 0x0070 -1
diff --git a/libc/sysv/consts/__NR_sendto.s b/libc/sysv/consts/__NR_sendto.s
new file mode 100644
index 00000000..cb1d345a
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendto.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendto 0x002c 0x2000085 0x0085 0x0085 -1
diff --git a/libc/sysv/consts/__NR_sendto_nocancel.s b/libc/sysv/consts/__NR_sendto_nocancel.s
new file mode 100644
index 00000000..8189e10b
--- /dev/null
+++ b/libc/sysv/consts/__NR_sendto_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sendto_nocancel -1 0x200019d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_set_mempolicy.s b/libc/sysv/consts/__NR_set_mempolicy.s
new file mode 100644
index 00000000..f59973b8
--- /dev/null
+++ b/libc/sysv/consts/__NR_set_mempolicy.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_set_mempolicy 0x00ee -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_set_robust_list.s b/libc/sysv/consts/__NR_set_robust_list.s
new file mode 100644
index 00000000..d1137711
--- /dev/null
+++ b/libc/sysv/consts/__NR_set_robust_list.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_set_robust_list 0x0111 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_set_tcb.s b/libc/sysv/consts/__NR_set_tcb.s
new file mode 100644
index 00000000..dc0ef759
--- /dev/null
+++ b/libc/sysv/consts/__NR_set_tcb.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_set_tcb -1 -1 -1 0x0149 -1
diff --git a/libc/sysv/consts/__NR_set_tid_address.s b/libc/sysv/consts/__NR_set_tid_address.s
new file mode 100644
index 00000000..a3fee495
--- /dev/null
+++ b/libc/sysv/consts/__NR_set_tid_address.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_set_tid_address 0x00da -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setattrlist.s b/libc/sysv/consts/__NR_setattrlist.s
new file mode 100644
index 00000000..65476846
--- /dev/null
+++ b/libc/sysv/consts/__NR_setattrlist.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setattrlist -1 0x20000dd -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setattrlistat.s b/libc/sysv/consts/__NR_setattrlistat.s
new file mode 100644
index 00000000..11832c2c
--- /dev/null
+++ b/libc/sysv/consts/__NR_setattrlistat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setattrlistat -1 0x200020c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setaudit.s b/libc/sysv/consts/__NR_setaudit.s
new file mode 100644
index 00000000..58a68356
--- /dev/null
+++ b/libc/sysv/consts/__NR_setaudit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setaudit -1 -1 0x01c2 -1 -1
diff --git a/libc/sysv/consts/__NR_setaudit_addr.s b/libc/sysv/consts/__NR_setaudit_addr.s
new file mode 100644
index 00000000..03965cbd
--- /dev/null
+++ b/libc/sysv/consts/__NR_setaudit_addr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setaudit_addr -1 0x2000166 0x01c4 -1 -1
diff --git a/libc/sysv/consts/__NR_setauid.s b/libc/sysv/consts/__NR_setauid.s
new file mode 100644
index 00000000..e6c1977d
--- /dev/null
+++ b/libc/sysv/consts/__NR_setauid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setauid -1 0x2000162 0x01c0 -1 -1
diff --git a/libc/sysv/consts/__NR_setcontext.s b/libc/sysv/consts/__NR_setcontext.s
new file mode 100644
index 00000000..480fadf0
--- /dev/null
+++ b/libc/sysv/consts/__NR_setcontext.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setcontext -1 -1 0x01a6 -1 -1
diff --git a/libc/sysv/consts/__NR_setdomainname.s b/libc/sysv/consts/__NR_setdomainname.s
new file mode 100644
index 00000000..0b382a2e
--- /dev/null
+++ b/libc/sysv/consts/__NR_setdomainname.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setdomainname 0x00ab -1 0x00a3 -1 -1
diff --git a/libc/sysv/consts/__NR_setegid.s b/libc/sysv/consts/__NR_setegid.s
new file mode 100644
index 00000000..97f98e2d
--- /dev/null
+++ b/libc/sysv/consts/__NR_setegid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setegid -1 0x20000b6 0x00b6 0x00b6 -1
diff --git a/libc/sysv/consts/__NR_seteuid.s b/libc/sysv/consts/__NR_seteuid.s
new file mode 100644
index 00000000..27850b5a
--- /dev/null
+++ b/libc/sysv/consts/__NR_seteuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_seteuid -1 0x20000b7 0x00b7 0x00b7 -1
diff --git a/libc/sysv/consts/__NR_setfib.s b/libc/sysv/consts/__NR_setfib.s
new file mode 100644
index 00000000..02dc303d
--- /dev/null
+++ b/libc/sysv/consts/__NR_setfib.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setfib -1 -1 0x00af -1 -1
diff --git a/libc/sysv/consts/__NR_setfsgid.s b/libc/sysv/consts/__NR_setfsgid.s
new file mode 100644
index 00000000..3b9da89b
--- /dev/null
+++ b/libc/sysv/consts/__NR_setfsgid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setfsgid 0x007b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setfsuid.s b/libc/sysv/consts/__NR_setfsuid.s
new file mode 100644
index 00000000..cd1cae46
--- /dev/null
+++ b/libc/sysv/consts/__NR_setfsuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setfsuid 0x007a -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setgid.s b/libc/sysv/consts/__NR_setgid.s
new file mode 100644
index 00000000..621863c0
--- /dev/null
+++ b/libc/sysv/consts/__NR_setgid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setgid 0x006a 0x20000b5 0x00b5 0x00b5 -1
diff --git a/libc/sysv/consts/__NR_setgroups.s b/libc/sysv/consts/__NR_setgroups.s
new file mode 100644
index 00000000..8be364d0
--- /dev/null
+++ b/libc/sysv/consts/__NR_setgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setgroups 0x0074 0x2000050 0x0050 0x0050 -1
diff --git a/libc/sysv/consts/__NR_sethostid.s b/libc/sysv/consts/__NR_sethostid.s
new file mode 100644
index 00000000..9f629ba8
--- /dev/null
+++ b/libc/sysv/consts/__NR_sethostid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sethostid -1 -1 0x008f -1 -1
diff --git a/libc/sysv/consts/__NR_sethostname.s b/libc/sysv/consts/__NR_sethostname.s
new file mode 100644
index 00000000..886878bf
--- /dev/null
+++ b/libc/sysv/consts/__NR_sethostname.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sethostname 0x00aa -1 0x0058 -1 -1
diff --git a/libc/sysv/consts/__NR_setitimer.s b/libc/sysv/consts/__NR_setitimer.s
new file mode 100644
index 00000000..22c630f4
--- /dev/null
+++ b/libc/sysv/consts/__NR_setitimer.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setitimer 0x0026 0x2000053 0x0053 0x0045 -1
diff --git a/libc/sysv/consts/__NR_setlogin.s b/libc/sysv/consts/__NR_setlogin.s
new file mode 100644
index 00000000..804d8406
--- /dev/null
+++ b/libc/sysv/consts/__NR_setlogin.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setlogin -1 0x2000032 0x0032 0x0032 -1
diff --git a/libc/sysv/consts/__NR_setloginclass.s b/libc/sysv/consts/__NR_setloginclass.s
new file mode 100644
index 00000000..6f133cff
--- /dev/null
+++ b/libc/sysv/consts/__NR_setloginclass.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setloginclass -1 -1 0x020c -1 -1
diff --git a/libc/sysv/consts/__NR_setns.s b/libc/sysv/consts/__NR_setns.s
new file mode 100644
index 00000000..73afabba
--- /dev/null
+++ b/libc/sysv/consts/__NR_setns.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setns 0x0134 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setpgid.s b/libc/sysv/consts/__NR_setpgid.s
new file mode 100644
index 00000000..9bc3b885
--- /dev/null
+++ b/libc/sysv/consts/__NR_setpgid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setpgid 0x006d 0x2000052 0x0052 0x0052 -1
diff --git a/libc/sysv/consts/__NR_setpriority.s b/libc/sysv/consts/__NR_setpriority.s
new file mode 100644
index 00000000..88f15aae
--- /dev/null
+++ b/libc/sysv/consts/__NR_setpriority.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setpriority 0x008d 0x2000060 0x0060 0x0060 -1
diff --git a/libc/sysv/consts/__NR_setprivexec.s b/libc/sysv/consts/__NR_setprivexec.s
new file mode 100644
index 00000000..a52743ba
--- /dev/null
+++ b/libc/sysv/consts/__NR_setprivexec.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setprivexec -1 0x2000098 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setregid.s b/libc/sysv/consts/__NR_setregid.s
new file mode 100644
index 00000000..cd7ccf60
--- /dev/null
+++ b/libc/sysv/consts/__NR_setregid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setregid 0x0072 0x200007f 0x007f 0x007f -1
diff --git a/libc/sysv/consts/__NR_setresgid.s b/libc/sysv/consts/__NR_setresgid.s
new file mode 100644
index 00000000..16c00e0f
--- /dev/null
+++ b/libc/sysv/consts/__NR_setresgid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setresgid 0x0077 -1 0x0138 0x011c -1
diff --git a/libc/sysv/consts/__NR_setresuid.s b/libc/sysv/consts/__NR_setresuid.s
new file mode 100644
index 00000000..c169a02f
--- /dev/null
+++ b/libc/sysv/consts/__NR_setresuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setresuid 0x0075 -1 0x0137 0x011a -1
diff --git a/libc/sysv/consts/__NR_setreuid.s b/libc/sysv/consts/__NR_setreuid.s
new file mode 100644
index 00000000..c765f78d
--- /dev/null
+++ b/libc/sysv/consts/__NR_setreuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setreuid 0x0071 0x200007e 0x007e 0x007e -1
diff --git a/libc/sysv/consts/__NR_setrlimit.s b/libc/sysv/consts/__NR_setrlimit.s
new file mode 100644
index 00000000..5a3c3f57
--- /dev/null
+++ b/libc/sysv/consts/__NR_setrlimit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setrlimit 0x00a0 0x20000c3 0x00c3 0x00c3 -1
diff --git a/libc/sysv/consts/__NR_setrtable.s b/libc/sysv/consts/__NR_setrtable.s
new file mode 100644
index 00000000..259d2507
--- /dev/null
+++ b/libc/sysv/consts/__NR_setrtable.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setrtable -1 -1 -1 0x0136 -1
diff --git a/libc/sysv/consts/__NR_setsgroups.s b/libc/sysv/consts/__NR_setsgroups.s
new file mode 100644
index 00000000..b60f57ab
--- /dev/null
+++ b/libc/sysv/consts/__NR_setsgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setsgroups -1 0x200011f -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setsid.s b/libc/sysv/consts/__NR_setsid.s
new file mode 100644
index 00000000..d7bef176
--- /dev/null
+++ b/libc/sysv/consts/__NR_setsid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setsid 0x0070 0x2000093 0x0093 0x0093 -1
diff --git a/libc/sysv/consts/__NR_setsockopt.s b/libc/sysv/consts/__NR_setsockopt.s
new file mode 100644
index 00000000..95bd2bf7
--- /dev/null
+++ b/libc/sysv/consts/__NR_setsockopt.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setsockopt 0x0036 0x2000069 0x0069 0x0069 -1
diff --git a/libc/sysv/consts/__NR_settid.s b/libc/sysv/consts/__NR_settid.s
new file mode 100644
index 00000000..16d54938
--- /dev/null
+++ b/libc/sysv/consts/__NR_settid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_settid -1 0x200011d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_settid_with_pid.s b/libc/sysv/consts/__NR_settid_with_pid.s
new file mode 100644
index 00000000..73847f2b
--- /dev/null
+++ b/libc/sysv/consts/__NR_settid_with_pid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_settid_with_pid -1 0x2000137 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_settimeofday.s b/libc/sysv/consts/__NR_settimeofday.s
new file mode 100644
index 00000000..7a1bceee
--- /dev/null
+++ b/libc/sysv/consts/__NR_settimeofday.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_settimeofday 0x00a4 0x200007a 0x007a 0x0044 -1
diff --git a/libc/sysv/consts/__NR_setugid.s b/libc/sysv/consts/__NR_setugid.s
new file mode 100644
index 00000000..e0bac756
--- /dev/null
+++ b/libc/sysv/consts/__NR_setugid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setugid -1 -1 0x0176 -1 -1
diff --git a/libc/sysv/consts/__NR_setuid.s b/libc/sysv/consts/__NR_setuid.s
new file mode 100644
index 00000000..bad8bba4
--- /dev/null
+++ b/libc/sysv/consts/__NR_setuid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setuid 0x0069 0x2000017 0x0017 0x0017 -1
diff --git a/libc/sysv/consts/__NR_setwgroups.s b/libc/sysv/consts/__NR_setwgroups.s
new file mode 100644
index 00000000..ffa8239e
--- /dev/null
+++ b/libc/sysv/consts/__NR_setwgroups.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setwgroups -1 0x2000121 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_setxattr.s b/libc/sysv/consts/__NR_setxattr.s
new file mode 100644
index 00000000..33c25e55
--- /dev/null
+++ b/libc/sysv/consts/__NR_setxattr.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_setxattr 0x00bc 0x20000ec -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sfi_ctl.s b/libc/sysv/consts/__NR_sfi_ctl.s
new file mode 100644
index 00000000..ad4fb833
--- /dev/null
+++ b/libc/sysv/consts/__NR_sfi_ctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sfi_ctl -1 0x20001c8 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sfi_pidctl.s b/libc/sysv/consts/__NR_sfi_pidctl.s
new file mode 100644
index 00000000..96df07b7
--- /dev/null
+++ b/libc/sysv/consts/__NR_sfi_pidctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sfi_pidctl -1 0x20001c9 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_shared_region_check_np.s b/libc/sysv/consts/__NR_shared_region_check_np.s
new file mode 100644
index 00000000..5f28629b
--- /dev/null
+++ b/libc/sysv/consts/__NR_shared_region_check_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shared_region_check_np -1 0x2000126 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_shared_region_map_and_slide_np.s b/libc/sysv/consts/__NR_shared_region_map_and_slide_np.s
new file mode 100644
index 00000000..d7682bda
--- /dev/null
+++ b/libc/sysv/consts/__NR_shared_region_map_and_slide_np.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shared_region_map_and_slide_np -1 0x20001b6 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_shm_open.s b/libc/sysv/consts/__NR_shm_open.s
new file mode 100644
index 00000000..11ce10af
--- /dev/null
+++ b/libc/sysv/consts/__NR_shm_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shm_open -1 0x200010a 0x01e2 -1 -1
diff --git a/libc/sysv/consts/__NR_shm_unlink.s b/libc/sysv/consts/__NR_shm_unlink.s
new file mode 100644
index 00000000..4f2078ca
--- /dev/null
+++ b/libc/sysv/consts/__NR_shm_unlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shm_unlink -1 0x200010b 0x01e3 -1 -1
diff --git a/libc/sysv/consts/__NR_shmat.s b/libc/sysv/consts/__NR_shmat.s
new file mode 100644
index 00000000..18a323a6
--- /dev/null
+++ b/libc/sysv/consts/__NR_shmat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shmat 0x001e 0x2000106 0x00e4 0x00e4 -1
diff --git a/libc/sysv/consts/__NR_shmctl.s b/libc/sysv/consts/__NR_shmctl.s
new file mode 100644
index 00000000..673ba4de
--- /dev/null
+++ b/libc/sysv/consts/__NR_shmctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shmctl 0x001f 0x2000107 0x0200 0x0128 -1
diff --git a/libc/sysv/consts/__NR_shmdt.s b/libc/sysv/consts/__NR_shmdt.s
new file mode 100644
index 00000000..384030e2
--- /dev/null
+++ b/libc/sysv/consts/__NR_shmdt.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shmdt 0x0043 0x2000108 0x00e6 0x00e6 -1
diff --git a/libc/sysv/consts/__NR_shmget.s b/libc/sysv/consts/__NR_shmget.s
new file mode 100644
index 00000000..2322df70
--- /dev/null
+++ b/libc/sysv/consts/__NR_shmget.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shmget 0x001d 0x2000109 0x00e7 0x0121 -1
diff --git a/libc/sysv/consts/__NR_shmsys.s b/libc/sysv/consts/__NR_shmsys.s
new file mode 100644
index 00000000..711b2833
--- /dev/null
+++ b/libc/sysv/consts/__NR_shmsys.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shmsys -1 0x20000fd 0x00ab -1 -1
diff --git a/libc/sysv/consts/__NR_shutdown.s b/libc/sysv/consts/__NR_shutdown.s
new file mode 100644
index 00000000..ba38c52f
--- /dev/null
+++ b/libc/sysv/consts/__NR_shutdown.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_shutdown 0x0030 0x2000086 0x0086 0x0086 -1
diff --git a/libc/sysv/consts/__NR_sigaltstack.s b/libc/sysv/consts/__NR_sigaltstack.s
new file mode 100644
index 00000000..33bbca32
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigaltstack.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigaltstack 0x0083 0x2000035 0x0035 0x0120 -1
diff --git a/libc/sysv/consts/__NR_sigblock.s b/libc/sysv/consts/__NR_sigblock.s
new file mode 100644
index 00000000..ce1def2c
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigblock.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigblock -1 -1 0x006d -1 -1
diff --git a/libc/sysv/consts/__NR_signalfd.s b/libc/sysv/consts/__NR_signalfd.s
new file mode 100644
index 00000000..8f32201b
--- /dev/null
+++ b/libc/sysv/consts/__NR_signalfd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_signalfd 0x011a -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_signalfd4.s b/libc/sysv/consts/__NR_signalfd4.s
new file mode 100644
index 00000000..56c033ed
--- /dev/null
+++ b/libc/sysv/consts/__NR_signalfd4.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_signalfd4 0x0121 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sigpending.s b/libc/sysv/consts/__NR_sigpending.s
new file mode 100644
index 00000000..8137690b
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigpending.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigpending 0x007f 0x2000034 0x0034 0x0034 -1
diff --git a/libc/sysv/consts/__NR_sigqueue.s b/libc/sysv/consts/__NR_sigqueue.s
new file mode 100644
index 00000000..140df976
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigqueue.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigqueue -1 -1 0x01c8 -1 -1
diff --git a/libc/sysv/consts/__NR_sigsetmask.s b/libc/sysv/consts/__NR_sigsetmask.s
new file mode 100644
index 00000000..2dd6aa14
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigsetmask.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigsetmask -1 -1 0x006e -1 -1
diff --git a/libc/sysv/consts/__NR_sigstack.s b/libc/sysv/consts/__NR_sigstack.s
new file mode 100644
index 00000000..1800ca04
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigstack.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigstack -1 -1 0x0070 -1 -1
diff --git a/libc/sysv/consts/__NR_sigsuspend.s b/libc/sysv/consts/__NR_sigsuspend.s
new file mode 100644
index 00000000..2a2973d8
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigsuspend.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigsuspend 0x0082 0x200006f 0x0155 0x006f -1
diff --git a/libc/sysv/consts/__NR_sigsuspend_nocancel.s b/libc/sysv/consts/__NR_sigsuspend_nocancel.s
new file mode 100644
index 00000000..74e8c71f
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigsuspend_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigsuspend_nocancel -1 0x200019a -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sigtimedwait.s b/libc/sysv/consts/__NR_sigtimedwait.s
new file mode 100644
index 00000000..70d65915
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigtimedwait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigtimedwait 0x0080 -1 0x0159 -1 -1
diff --git a/libc/sysv/consts/__NR_sigvec.s b/libc/sysv/consts/__NR_sigvec.s
new file mode 100644
index 00000000..67a2642f
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigvec.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigvec -1 -1 0x006c -1 -1
diff --git a/libc/sysv/consts/__NR_sigwait.s b/libc/sysv/consts/__NR_sigwait.s
new file mode 100644
index 00000000..b31b1163
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigwait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigwait -1 0x200014a 0x01ad -1 -1
diff --git a/libc/sysv/consts/__NR_sigwait_nocancel.s b/libc/sysv/consts/__NR_sigwait_nocancel.s
new file mode 100644
index 00000000..a174fb5b
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigwait_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigwait_nocancel -1 0x20001a6 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sigwaitinfo.s b/libc/sysv/consts/__NR_sigwaitinfo.s
new file mode 100644
index 00000000..ef56103b
--- /dev/null
+++ b/libc/sysv/consts/__NR_sigwaitinfo.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sigwaitinfo -1 -1 0x015a -1 -1
diff --git a/libc/sysv/consts/__NR_socket.s b/libc/sysv/consts/__NR_socket.s
new file mode 100644
index 00000000..50e38a5a
--- /dev/null
+++ b/libc/sysv/consts/__NR_socket.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_socket 0x0029 0x2000061 0x0061 0x0061 -1
diff --git a/libc/sysv/consts/__NR_socket_delegate.s b/libc/sysv/consts/__NR_socket_delegate.s
new file mode 100644
index 00000000..e974e792
--- /dev/null
+++ b/libc/sysv/consts/__NR_socket_delegate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_socket_delegate -1 0x20001c2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_socketpair.s b/libc/sysv/consts/__NR_socketpair.s
new file mode 100644
index 00000000..315c4df7
--- /dev/null
+++ b/libc/sysv/consts/__NR_socketpair.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_socketpair 0x0035 0x2000087 0x0087 0x0087 -1
diff --git a/libc/sysv/consts/__NR_splice.s b/libc/sysv/consts/__NR_splice.s
new file mode 100644
index 00000000..cc0921da
--- /dev/null
+++ b/libc/sysv/consts/__NR_splice.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_splice 0x0113 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sstk.s b/libc/sysv/consts/__NR_sstk.s
new file mode 100644
index 00000000..598468a0
--- /dev/null
+++ b/libc/sysv/consts/__NR_sstk.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sstk -1 -1 0x0046 -1 -1
diff --git a/libc/sysv/consts/__NR_stack_snapshot_with_config.s b/libc/sysv/consts/__NR_stack_snapshot_with_config.s
new file mode 100644
index 00000000..18c3fdb5
--- /dev/null
+++ b/libc/sysv/consts/__NR_stack_snapshot_with_config.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_stack_snapshot_with_config -1 0x20001eb -1 -1 -1
diff --git a/libc/sysv/consts/__NR_stat.s b/libc/sysv/consts/__NR_stat.s
index 3830dd2b..4e525dbe 100644
--- a/libc/sysv/consts/__NR_stat.s
+++ b/libc/sysv/consts/__NR_stat.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_stat 0x0004 0x2000152 0x00bc 0x0026 -1
+.syscon nr __NR_stat 0x0004 0x2000152 -1 0x0026 -1
diff --git a/libc/sysv/consts/__NR_stat_extended.s b/libc/sysv/consts/__NR_stat_extended.s
new file mode 100644
index 00000000..261cfa34
--- /dev/null
+++ b/libc/sysv/consts/__NR_stat_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_stat_extended -1 0x2000155 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_statfs.s b/libc/sysv/consts/__NR_statfs.s
new file mode 100644
index 00000000..05fc279e
--- /dev/null
+++ b/libc/sysv/consts/__NR_statfs.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_statfs 0x0089 0x2000159 0x022b 0x003f -1
diff --git a/libc/sysv/consts/__NR_statx.s b/libc/sysv/consts/__NR_statx.s
new file mode 100644
index 00000000..08836ede
--- /dev/null
+++ b/libc/sysv/consts/__NR_statx.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_statx 0x014c -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_swapcontext.s b/libc/sysv/consts/__NR_swapcontext.s
new file mode 100644
index 00000000..71b278af
--- /dev/null
+++ b/libc/sysv/consts/__NR_swapcontext.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_swapcontext -1 -1 0x01a7 -1 -1
diff --git a/libc/sysv/consts/__NR_swapctl.s b/libc/sysv/consts/__NR_swapctl.s
new file mode 100644
index 00000000..a571684d
--- /dev/null
+++ b/libc/sysv/consts/__NR_swapctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_swapctl -1 -1 -1 0x00c1 -1
diff --git a/libc/sysv/consts/__NR_swapoff.s b/libc/sysv/consts/__NR_swapoff.s
new file mode 100644
index 00000000..87c8d3c2
--- /dev/null
+++ b/libc/sysv/consts/__NR_swapoff.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_swapoff 0x00a8 -1 0x01a8 -1 -1
diff --git a/libc/sysv/consts/__NR_swapon.s b/libc/sysv/consts/__NR_swapon.s
new file mode 100644
index 00000000..532a07f4
--- /dev/null
+++ b/libc/sysv/consts/__NR_swapon.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_swapon 0x00a7 0x2000055 0x0055 -1 -1
diff --git a/libc/sysv/consts/__NR_symlink.s b/libc/sysv/consts/__NR_symlink.s
new file mode 100644
index 00000000..c28c8152
--- /dev/null
+++ b/libc/sysv/consts/__NR_symlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_symlink 0x0058 0x2000039 0x0039 0x0039 -1
diff --git a/libc/sysv/consts/__NR_symlinkat.s b/libc/sysv/consts/__NR_symlinkat.s
new file mode 100644
index 00000000..c89be2f3
--- /dev/null
+++ b/libc/sysv/consts/__NR_symlinkat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_symlinkat 0x010a 0x20001da 0x01f6 0x0144 -1
diff --git a/libc/sysv/consts/__NR_sync.s b/libc/sysv/consts/__NR_sync.s
new file mode 100644
index 00000000..07ea4313
--- /dev/null
+++ b/libc/sysv/consts/__NR_sync.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sync 0x00a2 0x2000024 0x0024 0x0024 -1
diff --git a/libc/sysv/consts/__NR_sync_file_range.s b/libc/sysv/consts/__NR_sync_file_range.s
new file mode 100644
index 00000000..538d9728
--- /dev/null
+++ b/libc/sysv/consts/__NR_sync_file_range.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sync_file_range 0x0115 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_syncfs.s b/libc/sysv/consts/__NR_syncfs.s
new file mode 100644
index 00000000..d00413fa
--- /dev/null
+++ b/libc/sysv/consts/__NR_syncfs.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_syncfs 0x0132 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_syscall.s b/libc/sysv/consts/__NR_syscall.s
new file mode 100644
index 00000000..c353ee88
--- /dev/null
+++ b/libc/sysv/consts/__NR_syscall.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_syscall -1 -1 -1 0x00c6 -1
diff --git a/libc/sysv/consts/__NR_sysctl.s b/libc/sysv/consts/__NR_sysctl.s
new file mode 100644
index 00000000..6f22d085
--- /dev/null
+++ b/libc/sysv/consts/__NR_sysctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sysctl -1 0x20000ca -1 0x00ca -1
diff --git a/libc/sysv/consts/__NR_sysctlbyname.s b/libc/sysv/consts/__NR_sysctlbyname.s
new file mode 100644
index 00000000..d65e22fd
--- /dev/null
+++ b/libc/sysv/consts/__NR_sysctlbyname.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sysctlbyname -1 0x2000112 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sysfs.s b/libc/sysv/consts/__NR_sysfs.s
new file mode 100644
index 00000000..b53d00e9
--- /dev/null
+++ b/libc/sysv/consts/__NR_sysfs.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sysfs 0x008b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_sysinfo.s b/libc/sysv/consts/__NR_sysinfo.s
new file mode 100644
index 00000000..2a343fa1
--- /dev/null
+++ b/libc/sysv/consts/__NR_sysinfo.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_sysinfo 0x0063 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_syslog.s b/libc/sysv/consts/__NR_syslog.s
new file mode 100644
index 00000000..89bd05d7
--- /dev/null
+++ b/libc/sysv/consts/__NR_syslog.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_syslog 0x0067 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_system_override.s b/libc/sysv/consts/__NR_system_override.s
new file mode 100644
index 00000000..266e2d63
--- /dev/null
+++ b/libc/sysv/consts/__NR_system_override.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_system_override -1 0x20001c6 -1 -1 -1
diff --git a/libc/sysv/consts/PT_GETFPREGS.s b/libc/sysv/consts/__NR_tee.s
similarity index 50%
rename from libc/sysv/consts/PT_GETFPREGS.s
rename to libc/sysv/consts/__NR_tee.s
index 50611075..2addac4b 100644
--- a/libc/sysv/consts/PT_GETFPREGS.s
+++ b/libc/sysv/consts/__NR_tee.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon pt PT_GETFPREGS 14 0 35 35 0
+.syscon nr __NR_tee 0x0114 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_telemetry.s b/libc/sysv/consts/__NR_telemetry.s
new file mode 100644
index 00000000..9958ca6f
--- /dev/null
+++ b/libc/sysv/consts/__NR_telemetry.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_telemetry -1 0x20001c3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_terminate_with_payload.s b/libc/sysv/consts/__NR_terminate_with_payload.s
new file mode 100644
index 00000000..0ffd9f78
--- /dev/null
+++ b/libc/sysv/consts/__NR_terminate_with_payload.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_terminate_with_payload -1 0x2000208 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_tfork.s b/libc/sysv/consts/__NR_tfork.s
new file mode 100644
index 00000000..ca4480e6
--- /dev/null
+++ b/libc/sysv/consts/__NR_tfork.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_tfork -1 -1 -1 0x0008 -1
diff --git a/libc/sysv/consts/__NR_tgkill.s b/libc/sysv/consts/__NR_tgkill.s
new file mode 100644
index 00000000..921c89e6
--- /dev/null
+++ b/libc/sysv/consts/__NR_tgkill.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_tgkill 0x00ea -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_thr_create.s b/libc/sysv/consts/__NR_thr_create.s
new file mode 100644
index 00000000..4d269954
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_create -1 -1 0x01ae -1 -1
diff --git a/libc/sysv/consts/__NR_thr_exit.s b/libc/sysv/consts/__NR_thr_exit.s
new file mode 100644
index 00000000..458c9d81
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_exit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_exit -1 -1 0x01af -1 -1
diff --git a/libc/sysv/consts/__NR_thr_kill.s b/libc/sysv/consts/__NR_thr_kill.s
new file mode 100644
index 00000000..76789054
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_kill.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_kill -1 -1 0x01b1 -1 -1
diff --git a/libc/sysv/consts/__NR_thr_kill2.s b/libc/sysv/consts/__NR_thr_kill2.s
new file mode 100644
index 00000000..72024a1b
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_kill2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_kill2 -1 -1 0x01e1 -1 -1
diff --git a/libc/sysv/consts/__NR_thr_new.s b/libc/sysv/consts/__NR_thr_new.s
new file mode 100644
index 00000000..1230c90a
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_new.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_new -1 -1 0x01c7 -1 -1
diff --git a/libc/sysv/consts/__NR_thr_self.s b/libc/sysv/consts/__NR_thr_self.s
new file mode 100644
index 00000000..ccf2a64a
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_self.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_self -1 -1 0x01b0 -1 -1
diff --git a/libc/sysv/consts/__NR_thr_set_name.s b/libc/sysv/consts/__NR_thr_set_name.s
new file mode 100644
index 00000000..ce540d0e
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_set_name.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_set_name -1 -1 0x01d0 -1 -1
diff --git a/libc/sysv/consts/__NR_thr_suspend.s b/libc/sysv/consts/__NR_thr_suspend.s
new file mode 100644
index 00000000..d907222b
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_suspend.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_suspend -1 -1 0x01ba -1 -1
diff --git a/libc/sysv/consts/__NR_thr_wake.s b/libc/sysv/consts/__NR_thr_wake.s
new file mode 100644
index 00000000..938b0652
--- /dev/null
+++ b/libc/sysv/consts/__NR_thr_wake.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thr_wake -1 -1 0x01bb -1 -1
diff --git a/libc/sysv/consts/__NR_thread_selfcounts.s b/libc/sysv/consts/__NR_thread_selfcounts.s
new file mode 100644
index 00000000..61dafc2d
--- /dev/null
+++ b/libc/sysv/consts/__NR_thread_selfcounts.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thread_selfcounts -1 0x20000ba -1 -1 -1
diff --git a/libc/sysv/consts/__NR_thread_selfid.s b/libc/sysv/consts/__NR_thread_selfid.s
new file mode 100644
index 00000000..010374f1
--- /dev/null
+++ b/libc/sysv/consts/__NR_thread_selfid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thread_selfid -1 0x2000174 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_thread_selfusage.s b/libc/sysv/consts/__NR_thread_selfusage.s
new file mode 100644
index 00000000..a3c62939
--- /dev/null
+++ b/libc/sysv/consts/__NR_thread_selfusage.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thread_selfusage -1 0x20001e2 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_threxit.s b/libc/sysv/consts/__NR_threxit.s
new file mode 100644
index 00000000..f2d73f24
--- /dev/null
+++ b/libc/sysv/consts/__NR_threxit.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_threxit -1 -1 -1 0x012e -1
diff --git a/libc/sysv/consts/__NR_thrkill.s b/libc/sysv/consts/__NR_thrkill.s
new file mode 100644
index 00000000..80e45652
--- /dev/null
+++ b/libc/sysv/consts/__NR_thrkill.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thrkill -1 -1 -1 0x0077 -1
diff --git a/libc/sysv/consts/__NR_thrsigdivert.s b/libc/sysv/consts/__NR_thrsigdivert.s
new file mode 100644
index 00000000..ff2a8155
--- /dev/null
+++ b/libc/sysv/consts/__NR_thrsigdivert.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thrsigdivert -1 -1 -1 0x012f -1
diff --git a/libc/sysv/consts/__NR_thrsleep.s b/libc/sysv/consts/__NR_thrsleep.s
new file mode 100644
index 00000000..72e1921a
--- /dev/null
+++ b/libc/sysv/consts/__NR_thrsleep.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thrsleep -1 -1 -1 0x005e -1
diff --git a/libc/sysv/consts/__NR_thrwakeup.s b/libc/sysv/consts/__NR_thrwakeup.s
new file mode 100644
index 00000000..808aa106
--- /dev/null
+++ b/libc/sysv/consts/__NR_thrwakeup.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_thrwakeup -1 -1 -1 0x012d -1
diff --git a/libc/sysv/consts/__NR_timer_create.s b/libc/sysv/consts/__NR_timer_create.s
new file mode 100644
index 00000000..c5fe3908
--- /dev/null
+++ b/libc/sysv/consts/__NR_timer_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timer_create 0x00de -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timer_delete.s b/libc/sysv/consts/__NR_timer_delete.s
new file mode 100644
index 00000000..0b97fd79
--- /dev/null
+++ b/libc/sysv/consts/__NR_timer_delete.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timer_delete 0x00e2 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timer_getoverrun.s b/libc/sysv/consts/__NR_timer_getoverrun.s
new file mode 100644
index 00000000..54c4dbbb
--- /dev/null
+++ b/libc/sysv/consts/__NR_timer_getoverrun.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timer_getoverrun 0x00e1 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timer_gettime.s b/libc/sysv/consts/__NR_timer_gettime.s
new file mode 100644
index 00000000..7c958b42
--- /dev/null
+++ b/libc/sysv/consts/__NR_timer_gettime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timer_gettime 0x00e0 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timer_settime.s b/libc/sysv/consts/__NR_timer_settime.s
new file mode 100644
index 00000000..a56e55dd
--- /dev/null
+++ b/libc/sysv/consts/__NR_timer_settime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timer_settime 0x00df -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timerfd_create.s b/libc/sysv/consts/__NR_timerfd_create.s
new file mode 100644
index 00000000..cbf022a8
--- /dev/null
+++ b/libc/sysv/consts/__NR_timerfd_create.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timerfd_create 0x011b -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timerfd_gettime.s b/libc/sysv/consts/__NR_timerfd_gettime.s
new file mode 100644
index 00000000..27fc334e
--- /dev/null
+++ b/libc/sysv/consts/__NR_timerfd_gettime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timerfd_gettime 0x011f -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_timerfd_settime.s b/libc/sysv/consts/__NR_timerfd_settime.s
new file mode 100644
index 00000000..47480ef1
--- /dev/null
+++ b/libc/sysv/consts/__NR_timerfd_settime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_timerfd_settime 0x011e -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_times.s b/libc/sysv/consts/__NR_times.s
new file mode 100644
index 00000000..c32aa41b
--- /dev/null
+++ b/libc/sysv/consts/__NR_times.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_times 0x0064 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_tkill.s b/libc/sysv/consts/__NR_tkill.s
new file mode 100644
index 00000000..12d2d3a4
--- /dev/null
+++ b/libc/sysv/consts/__NR_tkill.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_tkill 0x00c8 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_truncate.s b/libc/sysv/consts/__NR_truncate.s
new file mode 100644
index 00000000..62e73f6f
--- /dev/null
+++ b/libc/sysv/consts/__NR_truncate.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_truncate 0x004c 0x20000c8 0x01df 0x00c8 -1
diff --git a/libc/sysv/consts/__NR_ulock_wait.s b/libc/sysv/consts/__NR_ulock_wait.s
new file mode 100644
index 00000000..b23d3ece
--- /dev/null
+++ b/libc/sysv/consts/__NR_ulock_wait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ulock_wait -1 0x2000203 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ulock_wake.s b/libc/sysv/consts/__NR_ulock_wake.s
new file mode 100644
index 00000000..b27df9af
--- /dev/null
+++ b/libc/sysv/consts/__NR_ulock_wake.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ulock_wake -1 0x2000204 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_umask.s b/libc/sysv/consts/__NR_umask.s
new file mode 100644
index 00000000..9e0500c0
--- /dev/null
+++ b/libc/sysv/consts/__NR_umask.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_umask 0x005f 0x200003c 0x003c 0x003c -1
diff --git a/libc/sysv/consts/__NR_umask_extended.s b/libc/sysv/consts/__NR_umask_extended.s
new file mode 100644
index 00000000..d97b4a3d
--- /dev/null
+++ b/libc/sysv/consts/__NR_umask_extended.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_umask_extended -1 0x2000116 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_umount2.s b/libc/sysv/consts/__NR_umount2.s
new file mode 100644
index 00000000..f64da5ce
--- /dev/null
+++ b/libc/sysv/consts/__NR_umount2.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_umount2 0x00a6 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_uname.s b/libc/sysv/consts/__NR_uname.s
new file mode 100644
index 00000000..c44c5ffe
--- /dev/null
+++ b/libc/sysv/consts/__NR_uname.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_uname 0x003f -1 0x00a4 -1 -1
diff --git a/libc/sysv/consts/__NR_undelete.s b/libc/sysv/consts/__NR_undelete.s
new file mode 100644
index 00000000..fc9ec501
--- /dev/null
+++ b/libc/sysv/consts/__NR_undelete.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_undelete -1 0x20000cd 0x00cd -1 -1
diff --git a/libc/sysv/consts/__NR_unlink.s b/libc/sysv/consts/__NR_unlink.s
new file mode 100644
index 00000000..7f118dc3
--- /dev/null
+++ b/libc/sysv/consts/__NR_unlink.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_unlink 0x0057 0x200000a 0x000a 0x000a -1
diff --git a/libc/sysv/consts/__NR_unlinkat.s b/libc/sysv/consts/__NR_unlinkat.s
new file mode 100644
index 00000000..7ed5cef4
--- /dev/null
+++ b/libc/sysv/consts/__NR_unlinkat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_unlinkat 0x0107 0x20001d8 0x01f7 0x0145 -1
diff --git a/libc/sysv/consts/__NR_unmount.s b/libc/sysv/consts/__NR_unmount.s
new file mode 100644
index 00000000..f3b69802
--- /dev/null
+++ b/libc/sysv/consts/__NR_unmount.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_unmount -1 0x200009f 0x0016 0x0016 -1
diff --git a/libc/sysv/consts/__NR_unshare.s b/libc/sysv/consts/__NR_unshare.s
new file mode 100644
index 00000000..2d80fde0
--- /dev/null
+++ b/libc/sysv/consts/__NR_unshare.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_unshare 0x0110 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_unveil.s b/libc/sysv/consts/__NR_unveil.s
new file mode 100644
index 00000000..1d04a63f
--- /dev/null
+++ b/libc/sysv/consts/__NR_unveil.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_unveil -1 -1 -1 0x0072 -1
diff --git a/libc/sysv/consts/__NR_userfaultfd.s b/libc/sysv/consts/__NR_userfaultfd.s
new file mode 100644
index 00000000..c1515295
--- /dev/null
+++ b/libc/sysv/consts/__NR_userfaultfd.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_userfaultfd 0x0143 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_usrctl.s b/libc/sysv/consts/__NR_usrctl.s
new file mode 100644
index 00000000..bd1e0421
--- /dev/null
+++ b/libc/sysv/consts/__NR_usrctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_usrctl -1 0x20001bd -1 -1 -1
diff --git a/libc/sysv/consts/__NR_ustat.s b/libc/sysv/consts/__NR_ustat.s
new file mode 100644
index 00000000..5712d3cf
--- /dev/null
+++ b/libc/sysv/consts/__NR_ustat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_ustat 0x0088 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_utime.s b/libc/sysv/consts/__NR_utime.s
new file mode 100644
index 00000000..aeb47f5a
--- /dev/null
+++ b/libc/sysv/consts/__NR_utime.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_utime 0x0084 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_utimensat.s b/libc/sysv/consts/__NR_utimensat.s
new file mode 100644
index 00000000..06188bed
--- /dev/null
+++ b/libc/sysv/consts/__NR_utimensat.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_utimensat 0x0118 -1 0x0223 0x0054 -1
diff --git a/libc/sysv/consts/__NR_utimes.s b/libc/sysv/consts/__NR_utimes.s
new file mode 100644
index 00000000..283d88b0
--- /dev/null
+++ b/libc/sysv/consts/__NR_utimes.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_utimes 0x00eb 0x200008a 0x008a 0x004c -1
diff --git a/libc/sysv/consts/__NR_utrace.s b/libc/sysv/consts/__NR_utrace.s
new file mode 100644
index 00000000..abbdaf2e
--- /dev/null
+++ b/libc/sysv/consts/__NR_utrace.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_utrace -1 -1 0x014f 0x00d1 -1
diff --git a/libc/sysv/consts/__NR_uuidgen.s b/libc/sysv/consts/__NR_uuidgen.s
new file mode 100644
index 00000000..663c165e
--- /dev/null
+++ b/libc/sysv/consts/__NR_uuidgen.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_uuidgen -1 -1 0x0188 -1 -1
diff --git a/libc/sysv/consts/__NR_vadvise.s b/libc/sysv/consts/__NR_vadvise.s
new file mode 100644
index 00000000..c1f35c66
--- /dev/null
+++ b/libc/sysv/consts/__NR_vadvise.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_vadvise -1 -1 0x0048 -1 -1
diff --git a/libc/sysv/consts/__NR_vfs_purge.s b/libc/sysv/consts/__NR_vfs_purge.s
new file mode 100644
index 00000000..e8a849d0
--- /dev/null
+++ b/libc/sysv/consts/__NR_vfs_purge.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_vfs_purge -1 0x20001c7 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_vhangup.s b/libc/sysv/consts/__NR_vhangup.s
new file mode 100644
index 00000000..87f39043
--- /dev/null
+++ b/libc/sysv/consts/__NR_vhangup.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_vhangup 0x0099 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_vm_pressure_monitor.s b/libc/sysv/consts/__NR_vm_pressure_monitor.s
new file mode 100644
index 00000000..30f651c0
--- /dev/null
+++ b/libc/sysv/consts/__NR_vm_pressure_monitor.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_vm_pressure_monitor -1 0x2000128 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_vmsplice.s b/libc/sysv/consts/__NR_vmsplice.s
new file mode 100644
index 00000000..c21d55e1
--- /dev/null
+++ b/libc/sysv/consts/__NR_vmsplice.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_vmsplice 0x0116 -1 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_wait.s b/libc/sysv/consts/__NR_wait.s
new file mode 100644
index 00000000..c1c2eac4
--- /dev/null
+++ b/libc/sysv/consts/__NR_wait.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_wait -1 -1 0x0054 -1 -1
diff --git a/libc/sysv/consts/__NR_wait4.s b/libc/sysv/consts/__NR_wait4.s
index 3d233242..9819ea0e 100644
--- a/libc/sysv/consts/__NR_wait4.s
+++ b/libc/sysv/consts/__NR_wait4.s
@@ -1,2 +1,2 @@
.include "libc/sysv/consts/syscon.inc"
-.syscon nr __NR_wait4 0x003d 0x1000007 0x0007 0x000b -1
+.syscon nr __NR_wait4 0x003d 0x2000007 0x0007 0x000b -1
diff --git a/libc/sysv/consts/__NR_wait4_nocancel.s b/libc/sysv/consts/__NR_wait4_nocancel.s
new file mode 100644
index 00000000..a06f0179
--- /dev/null
+++ b/libc/sysv/consts/__NR_wait4_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_wait4_nocancel -1 0x2000190 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_wait6.s b/libc/sysv/consts/__NR_wait6.s
new file mode 100644
index 00000000..e1494a1d
--- /dev/null
+++ b/libc/sysv/consts/__NR_wait6.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_wait6 -1 -1 0x0214 -1 -1
diff --git a/libc/sysv/consts/__NR_waitevent.s b/libc/sysv/consts/__NR_waitevent.s
new file mode 100644
index 00000000..0b9b42dd
--- /dev/null
+++ b/libc/sysv/consts/__NR_waitevent.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_waitevent -1 0x20000e8 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_waitid.s b/libc/sysv/consts/__NR_waitid.s
new file mode 100644
index 00000000..ea372680
--- /dev/null
+++ b/libc/sysv/consts/__NR_waitid.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_waitid 0x00f7 0x20000ad -1 -1 -1
diff --git a/libc/sysv/consts/__NR_waitid_nocancel.s b/libc/sysv/consts/__NR_waitid_nocancel.s
new file mode 100644
index 00000000..04709465
--- /dev/null
+++ b/libc/sysv/consts/__NR_waitid_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_waitid_nocancel -1 0x20001a0 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_watchevent.s b/libc/sysv/consts/__NR_watchevent.s
new file mode 100644
index 00000000..3f7656f5
--- /dev/null
+++ b/libc/sysv/consts/__NR_watchevent.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_watchevent -1 0x20000e7 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_work_interval_ctl.s b/libc/sysv/consts/__NR_work_interval_ctl.s
new file mode 100644
index 00000000..5402d54a
--- /dev/null
+++ b/libc/sysv/consts/__NR_work_interval_ctl.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_work_interval_ctl -1 0x20001f3 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_workq_kernreturn.s b/libc/sysv/consts/__NR_workq_kernreturn.s
new file mode 100644
index 00000000..21e6a233
--- /dev/null
+++ b/libc/sysv/consts/__NR_workq_kernreturn.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_workq_kernreturn -1 0x2000170 -1 -1 -1
diff --git a/libc/sysv/consts/__NR_workq_open.s b/libc/sysv/consts/__NR_workq_open.s
new file mode 100644
index 00000000..1cdcfce0
--- /dev/null
+++ b/libc/sysv/consts/__NR_workq_open.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_workq_open -1 0x200016f -1 -1 -1
diff --git a/libc/sysv/consts/__NR_write_nocancel.s b/libc/sysv/consts/__NR_write_nocancel.s
new file mode 100644
index 00000000..68113241
--- /dev/null
+++ b/libc/sysv/consts/__NR_write_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_write_nocancel -1 0x200018d -1 -1 -1
diff --git a/libc/sysv/consts/__NR_writev.s b/libc/sysv/consts/__NR_writev.s
new file mode 100644
index 00000000..33012329
--- /dev/null
+++ b/libc/sysv/consts/__NR_writev.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_writev 0x0014 0x2000079 0x0079 0x0079 -1
diff --git a/libc/sysv/consts/__NR_writev_nocancel.s b/libc/sysv/consts/__NR_writev_nocancel.s
new file mode 100644
index 00000000..df882b0d
--- /dev/null
+++ b/libc/sysv/consts/__NR_writev_nocancel.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_writev_nocancel -1 0x200019c -1 -1 -1
diff --git a/libc/sysv/consts/__NR_yield.s b/libc/sysv/consts/__NR_yield.s
new file mode 100644
index 00000000..b25899a0
--- /dev/null
+++ b/libc/sysv/consts/__NR_yield.s
@@ -0,0 +1,2 @@
+.include "libc/sysv/consts/syscon.inc"
+.syscon nr __NR_yield -1 -1 0x0141 -1 -1
diff --git a/libc/sysv/consts/nr.h b/libc/sysv/consts/nr.h
index 2c3a196f..c2c486e4 100644
--- a/libc/sysv/consts/nr.h
+++ b/libc/sysv/consts/nr.h
@@ -1,68 +1,1546 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_NR_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_NR_H_
#include "libc/runtime/symbolic.h"
+
+#define __NR_exit SYMBOLIC(__NR_exit)
+#define __NR_exit_group SYMBOLIC(__NR_exit_group)
+#define __NR_read SYMBOLIC(__NR_read)
+#define __NR_write SYMBOLIC(__NR_write)
+#define __NR_open SYMBOLIC(__NR_open)
+#define __NR_close SYMBOLIC(__NR_close)
+#define __NR_stat SYMBOLIC(__NR_stat)
+#define __NR_fstat SYMBOLIC(__NR_fstat)
+#define __NR_lstat SYMBOLIC(__NR_lstat)
+#define __NR_poll SYMBOLIC(__NR_poll)
+#define __NR_ppoll SYMBOLIC(__NR_ppoll)
+#define __NR_lseek SYMBOLIC(__NR_lseek)
+#define __NR_mmap SYMBOLIC(__NR_mmap)
+#define __NR_msync SYMBOLIC(__NR_msync)
+#define __NR_mprotect SYMBOLIC(__NR_mprotect)
+#define __NR_munmap SYMBOLIC(__NR_munmap)
+#define __NR_sigaction SYMBOLIC(__NR_sigaction)
+#define __NR_sigprocmask SYMBOLIC(__NR_sigprocmask)
+#define __NR_ioctl SYMBOLIC(__NR_ioctl)
+#define __NR_pread SYMBOLIC(__NR_pread)
+#define __NR_pwrite SYMBOLIC(__NR_pwrite)
+#define __NR_readv SYMBOLIC(__NR_readv)
+#define __NR_writev SYMBOLIC(__NR_writev)
+#define __NR_access SYMBOLIC(__NR_access)
+#define __NR_pipe SYMBOLIC(__NR_pipe)
+#define __NR_select SYMBOLIC(__NR_select)
+#define __NR_pselect SYMBOLIC(__NR_pselect)
+#define __NR_pselect6 SYMBOLIC(__NR_pselect6)
+#define __NR_sched_yield SYMBOLIC(__NR_sched_yield)
+#define __NR_mremap SYMBOLIC(__NR_mremap)
+#define __NR_mincore SYMBOLIC(__NR_mincore)
+#define __NR_madvise SYMBOLIC(__NR_madvise)
+#define __NR_shmget SYMBOLIC(__NR_shmget)
+#define __NR_shmat SYMBOLIC(__NR_shmat)
+#define __NR_shmctl SYMBOLIC(__NR_shmctl)
+#define __NR_dup SYMBOLIC(__NR_dup)
+#define __NR_dup2 SYMBOLIC(__NR_dup2)
+#define __NR_pause SYMBOLIC(__NR_pause)
+#define __NR_nanosleep SYMBOLIC(__NR_nanosleep)
+#define __NR_getitimer SYMBOLIC(__NR_getitimer)
+#define __NR_setitimer SYMBOLIC(__NR_setitimer)
+#define __NR_alarm SYMBOLIC(__NR_alarm)
+#define __NR_getpid SYMBOLIC(__NR_getpid)
+#define __NR_sendfile SYMBOLIC(__NR_sendfile)
+#define __NR_socket SYMBOLIC(__NR_socket)
+#define __NR_connect SYMBOLIC(__NR_connect)
+#define __NR_accept SYMBOLIC(__NR_accept)
+#define __NR_sendto SYMBOLIC(__NR_sendto)
+#define __NR_recvfrom SYMBOLIC(__NR_recvfrom)
+#define __NR_sendmsg SYMBOLIC(__NR_sendmsg)
+#define __NR_recvmsg SYMBOLIC(__NR_recvmsg)
+#define __NR_shutdown SYMBOLIC(__NR_shutdown)
+#define __NR_bind SYMBOLIC(__NR_bind)
+#define __NR_listen SYMBOLIC(__NR_listen)
+#define __NR_getsockname SYMBOLIC(__NR_getsockname)
+#define __NR_getpeername SYMBOLIC(__NR_getpeername)
+#define __NR_socketpair SYMBOLIC(__NR_socketpair)
+#define __NR_setsockopt SYMBOLIC(__NR_setsockopt)
+#define __NR_getsockopt SYMBOLIC(__NR_getsockopt)
+#define __NR_fork SYMBOLIC(__NR_fork)
+#define __NR_vfork SYMBOLIC(__NR_vfork)
+#define __NR_posix_spawn SYMBOLIC(__NR_posix_spawn)
+#define __NR_execve SYMBOLIC(__NR_execve)
+#define __NR_wait4 SYMBOLIC(__NR_wait4)
+#define __NR_kill SYMBOLIC(__NR_kill)
+#define __NR_killpg SYMBOLIC(__NR_killpg)
+#define __NR_clone SYMBOLIC(__NR_clone)
+#define __NR_tkill SYMBOLIC(__NR_tkill)
+#define __NR_futex SYMBOLIC(__NR_futex)
+#define __NR_set_robust_list SYMBOLIC(__NR_set_robust_list)
+#define __NR_get_robust_list SYMBOLIC(__NR_get_robust_list)
+#define __NR_uname SYMBOLIC(__NR_uname)
+#define __NR_semget SYMBOLIC(__NR_semget)
+#define __NR_semop SYMBOLIC(__NR_semop)
+#define __NR_semctl SYMBOLIC(__NR_semctl)
+#define __NR_shmdt SYMBOLIC(__NR_shmdt)
+#define __NR_msgget SYMBOLIC(__NR_msgget)
+#define __NR_msgsnd SYMBOLIC(__NR_msgsnd)
+#define __NR_msgrcv SYMBOLIC(__NR_msgrcv)
+#define __NR_msgctl SYMBOLIC(__NR_msgctl)
+#define __NR_fcntl SYMBOLIC(__NR_fcntl)
+#define __NR_flock SYMBOLIC(__NR_flock)
+#define __NR_fsync SYMBOLIC(__NR_fsync)
+#define __NR_fdatasync SYMBOLIC(__NR_fdatasync)
+#define __NR_truncate SYMBOLIC(__NR_truncate)
+#define __NR_ftruncate SYMBOLIC(__NR_ftruncate)
+#define __NR_getcwd SYMBOLIC(__NR_getcwd)
+#define __NR_chdir SYMBOLIC(__NR_chdir)
+#define __NR_fchdir SYMBOLIC(__NR_fchdir)
+#define __NR_rename SYMBOLIC(__NR_rename)
+#define __NR_mkdir SYMBOLIC(__NR_mkdir)
+#define __NR_rmdir SYMBOLIC(__NR_rmdir)
+#define __NR_creat SYMBOLIC(__NR_creat)
+#define __NR_link SYMBOLIC(__NR_link)
+#define __NR_unlink SYMBOLIC(__NR_unlink)
+#define __NR_symlink SYMBOLIC(__NR_symlink)
+#define __NR_readlink SYMBOLIC(__NR_readlink)
+#define __NR_chmod SYMBOLIC(__NR_chmod)
+#define __NR_fchmod SYMBOLIC(__NR_fchmod)
+#define __NR_chown SYMBOLIC(__NR_chown)
+#define __NR_fchown SYMBOLIC(__NR_fchown)
+#define __NR_lchown SYMBOLIC(__NR_lchown)
+#define __NR_umask SYMBOLIC(__NR_umask)
+#define __NR_gettimeofday SYMBOLIC(__NR_gettimeofday)
+#define __NR_getrlimit SYMBOLIC(__NR_getrlimit)
+#define __NR_getrusage SYMBOLIC(__NR_getrusage)
+#define __NR_sysinfo SYMBOLIC(__NR_sysinfo)
+#define __NR_times SYMBOLIC(__NR_times)
+#define __NR_ptrace SYMBOLIC(__NR_ptrace)
+#define __NR_syslog SYMBOLIC(__NR_syslog)
+#define __NR_getuid SYMBOLIC(__NR_getuid)
+#define __NR_getgid SYMBOLIC(__NR_getgid)
+#define __NR_getppid SYMBOLIC(__NR_getppid)
+#define __NR_getpgrp SYMBOLIC(__NR_getpgrp)
+#define __NR_setsid SYMBOLIC(__NR_setsid)
+#define __NR_getsid SYMBOLIC(__NR_getsid)
+#define __NR_getpgid SYMBOLIC(__NR_getpgid)
+#define __NR_setpgid SYMBOLIC(__NR_setpgid)
+#define __NR_geteuid SYMBOLIC(__NR_geteuid)
+#define __NR_getegid SYMBOLIC(__NR_getegid)
+#define __NR_getgroups SYMBOLIC(__NR_getgroups)
+#define __NR_setgroups SYMBOLIC(__NR_setgroups)
+#define __NR_setreuid SYMBOLIC(__NR_setreuid)
+#define __NR_setregid SYMBOLIC(__NR_setregid)
+#define __NR_setuid SYMBOLIC(__NR_setuid)
+#define __NR_setgid SYMBOLIC(__NR_setgid)
+#define __NR_setresuid SYMBOLIC(__NR_setresuid)
+#define __NR_setresgid SYMBOLIC(__NR_setresgid)
+#define __NR_getresuid SYMBOLIC(__NR_getresuid)
+#define __NR_getresgid SYMBOLIC(__NR_getresgid)
+#define __NR_sigpending SYMBOLIC(__NR_sigpending)
+#define __NR_sigsuspend SYMBOLIC(__NR_sigsuspend)
+#define __NR_sigaltstack SYMBOLIC(__NR_sigaltstack)
+#define __NR_mknod SYMBOLIC(__NR_mknod)
+#define __NR_mknodat SYMBOLIC(__NR_mknodat)
+#define __NR_mkfifo SYMBOLIC(__NR_mkfifo)
+#define __NR_mkfifoat SYMBOLIC(__NR_mkfifoat)
+#define __NR_statfs SYMBOLIC(__NR_statfs)
+#define __NR_fstatfs SYMBOLIC(__NR_fstatfs)
+#define __NR_getpriority SYMBOLIC(__NR_getpriority)
+#define __NR_setpriority SYMBOLIC(__NR_setpriority)
+#define __NR_mlock SYMBOLIC(__NR_mlock)
+#define __NR_munlock SYMBOLIC(__NR_munlock)
+#define __NR_mlockall SYMBOLIC(__NR_mlockall)
+#define __NR_munlockall SYMBOLIC(__NR_munlockall)
+#define __NR_setrlimit SYMBOLIC(__NR_setrlimit)
+#define __NR_chroot SYMBOLIC(__NR_chroot)
+#define __NR_sync SYMBOLIC(__NR_sync)
+#define __NR_acct SYMBOLIC(__NR_acct)
+#define __NR_settimeofday SYMBOLIC(__NR_settimeofday)
+#define __NR_mount SYMBOLIC(__NR_mount)
+#define __NR_reboot SYMBOLIC(__NR_reboot)
+#define __NR_quotactl SYMBOLIC(__NR_quotactl)
+#define __NR_setfsuid SYMBOLIC(__NR_setfsuid)
+#define __NR_setfsgid SYMBOLIC(__NR_setfsgid)
+#define __NR_capget SYMBOLIC(__NR_capget)
+#define __NR_capset SYMBOLIC(__NR_capset)
+#define __NR_sigtimedwait SYMBOLIC(__NR_sigtimedwait)
+#define __NR_rt_sigqueueinfo SYMBOLIC(__NR_rt_sigqueueinfo)
+#define __NR_personality SYMBOLIC(__NR_personality)
+#define __NR_ustat SYMBOLIC(__NR_ustat)
+#define __NR_sysfs SYMBOLIC(__NR_sysfs)
+#define __NR_sched_setparam SYMBOLIC(__NR_sched_setparam)
+#define __NR_sched_getparam SYMBOLIC(__NR_sched_getparam)
+#define __NR_sched_setscheduler SYMBOLIC(__NR_sched_setscheduler)
+#define __NR_sched_getscheduler SYMBOLIC(__NR_sched_getscheduler)
+#define __NR_sched_get_priority_max SYMBOLIC(__NR_sched_get_priority_max)
+#define __NR_sched_get_priority_min SYMBOLIC(__NR_sched_get_priority_min)
+#define __NR_sched_rr_get_interval SYMBOLIC(__NR_sched_rr_get_interval)
+#define __NR_vhangup SYMBOLIC(__NR_vhangup)
+#define __NR_modify_ldt SYMBOLIC(__NR_modify_ldt)
+#define __NR_pivot_root SYMBOLIC(__NR_pivot_root)
+#define __NR__sysctl SYMBOLIC(__NR__sysctl)
+#define __NR_prctl SYMBOLIC(__NR_prctl)
+#define __NR_arch_prctl SYMBOLIC(__NR_arch_prctl)
+#define __NR_adjtimex SYMBOLIC(__NR_adjtimex)
+#define __NR_umount2 SYMBOLIC(__NR_umount2)
+#define __NR_swapon SYMBOLIC(__NR_swapon)
+#define __NR_swapoff SYMBOLIC(__NR_swapoff)
+#define __NR_sethostname SYMBOLIC(__NR_sethostname)
+#define __NR_setdomainname SYMBOLIC(__NR_setdomainname)
+#define __NR_iopl SYMBOLIC(__NR_iopl)
+#define __NR_ioperm SYMBOLIC(__NR_ioperm)
+#define __NR_init_module SYMBOLIC(__NR_init_module)
+#define __NR_delete_module SYMBOLIC(__NR_delete_module)
+#define __NR_gettid SYMBOLIC(__NR_gettid)
+#define __NR_readahead SYMBOLIC(__NR_readahead)
+#define __NR_setxattr SYMBOLIC(__NR_setxattr)
+#define __NR_fsetxattr SYMBOLIC(__NR_fsetxattr)
+#define __NR_getxattr SYMBOLIC(__NR_getxattr)
+#define __NR_fgetxattr SYMBOLIC(__NR_fgetxattr)
+#define __NR_listxattr SYMBOLIC(__NR_listxattr)
+#define __NR_flistxattr SYMBOLIC(__NR_flistxattr)
+#define __NR_removexattr SYMBOLIC(__NR_removexattr)
+#define __NR_fremovexattr SYMBOLIC(__NR_fremovexattr)
+#define __NR_lsetxattr SYMBOLIC(__NR_lsetxattr)
+#define __NR_lgetxattr SYMBOLIC(__NR_lgetxattr)
+#define __NR_llistxattr SYMBOLIC(__NR_llistxattr)
+#define __NR_lremovexattr SYMBOLIC(__NR_lremovexattr)
+#define __NR_sched_setaffinity SYMBOLIC(__NR_sched_setaffinity)
+#define __NR_sched_getaffinity SYMBOLIC(__NR_sched_getaffinity)
+#define __NR_cpuset_getaffinity SYMBOLIC(__NR_cpuset_getaffinity)
+#define __NR_cpuset_setaffinity SYMBOLIC(__NR_cpuset_setaffinity)
+#define __NR_io_setup SYMBOLIC(__NR_io_setup)
+#define __NR_io_destroy SYMBOLIC(__NR_io_destroy)
+#define __NR_io_getevents SYMBOLIC(__NR_io_getevents)
+#define __NR_io_submit SYMBOLIC(__NR_io_submit)
+#define __NR_io_cancel SYMBOLIC(__NR_io_cancel)
+#define __NR_lookup_dcookie SYMBOLIC(__NR_lookup_dcookie)
+#define __NR_epoll_create SYMBOLIC(__NR_epoll_create)
+#define __NR_epoll_wait SYMBOLIC(__NR_epoll_wait)
+#define __NR_epoll_ctl SYMBOLIC(__NR_epoll_ctl)
+#define __NR_getdents SYMBOLIC(__NR_getdents)
+#define __NR_set_tid_address SYMBOLIC(__NR_set_tid_address)
+#define __NR_restart_syscall SYMBOLIC(__NR_restart_syscall)
+#define __NR_semtimedop SYMBOLIC(__NR_semtimedop)
+#define __NR_fadvise SYMBOLIC(__NR_fadvise)
+#define __NR_timer_create SYMBOLIC(__NR_timer_create)
+#define __NR_timer_settime SYMBOLIC(__NR_timer_settime)
+#define __NR_timer_gettime SYMBOLIC(__NR_timer_gettime)
+#define __NR_timer_getoverrun SYMBOLIC(__NR_timer_getoverrun)
+#define __NR_timer_delete SYMBOLIC(__NR_timer_delete)
+#define __NR_clock_settime SYMBOLIC(__NR_clock_settime)
+#define __NR_clock_gettime SYMBOLIC(__NR_clock_gettime)
+#define __NR_clock_getres SYMBOLIC(__NR_clock_getres)
+#define __NR_clock_nanosleep SYMBOLIC(__NR_clock_nanosleep)
+#define __NR_tgkill SYMBOLIC(__NR_tgkill)
+#define __NR_mbind SYMBOLIC(__NR_mbind)
+#define __NR_set_mempolicy SYMBOLIC(__NR_set_mempolicy)
+#define __NR_get_mempolicy SYMBOLIC(__NR_get_mempolicy)
+#define __NR_mq_open SYMBOLIC(__NR_mq_open)
+#define __NR_mq_unlink SYMBOLIC(__NR_mq_unlink)
+#define __NR_mq_timedsend SYMBOLIC(__NR_mq_timedsend)
+#define __NR_mq_timedreceive SYMBOLIC(__NR_mq_timedreceive)
+#define __NR_mq_notify SYMBOLIC(__NR_mq_notify)
+#define __NR_mq_getsetattr SYMBOLIC(__NR_mq_getsetattr)
+#define __NR_kexec_load SYMBOLIC(__NR_kexec_load)
+#define __NR_waitid SYMBOLIC(__NR_waitid)
+#define __NR_add_key SYMBOLIC(__NR_add_key)
+#define __NR_request_key SYMBOLIC(__NR_request_key)
+#define __NR_keyctl SYMBOLIC(__NR_keyctl)
+#define __NR_ioprio_set SYMBOLIC(__NR_ioprio_set)
+#define __NR_ioprio_get SYMBOLIC(__NR_ioprio_get)
+#define __NR_inotify_init SYMBOLIC(__NR_inotify_init)
+#define __NR_inotify_add_watch SYMBOLIC(__NR_inotify_add_watch)
+#define __NR_inotify_rm_watch SYMBOLIC(__NR_inotify_rm_watch)
+#define __NR_openat SYMBOLIC(__NR_openat)
+#define __NR_mkdirat SYMBOLIC(__NR_mkdirat)
+#define __NR_fchownat SYMBOLIC(__NR_fchownat)
+#define __NR_utime SYMBOLIC(__NR_utime)
+#define __NR_utimes SYMBOLIC(__NR_utimes)
+#define __NR_futimesat SYMBOLIC(__NR_futimesat)
+#define __NR_futimes SYMBOLIC(__NR_futimes)
+#define __NR_futimens SYMBOLIC(__NR_futimens)
+#define __NR_fstatat SYMBOLIC(__NR_fstatat)
+#define __NR_unlinkat SYMBOLIC(__NR_unlinkat)
+#define __NR_renameat SYMBOLIC(__NR_renameat)
+#define __NR_linkat SYMBOLIC(__NR_linkat)
+#define __NR_symlinkat SYMBOLIC(__NR_symlinkat)
+#define __NR_readlinkat SYMBOLIC(__NR_readlinkat)
+#define __NR_fchmodat SYMBOLIC(__NR_fchmodat)
+#define __NR_faccessat SYMBOLIC(__NR_faccessat)
+#define __NR_unshare SYMBOLIC(__NR_unshare)
+#define __NR_splice SYMBOLIC(__NR_splice)
+#define __NR_tee SYMBOLIC(__NR_tee)
+#define __NR_sync_file_range SYMBOLIC(__NR_sync_file_range)
+#define __NR_vmsplice SYMBOLIC(__NR_vmsplice)
+#define __NR_migrate_pages SYMBOLIC(__NR_migrate_pages)
+#define __NR_move_pages SYMBOLIC(__NR_move_pages)
+#define __NR_preadv SYMBOLIC(__NR_preadv)
+#define __NR_pwritev SYMBOLIC(__NR_pwritev)
+#define __NR_utimensat SYMBOLIC(__NR_utimensat)
+#define __NR_fallocate SYMBOLIC(__NR_fallocate)
+#define __NR_posix_fallocate SYMBOLIC(__NR_posix_fallocate)
+#define __NR_accept4 SYMBOLIC(__NR_accept4)
+#define __NR_dup3 SYMBOLIC(__NR_dup3)
+#define __NR_pipe2 SYMBOLIC(__NR_pipe2)
+#define __NR_epoll_pwait SYMBOLIC(__NR_epoll_pwait)
+#define __NR_epoll_create1 SYMBOLIC(__NR_epoll_create1)
+#define __NR_perf_event_open SYMBOLIC(__NR_perf_event_open)
+#define __NR_inotify_init1 SYMBOLIC(__NR_inotify_init1)
+#define __NR_rt_tgsigqueueinfo SYMBOLIC(__NR_rt_tgsigqueueinfo)
+#define __NR_signalfd SYMBOLIC(__NR_signalfd)
+#define __NR_signalfd4 SYMBOLIC(__NR_signalfd4)
+#define __NR_eventfd SYMBOLIC(__NR_eventfd)
+#define __NR_eventfd2 SYMBOLIC(__NR_eventfd2)
+#define __NR_timerfd_create SYMBOLIC(__NR_timerfd_create)
+#define __NR_timerfd_settime SYMBOLIC(__NR_timerfd_settime)
+#define __NR_timerfd_gettime SYMBOLIC(__NR_timerfd_gettime)
+#define __NR_recvmmsg SYMBOLIC(__NR_recvmmsg)
+#define __NR_fanotify_init SYMBOLIC(__NR_fanotify_init)
+#define __NR_fanotify_mark SYMBOLIC(__NR_fanotify_mark)
+#define __NR_prlimit SYMBOLIC(__NR_prlimit)
+#define __NR_name_to_handle_at SYMBOLIC(__NR_name_to_handle_at)
+#define __NR_open_by_handle_at SYMBOLIC(__NR_open_by_handle_at)
+#define __NR_clock_adjtime SYMBOLIC(__NR_clock_adjtime)
+#define __NR_syncfs SYMBOLIC(__NR_syncfs)
+#define __NR_sendmmsg SYMBOLIC(__NR_sendmmsg)
+#define __NR_setns SYMBOLIC(__NR_setns)
+#define __NR_getcpu SYMBOLIC(__NR_getcpu)
+#define __NR_process_vm_readv SYMBOLIC(__NR_process_vm_readv)
+#define __NR_process_vm_writev SYMBOLIC(__NR_process_vm_writev)
+#define __NR_kcmp SYMBOLIC(__NR_kcmp)
+#define __NR_finit_module SYMBOLIC(__NR_finit_module)
+#define __NR_sched_setattr SYMBOLIC(__NR_sched_setattr)
+#define __NR_sched_getattr SYMBOLIC(__NR_sched_getattr)
+#define __NR_renameat2 SYMBOLIC(__NR_renameat2)
+#define __NR_seccomp SYMBOLIC(__NR_seccomp)
+#define __NR_getrandom SYMBOLIC(__NR_getrandom)
+#define __NR_memfd_create SYMBOLIC(__NR_memfd_create)
+#define __NR_kexec_file_load SYMBOLIC(__NR_kexec_file_load)
+#define __NR_bpf SYMBOLIC(__NR_bpf)
+#define __NR_execveat SYMBOLIC(__NR_execveat)
+#define __NR_userfaultfd SYMBOLIC(__NR_userfaultfd)
+#define __NR_membarrier SYMBOLIC(__NR_membarrier)
+#define __NR_mlock2 SYMBOLIC(__NR_mlock2)
+#define __NR_copy_file_range SYMBOLIC(__NR_copy_file_range)
+#define __NR_preadv2 SYMBOLIC(__NR_preadv2)
+#define __NR_pwritev2 SYMBOLIC(__NR_pwritev2)
+#define __NR_pkey_mprotect SYMBOLIC(__NR_pkey_mprotect)
+#define __NR_pkey_alloc SYMBOLIC(__NR_pkey_alloc)
+#define __NR_pkey_free SYMBOLIC(__NR_pkey_free)
+#define __NR_statx SYMBOLIC(__NR_statx)
+#define __NR_io_pgetevents SYMBOLIC(__NR_io_pgetevents)
+#define __NR_rseq SYMBOLIC(__NR_rseq)
+#define __NR_pidfd_send_signal SYMBOLIC(__NR_pidfd_send_signal)
+#define __NR_io_uring_setup SYMBOLIC(__NR_io_uring_setup)
+#define __NR_io_uring_enter SYMBOLIC(__NR_io_uring_enter)
+#define __NR_io_uring_register SYMBOLIC(__NR_io_uring_register)
+#define __NR_pledge SYMBOLIC(__NR_pledge)
+#define __NR_ktrace SYMBOLIC(__NR_ktrace)
+#define __NR_kqueue SYMBOLIC(__NR_kqueue)
+#define __NR_kevent SYMBOLIC(__NR_kevent)
+#define __NR_revoke SYMBOLIC(__NR_revoke)
+#define __NR_setlogin SYMBOLIC(__NR_setlogin)
+#define __NR_getfh SYMBOLIC(__NR_getfh)
+#define __NR_chflags SYMBOLIC(__NR_chflags)
+#define __NR_getfsstat SYMBOLIC(__NR_getfsstat)
+#define __NR_nfssvc SYMBOLIC(__NR_nfssvc)
+#define __NR_adjtime SYMBOLIC(__NR_adjtime)
+#define __NR_fchflags SYMBOLIC(__NR_fchflags)
+#define __NR_seteuid SYMBOLIC(__NR_seteuid)
+#define __NR_setegid SYMBOLIC(__NR_setegid)
+#define __NR_fpathconf SYMBOLIC(__NR_fpathconf)
+#define __NR_fhopen SYMBOLIC(__NR_fhopen)
+#define __NR_unmount SYMBOLIC(__NR_unmount)
+#define __NR_issetugid SYMBOLIC(__NR_issetugid)
+#define __NR_minherit SYMBOLIC(__NR_minherit)
+#define __NR_pathconf SYMBOLIC(__NR_pathconf)
+#define __NR_sysctl SYMBOLIC(__NR_sysctl)
+#define __NR_ntp_adjtime SYMBOLIC(__NR_ntp_adjtime)
+#define __NR_ntp_gettime SYMBOLIC(__NR_ntp_gettime)
+#define __NR_shm_unlink SYMBOLIC(__NR_shm_unlink)
+#define __NR_shm_open SYMBOLIC(__NR_shm_open)
+#define __NR_aio_read SYMBOLIC(__NR_aio_read)
+#define __NR_aio_suspend SYMBOLIC(__NR_aio_suspend)
+#define __NR_aio_cancel SYMBOLIC(__NR_aio_cancel)
+#define __NR_aio_fsync SYMBOLIC(__NR_aio_fsync)
+#define __NR_aio_error SYMBOLIC(__NR_aio_error)
+#define __NR_aio_return SYMBOLIC(__NR_aio_return)
+#define __NR_aio_write SYMBOLIC(__NR_aio_write)
+#define __NR_aio_waitcomplete SYMBOLIC(__NR_aio_waitcomplete)
+#define __NR_aio_suspend_nocancel SYMBOLIC(__NR_aio_suspend_nocancel)
+#define __NR_aio_mlock SYMBOLIC(__NR_aio_mlock)
+#define __NR_sigwait SYMBOLIC(__NR_sigwait)
+#define __NR_undelete SYMBOLIC(__NR_undelete)
+#define __NR_getlogin SYMBOLIC(__NR_getlogin)
+#define __NR_getdtablesize SYMBOLIC(__NR_getdtablesize)
+#define __NR_setauid SYMBOLIC(__NR_setauid)
+#define __NR_audit SYMBOLIC(__NR_audit)
+#define __NR_auditctl SYMBOLIC(__NR_auditctl)
+#define __NR_getaudit_addr SYMBOLIC(__NR_getaudit_addr)
+#define __NR_getdirentries SYMBOLIC(__NR_getdirentries)
+#define __NR_lio_listio SYMBOLIC(__NR_lio_listio)
+#define __NR_setaudit_addr SYMBOLIC(__NR_setaudit_addr)
+#define __NR_getauid SYMBOLIC(__NR_getauid)
+#define __NR_semsys SYMBOLIC(__NR_semsys)
+#define __NR_auditon SYMBOLIC(__NR_auditon)
+#define __NR_msgsys SYMBOLIC(__NR_msgsys)
+#define __NR_shmsys SYMBOLIC(__NR_shmsys)
+#define __NR_fhstat SYMBOLIC(__NR_fhstat)
+#define __NR_chflagsat SYMBOLIC(__NR_chflagsat)
+#define __NR_profil SYMBOLIC(__NR_profil)
+#define __NR_fhstatfs SYMBOLIC(__NR_fhstatfs)
+#define __NR_utrace SYMBOLIC(__NR_utrace)
+#define __NR_closefrom SYMBOLIC(__NR_closefrom)
+#define __NR_pthread_markcancel SYMBOLIC(__NR_pthread_markcancel)
+#define __NR_pthread_kill SYMBOLIC(__NR_pthread_kill)
+#define __NR_pthread_fchdir SYMBOLIC(__NR_pthread_fchdir)
+#define __NR_pthread_sigmask SYMBOLIC(__NR_pthread_sigmask)
+#define __NR_pthread_chdir SYMBOLIC(__NR_pthread_chdir)
+#define __NR_pthread_canceled SYMBOLIC(__NR_pthread_canceled)
+#define __NR_disable_threadsignal SYMBOLIC(__NR_disable_threadsignal)
+#define __NR_abort_with_payload SYMBOLIC(__NR_abort_with_payload)
+#define __NR_accept_nocancel SYMBOLIC(__NR_accept_nocancel)
+#define __NR_access_extended SYMBOLIC(__NR_access_extended)
+#define __NR_audit_session_join SYMBOLIC(__NR_audit_session_join)
+#define __NR_audit_session_port SYMBOLIC(__NR_audit_session_port)
+#define __NR_audit_session_self SYMBOLIC(__NR_audit_session_self)
+#define __NR_bsdthread_create SYMBOLIC(__NR_bsdthread_create)
+#define __NR_bsdthread_ctl SYMBOLIC(__NR_bsdthread_ctl)
+#define __NR_bsdthread_register SYMBOLIC(__NR_bsdthread_register)
+#define __NR_bsdthread_terminate SYMBOLIC(__NR_bsdthread_terminate)
+#define __NR_change_fdguard_np SYMBOLIC(__NR_change_fdguard_np)
+#define __NR_chmod_extended SYMBOLIC(__NR_chmod_extended)
+#define __NR_clonefileat SYMBOLIC(__NR_clonefileat)
+#define __NR_close_nocancel SYMBOLIC(__NR_close_nocancel)
+#define __NR_coalition SYMBOLIC(__NR_coalition)
+#define __NR_coalition_info SYMBOLIC(__NR_coalition_info)
+#define __NR_connect_nocancel SYMBOLIC(__NR_connect_nocancel)
+#define __NR_connectx SYMBOLIC(__NR_connectx)
+#define __NR_copyfile SYMBOLIC(__NR_copyfile)
+#define __NR_csops SYMBOLIC(__NR_csops)
+#define __NR_csops_audittoken SYMBOLIC(__NR_csops_audittoken)
+#define __NR_csrctl SYMBOLIC(__NR_csrctl)
+#define __NR_delete SYMBOLIC(__NR_delete)
+#define __NR_disconnectx SYMBOLIC(__NR_disconnectx)
+#define __NR_exchangedata SYMBOLIC(__NR_exchangedata)
+#define __NR_fchmod_extended SYMBOLIC(__NR_fchmod_extended)
+#define __NR_fclonefileat SYMBOLIC(__NR_fclonefileat)
+#define __NR_fcntl_nocancel SYMBOLIC(__NR_fcntl_nocancel)
+#define __NR_ffsctl SYMBOLIC(__NR_ffsctl)
+#define __NR_fgetattrlist SYMBOLIC(__NR_fgetattrlist)
+#define __NR_fileport_makefd SYMBOLIC(__NR_fileport_makefd)
+#define __NR_fileport_makeport SYMBOLIC(__NR_fileport_makeport)
+#define __NR_fmount SYMBOLIC(__NR_fmount)
+#define __NR_fs_snapshot SYMBOLIC(__NR_fs_snapshot)
+#define __NR_fsctl SYMBOLIC(__NR_fsctl)
+#define __NR_fsetattrlist SYMBOLIC(__NR_fsetattrlist)
+#define __NR_fstat_extended SYMBOLIC(__NR_fstat_extended)
+#define __NR_fsync_nocancel SYMBOLIC(__NR_fsync_nocancel)
+#define __NR_getattrlist SYMBOLIC(__NR_getattrlist)
+#define __NR_getattrlistat SYMBOLIC(__NR_getattrlistat)
+#define __NR_getattrlistbulk SYMBOLIC(__NR_getattrlistbulk)
+#define __NR_getdirentriesattr SYMBOLIC(__NR_getdirentriesattr)
+#define __NR_gethostuuid SYMBOLIC(__NR_gethostuuid)
+#define __NR_getsgroups SYMBOLIC(__NR_getsgroups)
+#define __NR_getwgroups SYMBOLIC(__NR_getwgroups)
+#define __NR_grab_pgo_data SYMBOLIC(__NR_grab_pgo_data)
+#define __NR_guarded_close_np SYMBOLIC(__NR_guarded_close_np)
+#define __NR_guarded_kqueue_np SYMBOLIC(__NR_guarded_kqueue_np)
+#define __NR_guarded_open_np SYMBOLIC(__NR_guarded_open_np)
+#define __NR_guarded_pwrite_np SYMBOLIC(__NR_guarded_pwrite_np)
+#define __NR_guarded_write_np SYMBOLIC(__NR_guarded_write_np)
+#define __NR_guarded_writev_np SYMBOLIC(__NR_guarded_writev_np)
+#define __NR_identitysvc SYMBOLIC(__NR_identitysvc)
+#define __NR_initgroups SYMBOLIC(__NR_initgroups)
+#define __NR_iopolicysys SYMBOLIC(__NR_iopolicysys)
+#define __NR_kas_info SYMBOLIC(__NR_kas_info)
+#define __NR_kdebug_trace SYMBOLIC(__NR_kdebug_trace)
+#define __NR_kdebug_trace_string SYMBOLIC(__NR_kdebug_trace_string)
+#define __NR_kdebug_typefilter SYMBOLIC(__NR_kdebug_typefilter)
+#define __NR_kevent_id SYMBOLIC(__NR_kevent_id)
+#define __NR_kevent_qos SYMBOLIC(__NR_kevent_qos)
+#define __NR_ledger SYMBOLIC(__NR_ledger)
+#define __NR_lstat_extended SYMBOLIC(__NR_lstat_extended)
+#define __NR_memorystatus_control SYMBOLIC(__NR_memorystatus_control)
+#define __NR_memorystatus_get_level SYMBOLIC(__NR_memorystatus_get_level)
+#define __NR_microstackshot SYMBOLIC(__NR_microstackshot)
+#define __NR_mkdir_extended SYMBOLIC(__NR_mkdir_extended)
+#define __NR_mkfifo_extended SYMBOLIC(__NR_mkfifo_extended)
+#define __NR_modwatch SYMBOLIC(__NR_modwatch)
+#define __NR_mremap_encrypted SYMBOLIC(__NR_mremap_encrypted)
+#define __NR_msgrcv_nocancel SYMBOLIC(__NR_msgrcv_nocancel)
+#define __NR_msgsnd_nocancel SYMBOLIC(__NR_msgsnd_nocancel)
+#define __NR_msync_nocancel SYMBOLIC(__NR_msync_nocancel)
+#define __NR_necp_client_action SYMBOLIC(__NR_necp_client_action)
+#define __NR_necp_match_policy SYMBOLIC(__NR_necp_match_policy)
+#define __NR_necp_open SYMBOLIC(__NR_necp_open)
+#define __NR_necp_session_action SYMBOLIC(__NR_necp_session_action)
+#define __NR_necp_session_open SYMBOLIC(__NR_necp_session_open)
+#define __NR_net_qos_guideline SYMBOLIC(__NR_net_qos_guideline)
+#define __NR_netagent_trigger SYMBOLIC(__NR_netagent_trigger)
+#define __NR_nfsclnt SYMBOLIC(__NR_nfsclnt)
+#define __NR_open_dprotected_np SYMBOLIC(__NR_open_dprotected_np)
+#define __NR_open_extended SYMBOLIC(__NR_open_extended)
+#define __NR_open_nocancel SYMBOLIC(__NR_open_nocancel)
+#define __NR_openat_nocancel SYMBOLIC(__NR_openat_nocancel)
+#define __NR_openbyid_np SYMBOLIC(__NR_openbyid_np)
+#define __NR_os_fault_with_payload SYMBOLIC(__NR_os_fault_with_payload)
+#define __NR_peeloff SYMBOLIC(__NR_peeloff)
+#define __NR_persona SYMBOLIC(__NR_persona)
+#define __NR_pid_hibernate SYMBOLIC(__NR_pid_hibernate)
+#define __NR_pid_resume SYMBOLIC(__NR_pid_resume)
+#define __NR_pid_shutdown_sockets SYMBOLIC(__NR_pid_shutdown_sockets)
+#define __NR_pid_suspend SYMBOLIC(__NR_pid_suspend)
+#define __NR_poll_nocancel SYMBOLIC(__NR_poll_nocancel)
+#define __NR_pread_nocancel SYMBOLIC(__NR_pread_nocancel)
+#define __NR_proc_info SYMBOLIC(__NR_proc_info)
+#define __NR_proc_rlimit_control SYMBOLIC(__NR_proc_rlimit_control)
+#define __NR_proc_trace_log SYMBOLIC(__NR_proc_trace_log)
+#define __NR_proc_uuid_policy SYMBOLIC(__NR_proc_uuid_policy)
+#define __NR_process_policy SYMBOLIC(__NR_process_policy)
+#define __NR_pselect_nocancel SYMBOLIC(__NR_pselect_nocancel)
+#define __NR_psynch_cvbroad SYMBOLIC(__NR_psynch_cvbroad)
+#define __NR_psynch_cvclrprepost SYMBOLIC(__NR_psynch_cvclrprepost)
+#define __NR_psynch_cvsignal SYMBOLIC(__NR_psynch_cvsignal)
+#define __NR_psynch_mutexdrop SYMBOLIC(__NR_psynch_mutexdrop)
+#define __NR_psynch_mutexwait SYMBOLIC(__NR_psynch_mutexwait)
+#define __NR_psynch_rw_downgrade SYMBOLIC(__NR_psynch_rw_downgrade)
+#define __NR_psynch_rw_longrdlock SYMBOLIC(__NR_psynch_rw_longrdlock)
+#define __NR_psynch_rw_rdlock SYMBOLIC(__NR_psynch_rw_rdlock)
+#define __NR_psynch_rw_unlock SYMBOLIC(__NR_psynch_rw_unlock)
+#define __NR_psynch_rw_unlock2 SYMBOLIC(__NR_psynch_rw_unlock2)
+#define __NR_psynch_rw_upgrade SYMBOLIC(__NR_psynch_rw_upgrade)
+#define __NR_psynch_rw_wrlock SYMBOLIC(__NR_psynch_rw_wrlock)
+#define __NR_psynch_rw_yieldwrlock SYMBOLIC(__NR_psynch_rw_yieldwrlock)
+#define __NR_pwrite_nocancel SYMBOLIC(__NR_pwrite_nocancel)
+#define __NR_read_nocancel SYMBOLIC(__NR_read_nocancel)
+#define __NR_readv_nocancel SYMBOLIC(__NR_readv_nocancel)
+#define __NR_recvfrom_nocancel SYMBOLIC(__NR_recvfrom_nocancel)
+#define __NR_recvmsg_nocancel SYMBOLIC(__NR_recvmsg_nocancel)
+#define __NR_recvmsg_x SYMBOLIC(__NR_recvmsg_x)
+#define __NR_renameatx_np SYMBOLIC(__NR_renameatx_np)
+#define __NR_searchfs SYMBOLIC(__NR_searchfs)
+#define __NR_select_nocancel SYMBOLIC(__NR_select_nocancel)
+#define __NR_sem_close SYMBOLIC(__NR_sem_close)
+#define __NR_sem_open SYMBOLIC(__NR_sem_open)
+#define __NR_sem_post SYMBOLIC(__NR_sem_post)
+#define __NR_sem_trywait SYMBOLIC(__NR_sem_trywait)
+#define __NR_sem_unlink SYMBOLIC(__NR_sem_unlink)
+#define __NR_sem_wait SYMBOLIC(__NR_sem_wait)
+#define __NR_sem_wait_nocancel SYMBOLIC(__NR_sem_wait_nocancel)
+#define __NR_sendmsg_nocancel SYMBOLIC(__NR_sendmsg_nocancel)
+#define __NR_sendmsg_x SYMBOLIC(__NR_sendmsg_x)
+#define __NR_sendto_nocancel SYMBOLIC(__NR_sendto_nocancel)
+#define __NR_setattrlist SYMBOLIC(__NR_setattrlist)
+#define __NR_setattrlistat SYMBOLIC(__NR_setattrlistat)
+#define __NR_setprivexec SYMBOLIC(__NR_setprivexec)
+#define __NR_setsgroups SYMBOLIC(__NR_setsgroups)
+#define __NR_settid SYMBOLIC(__NR_settid)
+#define __NR_settid_with_pid SYMBOLIC(__NR_settid_with_pid)
+#define __NR_setwgroups SYMBOLIC(__NR_setwgroups)
+#define __NR_sfi_ctl SYMBOLIC(__NR_sfi_ctl)
+#define __NR_sfi_pidctl SYMBOLIC(__NR_sfi_pidctl)
+#define __NR_shared_region_check_np SYMBOLIC(__NR_shared_region_check_np)
+#define __NR_sigsuspend_nocancel SYMBOLIC(__NR_sigsuspend_nocancel)
+#define __NR_socket_delegate SYMBOLIC(__NR_socket_delegate)
+#define __NR_stat_extended SYMBOLIC(__NR_stat_extended)
+#define __NR_sysctlbyname SYMBOLIC(__NR_sysctlbyname)
+#define __NR_system_override SYMBOLIC(__NR_system_override)
+#define __NR_telemetry SYMBOLIC(__NR_telemetry)
+#define __NR_terminate_with_payload SYMBOLIC(__NR_terminate_with_payload)
+#define __NR_thread_selfcounts SYMBOLIC(__NR_thread_selfcounts)
+#define __NR_thread_selfid SYMBOLIC(__NR_thread_selfid)
+#define __NR_thread_selfusage SYMBOLIC(__NR_thread_selfusage)
+#define __NR_ulock_wait SYMBOLIC(__NR_ulock_wait)
+#define __NR_ulock_wake SYMBOLIC(__NR_ulock_wake)
+#define __NR_umask_extended SYMBOLIC(__NR_umask_extended)
+#define __NR_usrctl SYMBOLIC(__NR_usrctl)
+#define __NR_vfs_purge SYMBOLIC(__NR_vfs_purge)
+#define __NR_vm_pressure_monitor SYMBOLIC(__NR_vm_pressure_monitor)
+#define __NR_wait4_nocancel SYMBOLIC(__NR_wait4_nocancel)
+#define __NR_waitevent SYMBOLIC(__NR_waitevent)
+#define __NR_waitid_nocancel SYMBOLIC(__NR_waitid_nocancel)
+#define __NR_watchevent SYMBOLIC(__NR_watchevent)
+#define __NR_work_interval_ctl SYMBOLIC(__NR_work_interval_ctl)
+#define __NR_workq_kernreturn SYMBOLIC(__NR_workq_kernreturn)
+#define __NR_workq_open SYMBOLIC(__NR_workq_open)
+#define __NR_write_nocancel SYMBOLIC(__NR_write_nocancel)
+#define __NR_writev_nocancel SYMBOLIC(__NR_writev_nocancel)
+#define __NR_abort2 SYMBOLIC(__NR_abort2)
+#define __NR_afs3_syscall SYMBOLIC(__NR_afs3_syscall)
+#define __NR_bindat SYMBOLIC(__NR_bindat)
+#define __NR_break SYMBOLIC(__NR_break)
+#define __NR_cap_enter SYMBOLIC(__NR_cap_enter)
+#define __NR_cap_fcntls_get SYMBOLIC(__NR_cap_fcntls_get)
+#define __NR_cap_fcntls_limit SYMBOLIC(__NR_cap_fcntls_limit)
+#define __NR_cap_getmode SYMBOLIC(__NR_cap_getmode)
+#define __NR_cap_ioctls_get SYMBOLIC(__NR_cap_ioctls_get)
+#define __NR_cap_ioctls_limit SYMBOLIC(__NR_cap_ioctls_limit)
+#define __NR_cap_rights_limit SYMBOLIC(__NR_cap_rights_limit)
+#define __NR_clock_getcpuclockid2 SYMBOLIC(__NR_clock_getcpuclockid2)
+#define __NR_connectat SYMBOLIC(__NR_connectat)
+#define __NR_cpuset SYMBOLIC(__NR_cpuset)
+#define __NR_cpuset_getdomain SYMBOLIC(__NR_cpuset_getdomain)
+#define __NR_cpuset_getid SYMBOLIC(__NR_cpuset_getid)
+#define __NR_cpuset_setdomain SYMBOLIC(__NR_cpuset_setdomain)
+#define __NR_cpuset_setid SYMBOLIC(__NR_cpuset_setid)
+#define __NR_eaccess SYMBOLIC(__NR_eaccess)
+#define __NR_extattr_delete_fd SYMBOLIC(__NR_extattr_delete_fd)
+#define __NR_extattr_delete_file SYMBOLIC(__NR_extattr_delete_file)
+#define __NR_extattr_delete_link SYMBOLIC(__NR_extattr_delete_link)
+#define __NR_extattr_get_fd SYMBOLIC(__NR_extattr_get_fd)
+#define __NR_extattr_get_file SYMBOLIC(__NR_extattr_get_file)
+#define __NR_extattr_get_link SYMBOLIC(__NR_extattr_get_link)
+#define __NR_extattr_list_fd SYMBOLIC(__NR_extattr_list_fd)
+#define __NR_extattr_list_file SYMBOLIC(__NR_extattr_list_file)
+#define __NR_extattr_list_link SYMBOLIC(__NR_extattr_list_link)
+#define __NR_extattr_set_fd SYMBOLIC(__NR_extattr_set_fd)
+#define __NR_extattr_set_file SYMBOLIC(__NR_extattr_set_file)
+#define __NR_extattr_set_link SYMBOLIC(__NR_extattr_set_link)
+#define __NR_extattrctl SYMBOLIC(__NR_extattrctl)
+#define __NR_fexecve SYMBOLIC(__NR_fexecve)
+#define __NR_ffclock_getcounter SYMBOLIC(__NR_ffclock_getcounter)
+#define __NR_ffclock_getestimate SYMBOLIC(__NR_ffclock_getestimate)
+#define __NR_ffclock_setestimate SYMBOLIC(__NR_ffclock_setestimate)
+#define __NR_fhlink SYMBOLIC(__NR_fhlink)
+#define __NR_fhlinkat SYMBOLIC(__NR_fhlinkat)
+#define __NR_fhreadlink SYMBOLIC(__NR_fhreadlink)
+#define __NR_getaudit SYMBOLIC(__NR_getaudit)
+#define __NR_getcontext SYMBOLIC(__NR_getcontext)
+#define __NR_getfhat SYMBOLIC(__NR_getfhat)
+#define __NR_gethostid SYMBOLIC(__NR_gethostid)
+#define __NR_getkerninfo SYMBOLIC(__NR_getkerninfo)
+#define __NR_getloginclass SYMBOLIC(__NR_getloginclass)
+#define __NR_getpagesize SYMBOLIC(__NR_getpagesize)
+#define __NR_gssd_syscall SYMBOLIC(__NR_gssd_syscall)
+#define __NR_jail SYMBOLIC(__NR_jail)
+#define __NR_jail_attach SYMBOLIC(__NR_jail_attach)
+#define __NR_jail_get SYMBOLIC(__NR_jail_get)
+#define __NR_jail_remove SYMBOLIC(__NR_jail_remove)
+#define __NR_jail_set SYMBOLIC(__NR_jail_set)
+#define __NR_kenv SYMBOLIC(__NR_kenv)
+#define __NR_kldfind SYMBOLIC(__NR_kldfind)
+#define __NR_kldfirstmod SYMBOLIC(__NR_kldfirstmod)
+#define __NR_kldload SYMBOLIC(__NR_kldload)
+#define __NR_kldnext SYMBOLIC(__NR_kldnext)
+#define __NR_kldstat SYMBOLIC(__NR_kldstat)
+#define __NR_kldsym SYMBOLIC(__NR_kldsym)
+#define __NR_kldunload SYMBOLIC(__NR_kldunload)
+#define __NR_kldunloadf SYMBOLIC(__NR_kldunloadf)
+#define __NR_kmq_notify SYMBOLIC(__NR_kmq_notify)
+#define __NR_kmq_setattr SYMBOLIC(__NR_kmq_setattr)
+#define __NR_kmq_timedreceive SYMBOLIC(__NR_kmq_timedreceive)
+#define __NR_kmq_timedsend SYMBOLIC(__NR_kmq_timedsend)
+#define __NR_kmq_unlink SYMBOLIC(__NR_kmq_unlink)
+#define __NR_ksem_close SYMBOLIC(__NR_ksem_close)
+#define __NR_ksem_destroy SYMBOLIC(__NR_ksem_destroy)
+#define __NR_ksem_getvalue SYMBOLIC(__NR_ksem_getvalue)
+#define __NR_ksem_init SYMBOLIC(__NR_ksem_init)
+#define __NR_ksem_open SYMBOLIC(__NR_ksem_open)
+#define __NR_ksem_post SYMBOLIC(__NR_ksem_post)
+#define __NR_ksem_timedwait SYMBOLIC(__NR_ksem_timedwait)
+#define __NR_ksem_trywait SYMBOLIC(__NR_ksem_trywait)
+#define __NR_ksem_unlink SYMBOLIC(__NR_ksem_unlink)
+#define __NR_ksem_wait SYMBOLIC(__NR_ksem_wait)
+#define __NR_ktimer_create SYMBOLIC(__NR_ktimer_create)
+#define __NR_ktimer_delete SYMBOLIC(__NR_ktimer_delete)
+#define __NR_ktimer_getoverrun SYMBOLIC(__NR_ktimer_getoverrun)
+#define __NR_ktimer_gettime SYMBOLIC(__NR_ktimer_gettime)
+#define __NR_ktimer_settime SYMBOLIC(__NR_ktimer_settime)
+#define __NR_lchflags SYMBOLIC(__NR_lchflags)
+#define __NR_lchmod SYMBOLIC(__NR_lchmod)
+#define __NR_lgetfh SYMBOLIC(__NR_lgetfh)
+#define __NR_lpathconf SYMBOLIC(__NR_lpathconf)
+#define __NR_lutimes SYMBOLIC(__NR_lutimes)
+#define __NR_mac_syscall SYMBOLIC(__NR_mac_syscall)
+#define __NR_modfind SYMBOLIC(__NR_modfind)
+#define __NR_modfnext SYMBOLIC(__NR_modfnext)
+#define __NR_modnext SYMBOLIC(__NR_modnext)
+#define __NR_modstat SYMBOLIC(__NR_modstat)
+#define __NR_nfstat SYMBOLIC(__NR_nfstat)
+#define __NR_nlm_syscall SYMBOLIC(__NR_nlm_syscall)
+#define __NR_nlstat SYMBOLIC(__NR_nlstat)
+#define __NR_nmount SYMBOLIC(__NR_nmount)
+#define __NR_nnpfs_syscall SYMBOLIC(__NR_nnpfs_syscall)
+#define __NR_nstat SYMBOLIC(__NR_nstat)
+#define __NR_pdfork SYMBOLIC(__NR_pdfork)
+#define __NR_pdgetpid SYMBOLIC(__NR_pdgetpid)
+#define __NR_pdkill SYMBOLIC(__NR_pdkill)
+#define __NR_posix_openpt SYMBOLIC(__NR_posix_openpt)
+#define __NR_procctl SYMBOLIC(__NR_procctl)
+#define __NR_psynch_cvwait SYMBOLIC(__NR_psynch_cvwait)
+#define __NR_quota SYMBOLIC(__NR_quota)
+#define __NR_rctl_add_rule SYMBOLIC(__NR_rctl_add_rule)
+#define __NR_rctl_get_limits SYMBOLIC(__NR_rctl_get_limits)
+#define __NR_rctl_get_racct SYMBOLIC(__NR_rctl_get_racct)
+#define __NR_rctl_get_rules SYMBOLIC(__NR_rctl_get_rules)
+#define __NR_rctl_remove_rule SYMBOLIC(__NR_rctl_remove_rule)
+#define __NR_recv SYMBOLIC(__NR_recv)
+#define __NR_rfork SYMBOLIC(__NR_rfork)
+#define __NR_rtprio SYMBOLIC(__NR_rtprio)
+#define __NR_rtprio_thread SYMBOLIC(__NR_rtprio_thread)
+#define __NR_send SYMBOLIC(__NR_send)
+#define __NR_setaudit SYMBOLIC(__NR_setaudit)
+#define __NR_setcontext SYMBOLIC(__NR_setcontext)
+#define __NR_setfib SYMBOLIC(__NR_setfib)
+#define __NR_sethostid SYMBOLIC(__NR_sethostid)
+#define __NR_setloginclass SYMBOLIC(__NR_setloginclass)
+#define __NR_sigblock SYMBOLIC(__NR_sigblock)
+#define __NR_sigqueue SYMBOLIC(__NR_sigqueue)
+#define __NR_sigsetmask SYMBOLIC(__NR_sigsetmask)
+#define __NR_sigstack SYMBOLIC(__NR_sigstack)
+#define __NR_sigvec SYMBOLIC(__NR_sigvec)
+#define __NR_sigwaitinfo SYMBOLIC(__NR_sigwaitinfo)
+#define __NR_sstk SYMBOLIC(__NR_sstk)
+#define __NR_swapcontext SYMBOLIC(__NR_swapcontext)
+#define __NR_thr_create SYMBOLIC(__NR_thr_create)
+#define __NR_thr_exit SYMBOLIC(__NR_thr_exit)
+#define __NR_thr_kill SYMBOLIC(__NR_thr_kill)
+#define __NR_thr_kill2 SYMBOLIC(__NR_thr_kill2)
+#define __NR_thr_new SYMBOLIC(__NR_thr_new)
+#define __NR_thr_self SYMBOLIC(__NR_thr_self)
+#define __NR_thr_set_name SYMBOLIC(__NR_thr_set_name)
+#define __NR_thr_suspend SYMBOLIC(__NR_thr_suspend)
+#define __NR_thr_wake SYMBOLIC(__NR_thr_wake)
+#define __NR_uuidgen SYMBOLIC(__NR_uuidgen)
+#define __NR_vadvise SYMBOLIC(__NR_vadvise)
+#define __NR_wait SYMBOLIC(__NR_wait)
+#define __NR_wait6 SYMBOLIC(__NR_wait6)
+#define __NR_yield SYMBOLIC(__NR_yield)
+#define __NR_tfork SYMBOLIC(__NR_tfork)
+#define __NR_thrsleep SYMBOLIC(__NR_thrsleep)
+#define __NR_thrwakeup SYMBOLIC(__NR_thrwakeup)
+#define __NR_threxit SYMBOLIC(__NR_threxit)
+#define __NR_thrsigdivert SYMBOLIC(__NR_thrsigdivert)
+#define __NR_set_tcb SYMBOLIC(__NR_set_tcb)
+#define __NR_get_tcb SYMBOLIC(__NR_get_tcb)
+#define __NR_adjfreq SYMBOLIC(__NR_adjfreq)
+#define __NR_getdtablecount SYMBOLIC(__NR_getdtablecount)
+#define __NR_getlogin_r SYMBOLIC(__NR_getlogin_r)
+#define __NR_getrtable SYMBOLIC(__NR_getrtable)
+#define __NR_getthrid SYMBOLIC(__NR_getthrid)
+#define __NR_kbind SYMBOLIC(__NR_kbind)
+#define __NR_mquery SYMBOLIC(__NR_mquery)
+#define __NR_obreak SYMBOLIC(__NR_obreak)
+#define __NR_sendsyslog SYMBOLIC(__NR_sendsyslog)
+#define __NR_setrtable SYMBOLIC(__NR_setrtable)
+#define __NR_swapctl SYMBOLIC(__NR_swapctl)
+#define __NR_thrkill SYMBOLIC(__NR_thrkill)
+#define __NR_unveil SYMBOLIC(__NR_unveil)
+#define __NR_mac_get_link SYMBOLIC(__NR_mac_get_link)
+#define __NR_mac_set_link SYMBOLIC(__NR_mac_set_link)
+#define __NR_mac_get_fd SYMBOLIC(__NR_mac_get_fd)
+#define __NR_mac_get_file SYMBOLIC(__NR_mac_get_file)
+#define __NR_mac_get_proc SYMBOLIC(__NR_mac_get_proc)
+#define __NR_mac_set_fd SYMBOLIC(__NR_mac_set_fd)
+#define __NR_mac_get_pid SYMBOLIC(__NR_mac_get_pid)
+#define __NR_mac_set_proc SYMBOLIC(__NR_mac_set_proc)
+#define __NR_mac_set_file SYMBOLIC(__NR_mac_set_file)
+#define __NR_mac_execve SYMBOLIC(__NR_mac_execve)
+#define __NR_acl_get_link SYMBOLIC(__NR_acl_get_link)
+#define __NR_sigwait_nocancel SYMBOLIC(__NR_sigwait_nocancel)
+#define __NR_cap_rights_get SYMBOLIC(__NR_cap_rights_get)
+#define __NR_semwait_signal SYMBOLIC(__NR_semwait_signal)
+#define __NR_acl_set_link SYMBOLIC(__NR_acl_set_link)
+#define __NR_acl_set_fd SYMBOLIC(__NR_acl_set_fd)
+#define __NR_old_semwait_signal SYMBOLIC(__NR_old_semwait_signal)
+#define __NR_setugid SYMBOLIC(__NR_setugid)
+#define __NR_acl_aclcheck_fd SYMBOLIC(__NR_acl_aclcheck_fd)
+#define __NR_acl_get_fd SYMBOLIC(__NR_acl_get_fd)
+#define __NR___sysctl SYMBOLIC(__NR___sysctl)
+#define __NR_mac_getfsstat SYMBOLIC(__NR_mac_getfsstat)
+#define __NR_mac_get_mount SYMBOLIC(__NR_mac_get_mount)
+#define __NR_acl_delete_link SYMBOLIC(__NR_acl_delete_link)
+#define __NR_mac_mount SYMBOLIC(__NR_mac_mount)
+#define __NR_acl_get_file SYMBOLIC(__NR_acl_get_file)
+#define __NR_acl_aclcheck_file SYMBOLIC(__NR_acl_aclcheck_file)
+#define __NR_acl_delete_fd SYMBOLIC(__NR_acl_delete_fd)
+#define __NR_acl_aclcheck_link SYMBOLIC(__NR_acl_aclcheck_link)
+#define __NR___mac_syscall SYMBOLIC(__NR___mac_syscall)
+#define __NR_acl_set_file SYMBOLIC(__NR_acl_set_file)
+#define __NR_acl_delete_file SYMBOLIC(__NR_acl_delete_file)
+#define __NR_syscall SYMBOLIC(__NR_syscall)
+#define __NR__umtx_op SYMBOLIC(__NR__umtx_op)
+#define __NR_semwait_signal_nocancel SYMBOLIC(__NR_semwait_signal_nocancel)
+#define __NR_old_semwait_signal_nocancel \
+ SYMBOLIC(__NR_old_semwait_signal_nocancel)
+#define __NR_sctp_peeloff SYMBOLIC(__NR_sctp_peeloff)
+#define __NR_sctp_generic_recvmsg SYMBOLIC(__NR_sctp_generic_recvmsg)
+#define __NR_sctp_generic_sendmsg SYMBOLIC(__NR_sctp_generic_sendmsg)
+#define __NR_sctp_generic_sendmsg_iov SYMBOLIC(__NR_sctp_generic_sendmsg_iov)
+#define __NR_shared_region_map_and_slide_np \
+ SYMBOLIC(__NR_shared_region_map_and_slide_np)
+#define __NR_guarded_open_dprotected_np \
+ SYMBOLIC(__NR_guarded_open_dprotected_np)
+#define __NR_stack_snapshot_with_config \
+ SYMBOLIC(__NR_stack_snapshot_with_config)
+
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
-hidden extern const long __NR_access;
-hidden extern const long __NR_arch_prctl;
-hidden extern const long __NR_clock_gettime;
-hidden extern const long __NR_close;
hidden extern const long __NR_exit;
-hidden extern const long __NR_fadvise;
-hidden extern const long __NR_fork;
+hidden extern const long __NR_exit_group;
+hidden extern const long __NR_read;
+hidden extern const long __NR_write;
+hidden extern const long __NR_open;
+hidden extern const long __NR_close;
+hidden extern const long __NR_stat;
hidden extern const long __NR_fstat;
-hidden extern const long __NR_getpid;
-hidden extern const long __NR_gettid;
-hidden extern const long __NR_gettimeofday;
-hidden extern const long __NR_kill;
hidden extern const long __NR_lstat;
-hidden extern const long __NR_madvise;
+hidden extern const long __NR_poll;
+hidden extern const long __NR_ppoll;
+hidden extern const long __NR_lseek;
hidden extern const long __NR_mmap;
+hidden extern const long __NR_msync;
hidden extern const long __NR_mprotect;
hidden extern const long __NR_munmap;
-hidden extern const long __NR_open;
-hidden extern const long __NR_pread;
-hidden extern const long __NR_pwrite;
-hidden extern const long __NR_read;
-hidden extern const long __NR_sched_yield;
-hidden extern const long __NR_sendfile;
hidden extern const long __NR_sigaction;
hidden extern const long __NR_sigprocmask;
-hidden extern const long __NR_stat;
-hidden extern const long __NR_write;
+hidden extern const long __NR_ioctl;
+hidden extern const long __NR_pread;
+hidden extern const long __NR_pwrite;
+hidden extern const long __NR_readv;
+hidden extern const long __NR_writev;
+hidden extern const long __NR_access;
+hidden extern const long __NR_pipe;
+hidden extern const long __NR_select;
+hidden extern const long __NR_pselect;
+hidden extern const long __NR_pselect6;
+hidden extern const long __NR_sched_yield;
+hidden extern const long __NR_mremap;
+hidden extern const long __NR_mincore;
+hidden extern const long __NR_madvise;
+hidden extern const long __NR_shmget;
+hidden extern const long __NR_shmat;
+hidden extern const long __NR_shmctl;
+hidden extern const long __NR_dup;
+hidden extern const long __NR_dup2;
+hidden extern const long __NR_pause;
+hidden extern const long __NR_nanosleep;
+hidden extern const long __NR_getitimer;
+hidden extern const long __NR_setitimer;
+hidden extern const long __NR_alarm;
+hidden extern const long __NR_getpid;
+hidden extern const long __NR_sendfile;
+hidden extern const long __NR_socket;
+hidden extern const long __NR_connect;
+hidden extern const long __NR_accept;
+hidden extern const long __NR_sendto;
+hidden extern const long __NR_recvfrom;
+hidden extern const long __NR_sendmsg;
+hidden extern const long __NR_recvmsg;
+hidden extern const long __NR_shutdown;
+hidden extern const long __NR_bind;
+hidden extern const long __NR_listen;
+hidden extern const long __NR_getsockname;
+hidden extern const long __NR_getpeername;
+hidden extern const long __NR_socketpair;
+hidden extern const long __NR_setsockopt;
+hidden extern const long __NR_getsockopt;
+hidden extern const long __NR_fork;
+hidden extern const long __NR_vfork;
+hidden extern const long __NR_posix_spawn;
+hidden extern const long __NR_execve;
hidden extern const long __NR_wait4;
+hidden extern const long __NR_kill;
+hidden extern const long __NR_killpg;
+hidden extern const long __NR_clone;
+hidden extern const long __NR_tkill;
+hidden extern const long __NR_futex;
+hidden extern const long __NR_set_robust_list;
+hidden extern const long __NR_get_robust_list;
+hidden extern const long __NR_uname;
+hidden extern const long __NR_semget;
+hidden extern const long __NR_semop;
+hidden extern const long __NR_semctl;
+hidden extern const long __NR_shmdt;
+hidden extern const long __NR_msgget;
+hidden extern const long __NR_msgsnd;
+hidden extern const long __NR_msgrcv;
+hidden extern const long __NR_msgctl;
+hidden extern const long __NR_fcntl;
+hidden extern const long __NR_flock;
+hidden extern const long __NR_fsync;
+hidden extern const long __NR_fdatasync;
+hidden extern const long __NR_truncate;
+hidden extern const long __NR_ftruncate;
+hidden extern const long __NR_getcwd;
+hidden extern const long __NR_chdir;
+hidden extern const long __NR_fchdir;
+hidden extern const long __NR_rename;
+hidden extern const long __NR_mkdir;
+hidden extern const long __NR_rmdir;
+hidden extern const long __NR_creat;
+hidden extern const long __NR_link;
+hidden extern const long __NR_unlink;
+hidden extern const long __NR_symlink;
+hidden extern const long __NR_readlink;
+hidden extern const long __NR_chmod;
+hidden extern const long __NR_fchmod;
+hidden extern const long __NR_chown;
+hidden extern const long __NR_fchown;
+hidden extern const long __NR_lchown;
+hidden extern const long __NR_umask;
+hidden extern const long __NR_gettimeofday;
+hidden extern const long __NR_getrlimit;
+hidden extern const long __NR_getrusage;
+hidden extern const long __NR_sysinfo;
+hidden extern const long __NR_times;
+hidden extern const long __NR_ptrace;
+hidden extern const long __NR_syslog;
+hidden extern const long __NR_getuid;
+hidden extern const long __NR_getgid;
+hidden extern const long __NR_getppid;
+hidden extern const long __NR_getpgrp;
+hidden extern const long __NR_setsid;
+hidden extern const long __NR_getsid;
+hidden extern const long __NR_getpgid;
+hidden extern const long __NR_setpgid;
+hidden extern const long __NR_geteuid;
+hidden extern const long __NR_getegid;
+hidden extern const long __NR_getgroups;
+hidden extern const long __NR_setgroups;
+hidden extern const long __NR_setreuid;
+hidden extern const long __NR_setregid;
+hidden extern const long __NR_setuid;
+hidden extern const long __NR_setgid;
+hidden extern const long __NR_setresuid;
+hidden extern const long __NR_setresgid;
+hidden extern const long __NR_getresuid;
+hidden extern const long __NR_getresgid;
+hidden extern const long __NR_sigpending;
+hidden extern const long __NR_sigsuspend;
+hidden extern const long __NR_sigaltstack;
+hidden extern const long __NR_mknod;
+hidden extern const long __NR_mknodat;
+hidden extern const long __NR_mkfifo;
+hidden extern const long __NR_mkfifoat;
+hidden extern const long __NR_statfs;
+hidden extern const long __NR_fstatfs;
+hidden extern const long __NR_getpriority;
+hidden extern const long __NR_setpriority;
+hidden extern const long __NR_mlock;
+hidden extern const long __NR_munlock;
+hidden extern const long __NR_mlockall;
+hidden extern const long __NR_munlockall;
+hidden extern const long __NR_setrlimit;
+hidden extern const long __NR_chroot;
+hidden extern const long __NR_sync;
+hidden extern const long __NR_acct;
+hidden extern const long __NR_settimeofday;
+hidden extern const long __NR_mount;
+hidden extern const long __NR_reboot;
+hidden extern const long __NR_quotactl;
+hidden extern const long __NR_setfsuid;
+hidden extern const long __NR_setfsgid;
+hidden extern const long __NR_capget;
+hidden extern const long __NR_capset;
+hidden extern const long __NR_sigtimedwait;
+hidden extern const long __NR_rt_sigqueueinfo;
+hidden extern const long __NR_personality;
+hidden extern const long __NR_ustat;
+hidden extern const long __NR_sysfs;
+hidden extern const long __NR_sched_setparam;
+hidden extern const long __NR_sched_getparam;
+hidden extern const long __NR_sched_setscheduler;
+hidden extern const long __NR_sched_getscheduler;
+hidden extern const long __NR_sched_get_priority_max;
+hidden extern const long __NR_sched_get_priority_min;
+hidden extern const long __NR_sched_rr_get_interval;
+hidden extern const long __NR_vhangup;
+hidden extern const long __NR_modify_ldt;
+hidden extern const long __NR_pivot_root;
+hidden extern const long __NR__sysctl;
+hidden extern const long __NR_prctl;
+hidden extern const long __NR_arch_prctl;
+hidden extern const long __NR_adjtimex;
+hidden extern const long __NR_umount2;
+hidden extern const long __NR_swapon;
+hidden extern const long __NR_swapoff;
+hidden extern const long __NR_sethostname;
+hidden extern const long __NR_setdomainname;
+hidden extern const long __NR_iopl;
+hidden extern const long __NR_ioperm;
+hidden extern const long __NR_init_module;
+hidden extern const long __NR_delete_module;
+hidden extern const long __NR_gettid;
+hidden extern const long __NR_readahead;
+hidden extern const long __NR_setxattr;
+hidden extern const long __NR_fsetxattr;
+hidden extern const long __NR_getxattr;
+hidden extern const long __NR_fgetxattr;
+hidden extern const long __NR_listxattr;
+hidden extern const long __NR_flistxattr;
+hidden extern const long __NR_removexattr;
+hidden extern const long __NR_fremovexattr;
+hidden extern const long __NR_lsetxattr;
+hidden extern const long __NR_lgetxattr;
+hidden extern const long __NR_llistxattr;
+hidden extern const long __NR_lremovexattr;
+hidden extern const long __NR_sched_setaffinity;
+hidden extern const long __NR_sched_getaffinity;
+hidden extern const long __NR_cpuset_getaffinity;
+hidden extern const long __NR_cpuset_setaffinity;
+hidden extern const long __NR_io_setup;
+hidden extern const long __NR_io_destroy;
+hidden extern const long __NR_io_getevents;
+hidden extern const long __NR_io_submit;
+hidden extern const long __NR_io_cancel;
+hidden extern const long __NR_lookup_dcookie;
+hidden extern const long __NR_epoll_create;
+hidden extern const long __NR_epoll_wait;
+hidden extern const long __NR_epoll_ctl;
+hidden extern const long __NR_getdents;
+hidden extern const long __NR_set_tid_address;
+hidden extern const long __NR_restart_syscall;
+hidden extern const long __NR_semtimedop;
+hidden extern const long __NR_fadvise;
+hidden extern const long __NR_timer_create;
+hidden extern const long __NR_timer_settime;
+hidden extern const long __NR_timer_gettime;
+hidden extern const long __NR_timer_getoverrun;
+hidden extern const long __NR_timer_delete;
+hidden extern const long __NR_clock_settime;
+hidden extern const long __NR_clock_gettime;
+hidden extern const long __NR_clock_getres;
+hidden extern const long __NR_clock_nanosleep;
+hidden extern const long __NR_tgkill;
+hidden extern const long __NR_mbind;
+hidden extern const long __NR_set_mempolicy;
+hidden extern const long __NR_get_mempolicy;
+hidden extern const long __NR_mq_open;
+hidden extern const long __NR_mq_unlink;
+hidden extern const long __NR_mq_timedsend;
+hidden extern const long __NR_mq_timedreceive;
+hidden extern const long __NR_mq_notify;
+hidden extern const long __NR_mq_getsetattr;
+hidden extern const long __NR_kexec_load;
+hidden extern const long __NR_waitid;
+hidden extern const long __NR_add_key;
+hidden extern const long __NR_request_key;
+hidden extern const long __NR_keyctl;
+hidden extern const long __NR_ioprio_set;
+hidden extern const long __NR_ioprio_get;
+hidden extern const long __NR_inotify_init;
+hidden extern const long __NR_inotify_add_watch;
+hidden extern const long __NR_inotify_rm_watch;
+hidden extern const long __NR_openat;
+hidden extern const long __NR_mkdirat;
+hidden extern const long __NR_fchownat;
+hidden extern const long __NR_utime;
+hidden extern const long __NR_utimes;
+hidden extern const long __NR_futimesat;
+hidden extern const long __NR_futimes;
+hidden extern const long __NR_futimens;
+hidden extern const long __NR_fstatat;
+hidden extern const long __NR_unlinkat;
+hidden extern const long __NR_renameat;
+hidden extern const long __NR_linkat;
+hidden extern const long __NR_symlinkat;
+hidden extern const long __NR_readlinkat;
+hidden extern const long __NR_fchmodat;
+hidden extern const long __NR_faccessat;
+hidden extern const long __NR_unshare;
+hidden extern const long __NR_splice;
+hidden extern const long __NR_tee;
+hidden extern const long __NR_sync_file_range;
+hidden extern const long __NR_vmsplice;
+hidden extern const long __NR_migrate_pages;
+hidden extern const long __NR_move_pages;
+hidden extern const long __NR_preadv;
+hidden extern const long __NR_pwritev;
+hidden extern const long __NR_utimensat;
+hidden extern const long __NR_fallocate;
+hidden extern const long __NR_posix_fallocate;
+hidden extern const long __NR_accept4;
+hidden extern const long __NR_dup3;
+hidden extern const long __NR_pipe2;
+hidden extern const long __NR_epoll_pwait;
+hidden extern const long __NR_epoll_create1;
+hidden extern const long __NR_perf_event_open;
+hidden extern const long __NR_inotify_init1;
+hidden extern const long __NR_rt_tgsigqueueinfo;
+hidden extern const long __NR_signalfd;
+hidden extern const long __NR_signalfd4;
+hidden extern const long __NR_eventfd;
+hidden extern const long __NR_eventfd2;
+hidden extern const long __NR_timerfd_create;
+hidden extern const long __NR_timerfd_settime;
+hidden extern const long __NR_timerfd_gettime;
+hidden extern const long __NR_recvmmsg;
+hidden extern const long __NR_fanotify_init;
+hidden extern const long __NR_fanotify_mark;
+hidden extern const long __NR_prlimit;
+hidden extern const long __NR_name_to_handle_at;
+hidden extern const long __NR_open_by_handle_at;
+hidden extern const long __NR_clock_adjtime;
+hidden extern const long __NR_syncfs;
+hidden extern const long __NR_sendmmsg;
+hidden extern const long __NR_setns;
+hidden extern const long __NR_getcpu;
+hidden extern const long __NR_process_vm_readv;
+hidden extern const long __NR_process_vm_writev;
+hidden extern const long __NR_kcmp;
+hidden extern const long __NR_finit_module;
+hidden extern const long __NR_sched_setattr;
+hidden extern const long __NR_sched_getattr;
+hidden extern const long __NR_renameat2;
+hidden extern const long __NR_seccomp;
+hidden extern const long __NR_getrandom;
+hidden extern const long __NR_memfd_create;
+hidden extern const long __NR_kexec_file_load;
+hidden extern const long __NR_bpf;
+hidden extern const long __NR_execveat;
+hidden extern const long __NR_userfaultfd;
+hidden extern const long __NR_membarrier;
+hidden extern const long __NR_mlock2;
+hidden extern const long __NR_copy_file_range;
+hidden extern const long __NR_preadv2;
+hidden extern const long __NR_pwritev2;
+hidden extern const long __NR_pkey_mprotect;
+hidden extern const long __NR_pkey_alloc;
+hidden extern const long __NR_pkey_free;
+hidden extern const long __NR_statx;
+hidden extern const long __NR_io_pgetevents;
+hidden extern const long __NR_rseq;
+hidden extern const long __NR_pidfd_send_signal;
+hidden extern const long __NR_io_uring_setup;
+hidden extern const long __NR_io_uring_enter;
+hidden extern const long __NR_io_uring_register;
+hidden extern const long __NR_pledge;
+hidden extern const long __NR_ktrace;
+hidden extern const long __NR_kqueue;
+hidden extern const long __NR_kevent;
+hidden extern const long __NR_revoke;
+hidden extern const long __NR_setlogin;
+hidden extern const long __NR_getfh;
+hidden extern const long __NR_chflags;
+hidden extern const long __NR_getfsstat;
+hidden extern const long __NR_nfssvc;
+hidden extern const long __NR_adjtime;
+hidden extern const long __NR_fchflags;
+hidden extern const long __NR_seteuid;
+hidden extern const long __NR_setegid;
+hidden extern const long __NR_fpathconf;
+hidden extern const long __NR_fhopen;
+hidden extern const long __NR_unmount;
+hidden extern const long __NR_issetugid;
+hidden extern const long __NR_minherit;
+hidden extern const long __NR_pathconf;
+hidden extern const long __NR_sysctl;
+hidden extern const long __NR_ntp_adjtime;
+hidden extern const long __NR_ntp_gettime;
+hidden extern const long __NR_shm_unlink;
+hidden extern const long __NR_shm_open;
+hidden extern const long __NR_aio_read;
+hidden extern const long __NR_aio_suspend;
+hidden extern const long __NR_aio_cancel;
+hidden extern const long __NR_aio_fsync;
+hidden extern const long __NR_aio_error;
+hidden extern const long __NR_aio_return;
+hidden extern const long __NR_aio_write;
+hidden extern const long __NR_aio_waitcomplete;
+hidden extern const long __NR_aio_suspend_nocancel;
+hidden extern const long __NR_aio_mlock;
+hidden extern const long __NR_sigwait;
+hidden extern const long __NR_undelete;
+hidden extern const long __NR_getlogin;
+hidden extern const long __NR_getdtablesize;
+hidden extern const long __NR_setauid;
+hidden extern const long __NR_audit;
+hidden extern const long __NR_auditctl;
+hidden extern const long __NR_getaudit_addr;
+hidden extern const long __NR_getdirentries;
+hidden extern const long __NR_lio_listio;
+hidden extern const long __NR_setaudit_addr;
+hidden extern const long __NR_getauid;
+hidden extern const long __NR_semsys;
+hidden extern const long __NR_auditon;
+hidden extern const long __NR_msgsys;
+hidden extern const long __NR_shmsys;
+hidden extern const long __NR_fhstat;
+hidden extern const long __NR_chflagsat;
+hidden extern const long __NR_profil;
+hidden extern const long __NR_fhstatfs;
+hidden extern const long __NR_utrace;
+hidden extern const long __NR_closefrom;
+hidden extern const long __NR_pthread_markcancel;
+hidden extern const long __NR_pthread_kill;
+hidden extern const long __NR_pthread_fchdir;
+hidden extern const long __NR_pthread_sigmask;
+hidden extern const long __NR_pthread_chdir;
+hidden extern const long __NR_pthread_canceled;
+hidden extern const long __NR_disable_threadsignal;
+hidden extern const long __NR_abort_with_payload;
+hidden extern const long __NR_accept_nocancel;
+hidden extern const long __NR_access_extended;
+hidden extern const long __NR_audit_session_join;
+hidden extern const long __NR_audit_session_port;
+hidden extern const long __NR_audit_session_self;
+hidden extern const long __NR_bsdthread_create;
+hidden extern const long __NR_bsdthread_ctl;
+hidden extern const long __NR_bsdthread_register;
+hidden extern const long __NR_bsdthread_terminate;
+hidden extern const long __NR_change_fdguard_np;
+hidden extern const long __NR_chmod_extended;
+hidden extern const long __NR_clonefileat;
+hidden extern const long __NR_close_nocancel;
+hidden extern const long __NR_coalition;
+hidden extern const long __NR_coalition_info;
+hidden extern const long __NR_connect_nocancel;
+hidden extern const long __NR_connectx;
+hidden extern const long __NR_copyfile;
+hidden extern const long __NR_csops;
+hidden extern const long __NR_csops_audittoken;
+hidden extern const long __NR_csrctl;
+hidden extern const long __NR_delete;
+hidden extern const long __NR_disconnectx;
+hidden extern const long __NR_exchangedata;
+hidden extern const long __NR_fchmod_extended;
+hidden extern const long __NR_fclonefileat;
+hidden extern const long __NR_fcntl_nocancel;
+hidden extern const long __NR_ffsctl;
+hidden extern const long __NR_fgetattrlist;
+hidden extern const long __NR_fileport_makefd;
+hidden extern const long __NR_fileport_makeport;
+hidden extern const long __NR_fmount;
+hidden extern const long __NR_fs_snapshot;
+hidden extern const long __NR_fsctl;
+hidden extern const long __NR_fsetattrlist;
+hidden extern const long __NR_fstat_extended;
+hidden extern const long __NR_fsync_nocancel;
+hidden extern const long __NR_getattrlist;
+hidden extern const long __NR_getattrlistat;
+hidden extern const long __NR_getattrlistbulk;
+hidden extern const long __NR_getdirentriesattr;
+hidden extern const long __NR_gethostuuid;
+hidden extern const long __NR_getsgroups;
+hidden extern const long __NR_getwgroups;
+hidden extern const long __NR_grab_pgo_data;
+hidden extern const long __NR_guarded_close_np;
+hidden extern const long __NR_guarded_kqueue_np;
+hidden extern const long __NR_guarded_open_np;
+hidden extern const long __NR_guarded_pwrite_np;
+hidden extern const long __NR_guarded_write_np;
+hidden extern const long __NR_guarded_writev_np;
+hidden extern const long __NR_identitysvc;
+hidden extern const long __NR_initgroups;
+hidden extern const long __NR_iopolicysys;
+hidden extern const long __NR_kas_info;
+hidden extern const long __NR_kdebug_trace;
+hidden extern const long __NR_kdebug_trace_string;
+hidden extern const long __NR_kdebug_typefilter;
+hidden extern const long __NR_kevent_id;
+hidden extern const long __NR_kevent_qos;
+hidden extern const long __NR_ledger;
+hidden extern const long __NR_lstat_extended;
+hidden extern const long __NR_memorystatus_control;
+hidden extern const long __NR_memorystatus_get_level;
+hidden extern const long __NR_microstackshot;
+hidden extern const long __NR_mkdir_extended;
+hidden extern const long __NR_mkfifo_extended;
+hidden extern const long __NR_modwatch;
+hidden extern const long __NR_mremap_encrypted;
+hidden extern const long __NR_msgrcv_nocancel;
+hidden extern const long __NR_msgsnd_nocancel;
+hidden extern const long __NR_msync_nocancel;
+hidden extern const long __NR_necp_client_action;
+hidden extern const long __NR_necp_match_policy;
+hidden extern const long __NR_necp_open;
+hidden extern const long __NR_necp_session_action;
+hidden extern const long __NR_necp_session_open;
+hidden extern const long __NR_net_qos_guideline;
+hidden extern const long __NR_netagent_trigger;
+hidden extern const long __NR_nfsclnt;
+hidden extern const long __NR_open_dprotected_np;
+hidden extern const long __NR_open_extended;
+hidden extern const long __NR_open_nocancel;
+hidden extern const long __NR_openat_nocancel;
+hidden extern const long __NR_openbyid_np;
+hidden extern const long __NR_os_fault_with_payload;
+hidden extern const long __NR_peeloff;
+hidden extern const long __NR_persona;
+hidden extern const long __NR_pid_hibernate;
+hidden extern const long __NR_pid_resume;
+hidden extern const long __NR_pid_shutdown_sockets;
+hidden extern const long __NR_pid_suspend;
+hidden extern const long __NR_poll_nocancel;
+hidden extern const long __NR_pread_nocancel;
+hidden extern const long __NR_proc_info;
+hidden extern const long __NR_proc_rlimit_control;
+hidden extern const long __NR_proc_trace_log;
+hidden extern const long __NR_proc_uuid_policy;
+hidden extern const long __NR_process_policy;
+hidden extern const long __NR_pselect_nocancel;
+hidden extern const long __NR_psynch_cvbroad;
+hidden extern const long __NR_psynch_cvclrprepost;
+hidden extern const long __NR_psynch_cvsignal;
+hidden extern const long __NR_psynch_mutexdrop;
+hidden extern const long __NR_psynch_mutexwait;
+hidden extern const long __NR_psynch_rw_downgrade;
+hidden extern const long __NR_psynch_rw_longrdlock;
+hidden extern const long __NR_psynch_rw_rdlock;
+hidden extern const long __NR_psynch_rw_unlock;
+hidden extern const long __NR_psynch_rw_unlock2;
+hidden extern const long __NR_psynch_rw_upgrade;
+hidden extern const long __NR_psynch_rw_wrlock;
+hidden extern const long __NR_psynch_rw_yieldwrlock;
+hidden extern const long __NR_pwrite_nocancel;
+hidden extern const long __NR_read_nocancel;
+hidden extern const long __NR_readv_nocancel;
+hidden extern const long __NR_recvfrom_nocancel;
+hidden extern const long __NR_recvmsg_nocancel;
+hidden extern const long __NR_recvmsg_x;
+hidden extern const long __NR_renameatx_np;
+hidden extern const long __NR_searchfs;
+hidden extern const long __NR_select_nocancel;
+hidden extern const long __NR_sem_close;
+hidden extern const long __NR_sem_open;
+hidden extern const long __NR_sem_post;
+hidden extern const long __NR_sem_trywait;
+hidden extern const long __NR_sem_unlink;
+hidden extern const long __NR_sem_wait;
+hidden extern const long __NR_sem_wait_nocancel;
+hidden extern const long __NR_sendmsg_nocancel;
+hidden extern const long __NR_sendmsg_x;
+hidden extern const long __NR_sendto_nocancel;
+hidden extern const long __NR_setattrlist;
+hidden extern const long __NR_setattrlistat;
+hidden extern const long __NR_setprivexec;
+hidden extern const long __NR_setsgroups;
+hidden extern const long __NR_settid;
+hidden extern const long __NR_settid_with_pid;
+hidden extern const long __NR_setwgroups;
+hidden extern const long __NR_sfi_ctl;
+hidden extern const long __NR_sfi_pidctl;
+hidden extern const long __NR_shared_region_check_np;
+hidden extern const long __NR_sigsuspend_nocancel;
+hidden extern const long __NR_socket_delegate;
+hidden extern const long __NR_stat_extended;
+hidden extern const long __NR_sysctlbyname;
+hidden extern const long __NR_system_override;
+hidden extern const long __NR_telemetry;
+hidden extern const long __NR_terminate_with_payload;
+hidden extern const long __NR_thread_selfcounts;
+hidden extern const long __NR_thread_selfid;
+hidden extern const long __NR_thread_selfusage;
+hidden extern const long __NR_ulock_wait;
+hidden extern const long __NR_ulock_wake;
+hidden extern const long __NR_umask_extended;
+hidden extern const long __NR_usrctl;
+hidden extern const long __NR_vfs_purge;
+hidden extern const long __NR_vm_pressure_monitor;
+hidden extern const long __NR_wait4_nocancel;
+hidden extern const long __NR_waitevent;
+hidden extern const long __NR_waitid_nocancel;
+hidden extern const long __NR_watchevent;
+hidden extern const long __NR_work_interval_ctl;
+hidden extern const long __NR_workq_kernreturn;
+hidden extern const long __NR_workq_open;
+hidden extern const long __NR_write_nocancel;
+hidden extern const long __NR_writev_nocancel;
+hidden extern const long __NR_abort2;
+hidden extern const long __NR_afs3_syscall;
+hidden extern const long __NR_bindat;
+hidden extern const long __NR_break;
+hidden extern const long __NR_cap_enter;
+hidden extern const long __NR_cap_fcntls_get;
+hidden extern const long __NR_cap_fcntls_limit;
+hidden extern const long __NR_cap_getmode;
+hidden extern const long __NR_cap_ioctls_get;
+hidden extern const long __NR_cap_ioctls_limit;
+hidden extern const long __NR_cap_rights_limit;
+hidden extern const long __NR_clock_getcpuclockid2;
+hidden extern const long __NR_connectat;
+hidden extern const long __NR_cpuset;
+hidden extern const long __NR_cpuset_getdomain;
+hidden extern const long __NR_cpuset_getid;
+hidden extern const long __NR_cpuset_setdomain;
+hidden extern const long __NR_cpuset_setid;
+hidden extern const long __NR_eaccess;
+hidden extern const long __NR_extattr_delete_fd;
+hidden extern const long __NR_extattr_delete_file;
+hidden extern const long __NR_extattr_delete_link;
+hidden extern const long __NR_extattr_get_fd;
+hidden extern const long __NR_extattr_get_file;
+hidden extern const long __NR_extattr_get_link;
+hidden extern const long __NR_extattr_list_fd;
+hidden extern const long __NR_extattr_list_file;
+hidden extern const long __NR_extattr_list_link;
+hidden extern const long __NR_extattr_set_fd;
+hidden extern const long __NR_extattr_set_file;
+hidden extern const long __NR_extattr_set_link;
+hidden extern const long __NR_extattrctl;
+hidden extern const long __NR_fexecve;
+hidden extern const long __NR_ffclock_getcounter;
+hidden extern const long __NR_ffclock_getestimate;
+hidden extern const long __NR_ffclock_setestimate;
+hidden extern const long __NR_fhlink;
+hidden extern const long __NR_fhlinkat;
+hidden extern const long __NR_fhreadlink;
+hidden extern const long __NR_getaudit;
+hidden extern const long __NR_getcontext;
+hidden extern const long __NR_getfhat;
+hidden extern const long __NR_gethostid;
+hidden extern const long __NR_getkerninfo;
+hidden extern const long __NR_getloginclass;
+hidden extern const long __NR_getpagesize;
+hidden extern const long __NR_gssd_syscall;
+hidden extern const long __NR_jail;
+hidden extern const long __NR_jail_attach;
+hidden extern const long __NR_jail_get;
+hidden extern const long __NR_jail_remove;
+hidden extern const long __NR_jail_set;
+hidden extern const long __NR_kenv;
+hidden extern const long __NR_kldfind;
+hidden extern const long __NR_kldfirstmod;
+hidden extern const long __NR_kldload;
+hidden extern const long __NR_kldnext;
+hidden extern const long __NR_kldstat;
+hidden extern const long __NR_kldsym;
+hidden extern const long __NR_kldunload;
+hidden extern const long __NR_kldunloadf;
+hidden extern const long __NR_kmq_notify;
+hidden extern const long __NR_kmq_setattr;
+hidden extern const long __NR_kmq_timedreceive;
+hidden extern const long __NR_kmq_timedsend;
+hidden extern const long __NR_kmq_unlink;
+hidden extern const long __NR_ksem_close;
+hidden extern const long __NR_ksem_destroy;
+hidden extern const long __NR_ksem_getvalue;
+hidden extern const long __NR_ksem_init;
+hidden extern const long __NR_ksem_open;
+hidden extern const long __NR_ksem_post;
+hidden extern const long __NR_ksem_timedwait;
+hidden extern const long __NR_ksem_trywait;
+hidden extern const long __NR_ksem_unlink;
+hidden extern const long __NR_ksem_wait;
+hidden extern const long __NR_ktimer_create;
+hidden extern const long __NR_ktimer_delete;
+hidden extern const long __NR_ktimer_getoverrun;
+hidden extern const long __NR_ktimer_gettime;
+hidden extern const long __NR_ktimer_settime;
+hidden extern const long __NR_lchflags;
+hidden extern const long __NR_lchmod;
+hidden extern const long __NR_lgetfh;
+hidden extern const long __NR_lpathconf;
+hidden extern const long __NR_lutimes;
+hidden extern const long __NR_mac_syscall;
+hidden extern const long __NR_modfind;
+hidden extern const long __NR_modfnext;
+hidden extern const long __NR_modnext;
+hidden extern const long __NR_modstat;
+hidden extern const long __NR_nfstat;
+hidden extern const long __NR_nlm_syscall;
+hidden extern const long __NR_nlstat;
+hidden extern const long __NR_nmount;
+hidden extern const long __NR_nnpfs_syscall;
+hidden extern const long __NR_nstat;
+hidden extern const long __NR_pdfork;
+hidden extern const long __NR_pdgetpid;
+hidden extern const long __NR_pdkill;
+hidden extern const long __NR_posix_openpt;
+hidden extern const long __NR_procctl;
+hidden extern const long __NR_psynch_cvwait;
+hidden extern const long __NR_quota;
+hidden extern const long __NR_rctl_add_rule;
+hidden extern const long __NR_rctl_get_limits;
+hidden extern const long __NR_rctl_get_racct;
+hidden extern const long __NR_rctl_get_rules;
+hidden extern const long __NR_rctl_remove_rule;
+hidden extern const long __NR_recv;
+hidden extern const long __NR_rfork;
+hidden extern const long __NR_rtprio;
+hidden extern const long __NR_rtprio_thread;
+hidden extern const long __NR_send;
+hidden extern const long __NR_setaudit;
+hidden extern const long __NR_setcontext;
+hidden extern const long __NR_setfib;
+hidden extern const long __NR_sethostid;
+hidden extern const long __NR_setloginclass;
+hidden extern const long __NR_sigblock;
+hidden extern const long __NR_sigqueue;
+hidden extern const long __NR_sigsetmask;
+hidden extern const long __NR_sigstack;
+hidden extern const long __NR_sigvec;
+hidden extern const long __NR_sigwaitinfo;
+hidden extern const long __NR_sstk;
+hidden extern const long __NR_swapcontext;
+hidden extern const long __NR_thr_create;
+hidden extern const long __NR_thr_exit;
+hidden extern const long __NR_thr_kill;
+hidden extern const long __NR_thr_kill2;
+hidden extern const long __NR_thr_new;
+hidden extern const long __NR_thr_self;
+hidden extern const long __NR_thr_set_name;
+hidden extern const long __NR_thr_suspend;
+hidden extern const long __NR_thr_wake;
+hidden extern const long __NR_uuidgen;
+hidden extern const long __NR_vadvise;
+hidden extern const long __NR_wait;
+hidden extern const long __NR_wait6;
+hidden extern const long __NR_yield;
+hidden extern const long __NR_tfork;
+hidden extern const long __NR_thrsleep;
+hidden extern const long __NR_thrwakeup;
+hidden extern const long __NR_threxit;
+hidden extern const long __NR_thrsigdivert;
+hidden extern const long __NR_set_tcb;
+hidden extern const long __NR_get_tcb;
+hidden extern const long __NR_adjfreq;
+hidden extern const long __NR_getdtablecount;
+hidden extern const long __NR_getlogin_r;
+hidden extern const long __NR_getrtable;
+hidden extern const long __NR_getthrid;
+hidden extern const long __NR_kbind;
+hidden extern const long __NR_mquery;
+hidden extern const long __NR_obreak;
+hidden extern const long __NR_sendsyslog;
+hidden extern const long __NR_setrtable;
+hidden extern const long __NR_swapctl;
+hidden extern const long __NR_thrkill;
+hidden extern const long __NR_unveil;
+hidden extern const long __NR_mac_get_link;
+hidden extern const long __NR_mac_set_link;
+hidden extern const long __NR_mac_get_fd;
+hidden extern const long __NR_mac_get_file;
+hidden extern const long __NR_mac_get_proc;
+hidden extern const long __NR_mac_set_fd;
+hidden extern const long __NR_mac_get_pid;
+hidden extern const long __NR_mac_set_proc;
+hidden extern const long __NR_mac_set_file;
+hidden extern const long __NR_mac_execve;
+hidden extern const long __NR_acl_get_link;
+hidden extern const long __NR_sigwait_nocancel;
+hidden extern const long __NR_cap_rights_get;
+hidden extern const long __NR_semwait_signal;
+hidden extern const long __NR_acl_set_link;
+hidden extern const long __NR_acl_set_fd;
+hidden extern const long __NR_old_semwait_signal;
+hidden extern const long __NR_setugid;
+hidden extern const long __NR_acl_aclcheck_fd;
+hidden extern const long __NR_acl_get_fd;
+hidden extern const long __NR___sysctl;
+hidden extern const long __NR_mac_getfsstat;
+hidden extern const long __NR_mac_get_mount;
+hidden extern const long __NR_acl_delete_link;
+hidden extern const long __NR_mac_mount;
+hidden extern const long __NR_acl_get_file;
+hidden extern const long __NR_acl_aclcheck_file;
+hidden extern const long __NR_acl_delete_fd;
+hidden extern const long __NR_acl_aclcheck_link;
+hidden extern const long __NR___mac_syscall;
+hidden extern const long __NR_acl_set_file;
+hidden extern const long __NR_acl_delete_file;
+hidden extern const long __NR_syscall;
+hidden extern const long __NR__umtx_op;
+hidden extern const long __NR_semwait_signal_nocancel;
+hidden extern const long __NR_old_semwait_signal_nocancel;
+hidden extern const long __NR_sctp_peeloff;
+hidden extern const long __NR_sctp_generic_recvmsg;
+hidden extern const long __NR_sctp_generic_sendmsg;
+hidden extern const long __NR_sctp_generic_sendmsg_iov;
+hidden extern const long __NR_shared_region_map_and_slide_np;
+hidden extern const long __NR_guarded_open_dprotected_np;
+hidden extern const long __NR_stack_snapshot_with_config;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
-
-#define __NR_access SYMBOLIC(__NR_access)
-#define __NR_arch_prctl SYMBOLIC(__NR_arch_prctl)
-#define __NR_clock_gettime SYMBOLIC(__NR_clock_gettime)
-#define __NR_close SYMBOLIC(__NR_close)
-#define __NR_exit SYMBOLIC(__NR_exit)
-#define __NR_fadvise SYMBOLIC(__NR_fadvise)
-#define __NR_fork SYMBOLIC(__NR_fork)
-#define __NR_fstat SYMBOLIC(__NR_fstat)
-#define __NR_getpid SYMBOLIC(__NR_getpid)
-#define __NR_gettid SYMBOLIC(__NR_gettid)
-#define __NR_gettimeofday SYMBOLIC(__NR_gettimeofday)
-#define __NR_kill SYMBOLIC(__NR_kill)
-#define __NR_lstat SYMBOLIC(__NR_lstat)
-#define __NR_madvise SYMBOLIC(__NR_madvise)
-#define __NR_mmap SYMBOLIC(__NR_mmap)
-#define __NR_mprotect SYMBOLIC(__NR_mprotect)
-#define __NR_munmap SYMBOLIC(__NR_munmap)
-#define __NR_open SYMBOLIC(__NR_open)
-#define __NR_pread SYMBOLIC(__NR_pread)
-#define __NR_pwrite SYMBOLIC(__NR_pwrite)
-#define __NR_read SYMBOLIC(__NR_read)
-#define __NR_sched_yield SYMBOLIC(__NR_sched_yield)
-#define __NR_sendfile SYMBOLIC(__NR_sendfile)
-#define __NR_sigaction SYMBOLIC(__NR_sigaction)
-#define __NR_sigprocmask SYMBOLIC(__NR_sigprocmask)
-#define __NR_stat SYMBOLIC(__NR_stat)
-#define __NR_write SYMBOLIC(__NR_write)
-#define __NR_wait4 SYMBOLIC(__NR_wait4)
-
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_NR_H_ */
diff --git a/libc/sysv/consts/pr.h b/libc/sysv/consts/pr.h
index d58cea5c..3e4e3ee6 100644
--- a/libc/sysv/consts/pr.h
+++ b/libc/sysv/consts/pr.h
@@ -1,110 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_PR_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_PR_H_
#include "libc/runtime/symbolic.h"
-
-#define PR_CAPBSET_DROP SYMBOLIC(PR_CAPBSET_DROP)
-#define PR_CAPBSET_READ SYMBOLIC(PR_CAPBSET_READ)
-#define PR_CAP_AMBIENT SYMBOLIC(PR_CAP_AMBIENT)
-#define PR_CAP_AMBIENT_CLEAR_ALL SYMBOLIC(PR_CAP_AMBIENT_CLEAR_ALL)
-#define PR_CAP_AMBIENT_IS_SET SYMBOLIC(PR_CAP_AMBIENT_IS_SET)
-#define PR_CAP_AMBIENT_LOWER SYMBOLIC(PR_CAP_AMBIENT_LOWER)
-#define PR_CAP_AMBIENT_RAISE SYMBOLIC(PR_CAP_AMBIENT_RAISE)
-#define PR_ENDIAN_BIG SYMBOLIC(PR_ENDIAN_BIG)
-#define PR_ENDIAN_LITTLE SYMBOLIC(PR_ENDIAN_LITTLE)
-#define PR_ENDIAN_PPC_LITTLE SYMBOLIC(PR_ENDIAN_PPC_LITTLE)
-#define PR_FPEMU_NOPRINT SYMBOLIC(PR_FPEMU_NOPRINT)
-#define PR_FPEMU_SIGFPE SYMBOLIC(PR_FPEMU_SIGFPE)
-#define PR_FP_EXC_ASYNC SYMBOLIC(PR_FP_EXC_ASYNC)
-#define PR_FP_EXC_DISABLED SYMBOLIC(PR_FP_EXC_DISABLED)
-#define PR_FP_EXC_DIV SYMBOLIC(PR_FP_EXC_DIV)
-#define PR_FP_EXC_INV SYMBOLIC(PR_FP_EXC_INV)
-#define PR_FP_EXC_NONRECOV SYMBOLIC(PR_FP_EXC_NONRECOV)
-#define PR_FP_EXC_OVF SYMBOLIC(PR_FP_EXC_OVF)
-#define PR_FP_EXC_PRECISE SYMBOLIC(PR_FP_EXC_PRECISE)
-#define PR_FP_EXC_RES SYMBOLIC(PR_FP_EXC_RES)
-#define PR_FP_EXC_SW_ENABLE SYMBOLIC(PR_FP_EXC_SW_ENABLE)
-#define PR_FP_EXC_UND SYMBOLIC(PR_FP_EXC_UND)
-#define PR_FP_MODE_FR SYMBOLIC(PR_FP_MODE_FR)
-#define PR_FP_MODE_FRE SYMBOLIC(PR_FP_MODE_FRE)
-#define PR_GET_CHILD_SUBREAPER SYMBOLIC(PR_GET_CHILD_SUBREAPER)
-#define PR_GET_DUMPABLE SYMBOLIC(PR_GET_DUMPABLE)
-#define PR_GET_ENDIAN SYMBOLIC(PR_GET_ENDIAN)
-#define PR_GET_FPEMU SYMBOLIC(PR_GET_FPEMU)
-#define PR_GET_FPEXC SYMBOLIC(PR_GET_FPEXC)
-#define PR_GET_FP_MODE SYMBOLIC(PR_GET_FP_MODE)
-#define PR_GET_KEEPCAPS SYMBOLIC(PR_GET_KEEPCAPS)
-#define PR_GET_NAME SYMBOLIC(PR_GET_NAME)
-#define PR_GET_NO_NEW_PRIVS SYMBOLIC(PR_GET_NO_NEW_PRIVS)
-#define PR_GET_PDEATHSIG SYMBOLIC(PR_GET_PDEATHSIG)
-#define PR_GET_SECCOMP SYMBOLIC(PR_GET_SECCOMP)
-#define PR_GET_SECUREBITS SYMBOLIC(PR_GET_SECUREBITS)
-#define PR_GET_SPECULATION_CTRL SYMBOLIC(PR_GET_SPECULATION_CTRL)
-#define PR_GET_THP_DISABLE SYMBOLIC(PR_GET_THP_DISABLE)
-#define PR_GET_TID_ADDRESS SYMBOLIC(PR_GET_TID_ADDRESS)
-#define PR_GET_TIMERSLACK SYMBOLIC(PR_GET_TIMERSLACK)
-#define PR_GET_TIMING SYMBOLIC(PR_GET_TIMING)
-#define PR_GET_TSC SYMBOLIC(PR_GET_TSC)
-#define PR_GET_UNALIGN SYMBOLIC(PR_GET_UNALIGN)
-#define PR_MCE_KILL SYMBOLIC(PR_MCE_KILL)
-#define PR_MCE_KILL_CLEAR SYMBOLIC(PR_MCE_KILL_CLEAR)
-#define PR_MCE_KILL_DEFAULT SYMBOLIC(PR_MCE_KILL_DEFAULT)
-#define PR_MCE_KILL_EARLY SYMBOLIC(PR_MCE_KILL_EARLY)
-#define PR_MCE_KILL_GET SYMBOLIC(PR_MCE_KILL_GET)
-#define PR_MCE_KILL_LATE SYMBOLIC(PR_MCE_KILL_LATE)
-#define PR_MCE_KILL_SET SYMBOLIC(PR_MCE_KILL_SET)
-#define PR_MPX_DISABLE_MANAGEMENT SYMBOLIC(PR_MPX_DISABLE_MANAGEMENT)
-#define PR_MPX_ENABLE_MANAGEMENT SYMBOLIC(PR_MPX_ENABLE_MANAGEMENT)
-#define PR_SET_CHILD_SUBREAPER SYMBOLIC(PR_SET_CHILD_SUBREAPER)
-#define PR_SET_DUMPABLE SYMBOLIC(PR_SET_DUMPABLE)
-#define PR_SET_ENDIAN SYMBOLIC(PR_SET_ENDIAN)
-#define PR_SET_FPEMU SYMBOLIC(PR_SET_FPEMU)
-#define PR_SET_FPEXC SYMBOLIC(PR_SET_FPEXC)
-#define PR_SET_FP_MODE SYMBOLIC(PR_SET_FP_MODE)
-#define PR_SET_KEEPCAPS SYMBOLIC(PR_SET_KEEPCAPS)
-#define PR_SET_MM SYMBOLIC(PR_SET_MM)
-#define PR_SET_MM_ARG_END SYMBOLIC(PR_SET_MM_ARG_END)
-#define PR_SET_MM_ARG_START SYMBOLIC(PR_SET_MM_ARG_START)
-#define PR_SET_MM_AUXV SYMBOLIC(PR_SET_MM_AUXV)
-#define PR_SET_MM_BRK SYMBOLIC(PR_SET_MM_BRK)
-#define PR_SET_MM_END_CODE SYMBOLIC(PR_SET_MM_END_CODE)
-#define PR_SET_MM_END_DATA SYMBOLIC(PR_SET_MM_END_DATA)
-#define PR_SET_MM_ENV_END SYMBOLIC(PR_SET_MM_ENV_END)
-#define PR_SET_MM_ENV_START SYMBOLIC(PR_SET_MM_ENV_START)
-#define PR_SET_MM_EXE_FILE SYMBOLIC(PR_SET_MM_EXE_FILE)
-#define PR_SET_MM_MAP SYMBOLIC(PR_SET_MM_MAP)
-#define PR_SET_MM_MAP_SIZE SYMBOLIC(PR_SET_MM_MAP_SIZE)
-#define PR_SET_MM_START_BRK SYMBOLIC(PR_SET_MM_START_BRK)
-#define PR_SET_MM_START_CODE SYMBOLIC(PR_SET_MM_START_CODE)
-#define PR_SET_MM_START_DATA SYMBOLIC(PR_SET_MM_START_DATA)
-#define PR_SET_MM_START_STACK SYMBOLIC(PR_SET_MM_START_STACK)
-#define PR_SET_NAME SYMBOLIC(PR_SET_NAME)
-#define PR_SET_NO_NEW_PRIVS SYMBOLIC(PR_SET_NO_NEW_PRIVS)
-#define PR_SET_PDEATHSIG SYMBOLIC(PR_SET_PDEATHSIG)
-#define PR_SET_PTRACER SYMBOLIC(PR_SET_PTRACER)
-#define PR_SET_PTRACER_ANY SYMBOLIC(PR_SET_PTRACER_ANY)
-#define PR_SET_SECCOMP SYMBOLIC(PR_SET_SECCOMP)
-#define PR_SET_SECUREBITS SYMBOLIC(PR_SET_SECUREBITS)
-#define PR_SET_SPECULATION_CTRL SYMBOLIC(PR_SET_SPECULATION_CTRL)
-#define PR_SET_THP_DISABLE SYMBOLIC(PR_SET_THP_DISABLE)
-#define PR_SET_TIMERSLACK SYMBOLIC(PR_SET_TIMERSLACK)
-#define PR_SET_TIMING SYMBOLIC(PR_SET_TIMING)
-#define PR_SET_TSC SYMBOLIC(PR_SET_TSC)
-#define PR_SET_UNALIGN SYMBOLIC(PR_SET_UNALIGN)
-#define PR_SPEC_DISABLE SYMBOLIC(PR_SPEC_DISABLE)
-#define PR_SPEC_ENABLE SYMBOLIC(PR_SPEC_ENABLE)
-#define PR_SPEC_FORCE_DISABLE SYMBOLIC(PR_SPEC_FORCE_DISABLE)
-#define PR_SPEC_NOT_AFFECTED SYMBOLIC(PR_SPEC_NOT_AFFECTED)
-#define PR_SPEC_PRCTL SYMBOLIC(PR_SPEC_PRCTL)
-#define PR_SPEC_STORE_BYPASS SYMBOLIC(PR_SPEC_STORE_BYPASS)
-#define PR_TASK_PERF_EVENTS_DISABLE SYMBOLIC(PR_TASK_PERF_EVENTS_DISABLE)
-#define PR_TASK_PERF_EVENTS_ENABLE SYMBOLIC(PR_TASK_PERF_EVENTS_ENABLE)
-#define PR_TIMING_STATISTICAL SYMBOLIC(PR_TIMING_STATISTICAL)
-#define PR_TIMING_TIMESTAMP SYMBOLIC(PR_TIMING_TIMESTAMP)
-#define PR_TSC_ENABLE SYMBOLIC(PR_TSC_ENABLE)
-#define PR_TSC_SIGSEGV SYMBOLIC(PR_TSC_SIGSEGV)
-#define PR_UNALIGN_NOPRINT SYMBOLIC(PR_UNALIGN_NOPRINT)
-#define PR_UNALIGN_SIGBUS SYMBOLIC(PR_UNALIGN_SIGBUS)
-
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
@@ -213,4 +109,108 @@ hidden extern const long PR_UNALIGN_SIGBUS;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
+
+#define PR_CAPBSET_DROP SYMBOLIC(PR_CAPBSET_DROP)
+#define PR_CAPBSET_READ SYMBOLIC(PR_CAPBSET_READ)
+#define PR_CAP_AMBIENT SYMBOLIC(PR_CAP_AMBIENT)
+#define PR_CAP_AMBIENT_CLEAR_ALL SYMBOLIC(PR_CAP_AMBIENT_CLEAR_ALL)
+#define PR_CAP_AMBIENT_IS_SET SYMBOLIC(PR_CAP_AMBIENT_IS_SET)
+#define PR_CAP_AMBIENT_LOWER SYMBOLIC(PR_CAP_AMBIENT_LOWER)
+#define PR_CAP_AMBIENT_RAISE SYMBOLIC(PR_CAP_AMBIENT_RAISE)
+#define PR_ENDIAN_BIG SYMBOLIC(PR_ENDIAN_BIG)
+#define PR_ENDIAN_LITTLE SYMBOLIC(PR_ENDIAN_LITTLE)
+#define PR_ENDIAN_PPC_LITTLE SYMBOLIC(PR_ENDIAN_PPC_LITTLE)
+#define PR_FPEMU_NOPRINT SYMBOLIC(PR_FPEMU_NOPRINT)
+#define PR_FPEMU_SIGFPE SYMBOLIC(PR_FPEMU_SIGFPE)
+#define PR_FP_EXC_ASYNC SYMBOLIC(PR_FP_EXC_ASYNC)
+#define PR_FP_EXC_DISABLED SYMBOLIC(PR_FP_EXC_DISABLED)
+#define PR_FP_EXC_DIV SYMBOLIC(PR_FP_EXC_DIV)
+#define PR_FP_EXC_INV SYMBOLIC(PR_FP_EXC_INV)
+#define PR_FP_EXC_NONRECOV SYMBOLIC(PR_FP_EXC_NONRECOV)
+#define PR_FP_EXC_OVF SYMBOLIC(PR_FP_EXC_OVF)
+#define PR_FP_EXC_PRECISE SYMBOLIC(PR_FP_EXC_PRECISE)
+#define PR_FP_EXC_RES SYMBOLIC(PR_FP_EXC_RES)
+#define PR_FP_EXC_SW_ENABLE SYMBOLIC(PR_FP_EXC_SW_ENABLE)
+#define PR_FP_EXC_UND SYMBOLIC(PR_FP_EXC_UND)
+#define PR_FP_MODE_FR SYMBOLIC(PR_FP_MODE_FR)
+#define PR_FP_MODE_FRE SYMBOLIC(PR_FP_MODE_FRE)
+#define PR_GET_CHILD_SUBREAPER SYMBOLIC(PR_GET_CHILD_SUBREAPER)
+#define PR_GET_DUMPABLE SYMBOLIC(PR_GET_DUMPABLE)
+#define PR_GET_ENDIAN SYMBOLIC(PR_GET_ENDIAN)
+#define PR_GET_FPEMU SYMBOLIC(PR_GET_FPEMU)
+#define PR_GET_FPEXC SYMBOLIC(PR_GET_FPEXC)
+#define PR_GET_FP_MODE SYMBOLIC(PR_GET_FP_MODE)
+#define PR_GET_KEEPCAPS SYMBOLIC(PR_GET_KEEPCAPS)
+#define PR_GET_NAME SYMBOLIC(PR_GET_NAME)
+#define PR_GET_NO_NEW_PRIVS SYMBOLIC(PR_GET_NO_NEW_PRIVS)
+#define PR_GET_PDEATHSIG SYMBOLIC(PR_GET_PDEATHSIG)
+#define PR_GET_SECCOMP SYMBOLIC(PR_GET_SECCOMP)
+#define PR_GET_SECUREBITS SYMBOLIC(PR_GET_SECUREBITS)
+#define PR_GET_SPECULATION_CTRL SYMBOLIC(PR_GET_SPECULATION_CTRL)
+#define PR_GET_THP_DISABLE SYMBOLIC(PR_GET_THP_DISABLE)
+#define PR_GET_TID_ADDRESS SYMBOLIC(PR_GET_TID_ADDRESS)
+#define PR_GET_TIMERSLACK SYMBOLIC(PR_GET_TIMERSLACK)
+#define PR_GET_TIMING SYMBOLIC(PR_GET_TIMING)
+#define PR_GET_TSC SYMBOLIC(PR_GET_TSC)
+#define PR_GET_UNALIGN SYMBOLIC(PR_GET_UNALIGN)
+#define PR_MCE_KILL SYMBOLIC(PR_MCE_KILL)
+#define PR_MCE_KILL_CLEAR SYMBOLIC(PR_MCE_KILL_CLEAR)
+#define PR_MCE_KILL_DEFAULT SYMBOLIC(PR_MCE_KILL_DEFAULT)
+#define PR_MCE_KILL_EARLY SYMBOLIC(PR_MCE_KILL_EARLY)
+#define PR_MCE_KILL_GET SYMBOLIC(PR_MCE_KILL_GET)
+#define PR_MCE_KILL_LATE SYMBOLIC(PR_MCE_KILL_LATE)
+#define PR_MCE_KILL_SET SYMBOLIC(PR_MCE_KILL_SET)
+#define PR_MPX_DISABLE_MANAGEMENT SYMBOLIC(PR_MPX_DISABLE_MANAGEMENT)
+#define PR_MPX_ENABLE_MANAGEMENT SYMBOLIC(PR_MPX_ENABLE_MANAGEMENT)
+#define PR_SET_CHILD_SUBREAPER SYMBOLIC(PR_SET_CHILD_SUBREAPER)
+#define PR_SET_DUMPABLE SYMBOLIC(PR_SET_DUMPABLE)
+#define PR_SET_ENDIAN SYMBOLIC(PR_SET_ENDIAN)
+#define PR_SET_FPEMU SYMBOLIC(PR_SET_FPEMU)
+#define PR_SET_FPEXC SYMBOLIC(PR_SET_FPEXC)
+#define PR_SET_FP_MODE SYMBOLIC(PR_SET_FP_MODE)
+#define PR_SET_KEEPCAPS SYMBOLIC(PR_SET_KEEPCAPS)
+#define PR_SET_MM SYMBOLIC(PR_SET_MM)
+#define PR_SET_MM_ARG_END SYMBOLIC(PR_SET_MM_ARG_END)
+#define PR_SET_MM_ARG_START SYMBOLIC(PR_SET_MM_ARG_START)
+#define PR_SET_MM_AUXV SYMBOLIC(PR_SET_MM_AUXV)
+#define PR_SET_MM_BRK SYMBOLIC(PR_SET_MM_BRK)
+#define PR_SET_MM_END_CODE SYMBOLIC(PR_SET_MM_END_CODE)
+#define PR_SET_MM_END_DATA SYMBOLIC(PR_SET_MM_END_DATA)
+#define PR_SET_MM_ENV_END SYMBOLIC(PR_SET_MM_ENV_END)
+#define PR_SET_MM_ENV_START SYMBOLIC(PR_SET_MM_ENV_START)
+#define PR_SET_MM_EXE_FILE SYMBOLIC(PR_SET_MM_EXE_FILE)
+#define PR_SET_MM_MAP SYMBOLIC(PR_SET_MM_MAP)
+#define PR_SET_MM_MAP_SIZE SYMBOLIC(PR_SET_MM_MAP_SIZE)
+#define PR_SET_MM_START_BRK SYMBOLIC(PR_SET_MM_START_BRK)
+#define PR_SET_MM_START_CODE SYMBOLIC(PR_SET_MM_START_CODE)
+#define PR_SET_MM_START_DATA SYMBOLIC(PR_SET_MM_START_DATA)
+#define PR_SET_MM_START_STACK SYMBOLIC(PR_SET_MM_START_STACK)
+#define PR_SET_NAME SYMBOLIC(PR_SET_NAME)
+#define PR_SET_NO_NEW_PRIVS SYMBOLIC(PR_SET_NO_NEW_PRIVS)
+#define PR_SET_PDEATHSIG SYMBOLIC(PR_SET_PDEATHSIG)
+#define PR_SET_PTRACER SYMBOLIC(PR_SET_PTRACER)
+#define PR_SET_PTRACER_ANY SYMBOLIC(PR_SET_PTRACER_ANY)
+#define PR_SET_SECCOMP SYMBOLIC(PR_SET_SECCOMP)
+#define PR_SET_SECUREBITS SYMBOLIC(PR_SET_SECUREBITS)
+#define PR_SET_SPECULATION_CTRL SYMBOLIC(PR_SET_SPECULATION_CTRL)
+#define PR_SET_THP_DISABLE SYMBOLIC(PR_SET_THP_DISABLE)
+#define PR_SET_TIMERSLACK SYMBOLIC(PR_SET_TIMERSLACK)
+#define PR_SET_TIMING SYMBOLIC(PR_SET_TIMING)
+#define PR_SET_TSC SYMBOLIC(PR_SET_TSC)
+#define PR_SET_UNALIGN SYMBOLIC(PR_SET_UNALIGN)
+#define PR_SPEC_DISABLE SYMBOLIC(PR_SPEC_DISABLE)
+#define PR_SPEC_ENABLE SYMBOLIC(PR_SPEC_ENABLE)
+#define PR_SPEC_FORCE_DISABLE SYMBOLIC(PR_SPEC_FORCE_DISABLE)
+#define PR_SPEC_NOT_AFFECTED SYMBOLIC(PR_SPEC_NOT_AFFECTED)
+#define PR_SPEC_PRCTL SYMBOLIC(PR_SPEC_PRCTL)
+#define PR_SPEC_STORE_BYPASS SYMBOLIC(PR_SPEC_STORE_BYPASS)
+#define PR_TASK_PERF_EVENTS_DISABLE SYMBOLIC(PR_TASK_PERF_EVENTS_DISABLE)
+#define PR_TASK_PERF_EVENTS_ENABLE SYMBOLIC(PR_TASK_PERF_EVENTS_ENABLE)
+#define PR_TIMING_STATISTICAL SYMBOLIC(PR_TIMING_STATISTICAL)
+#define PR_TIMING_TIMESTAMP SYMBOLIC(PR_TIMING_TIMESTAMP)
+#define PR_TSC_ENABLE SYMBOLIC(PR_TSC_ENABLE)
+#define PR_TSC_SIGSEGV SYMBOLIC(PR_TSC_SIGSEGV)
+#define PR_UNALIGN_NOPRINT SYMBOLIC(PR_UNALIGN_NOPRINT)
+#define PR_UNALIGN_SIGBUS SYMBOLIC(PR_UNALIGN_SIGBUS)
+
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PR_H_ */
diff --git a/libc/sysv/consts/pt.h b/libc/sysv/consts/pt.h
index a21d98ff..a68cecf8 100644
--- a/libc/sysv/consts/pt.h
+++ b/libc/sysv/consts/pt.h
@@ -1,58 +1,28 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_PT_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_PT_H_
-#include "libc/runtime/symbolic.h"
+#include "libc/sysv/consts/ptrace.h"
-#define PT_ATTACH SYMBOLIC(PT_ATTACH)
-#define PT_CONTINUE SYMBOLIC(PT_CONTINUE)
-#define PT_DETACH SYMBOLIC(PT_DETACH)
-#define PT_GETEVENTMSG SYMBOLIC(PT_GETEVENTMSG)
-#define PT_GETFPREGS SYMBOLIC(PT_GETFPREGS)
-#define PT_GETFPXREGS SYMBOLIC(PT_GETFPXREGS)
-#define PT_GETREGS SYMBOLIC(PT_GETREGS)
-#define PT_GETSIGINFO SYMBOLIC(PT_GETSIGINFO)
-#define PT_KILL SYMBOLIC(PT_KILL)
-#define PT_READ_D SYMBOLIC(PT_READ_D)
-#define PT_READ_I SYMBOLIC(PT_READ_I)
-#define PT_READ_U SYMBOLIC(PT_READ_U)
-#define PT_SETFPREGS SYMBOLIC(PT_SETFPREGS)
-#define PT_SETFPXREGS SYMBOLIC(PT_SETFPXREGS)
-#define PT_SETOPTIONS SYMBOLIC(PT_SETOPTIONS)
-#define PT_SETREGS SYMBOLIC(PT_SETREGS)
-#define PT_SETSIGINFO SYMBOLIC(PT_SETSIGINFO)
-#define PT_STEP SYMBOLIC(PT_STEP)
-#define PT_SYSCALL SYMBOLIC(PT_SYSCALL)
-#define PT_TRACE_ME SYMBOLIC(PT_TRACE_ME)
-#define PT_WRITE_D SYMBOLIC(PT_WRITE_D)
-#define PT_WRITE_I SYMBOLIC(PT_WRITE_I)
-#define PT_WRITE_U SYMBOLIC(PT_WRITE_U)
+#define PT_ATTACH PTRACE_ATTACH
+#define PT_CONTINUE PTRACE_CONT
+#define PT_DETACH PTRACE_DETACH
+#define PT_GETEVENTMSG PTRACE_GETEVENTMSG
+#define PT_GETFPREGS PTRACE_GETFPREGS
+#define PT_GETFPXREGS PTRACE_GETFPXREGS
+#define PT_GETREGS PTRACE_GETREGS
+#define PT_GETSIGINFO PTRACE_GETSIGINFO
+#define PT_KILL PTRACE_KILL
+#define PT_READ_D PTRACE_PEEKDATA
+#define PT_READ_I PTRACE_PEEKTEXT
+#define PT_READ_U PTRACE_PEEKUSER
+#define PT_SETFPREGS PTRACE_SETFPREGS
+#define PT_SETFPXREGS PTRACE_SETFPXREGS
+#define PT_SETOPTIONS PTRACE_SETOPTIONS
+#define PT_SETREGS PTRACE_SETREGS
+#define PT_SETSIGINFO PTRACE_SETSIGINFO
+#define PT_STEP PTRACE_SINGLESTEP
+#define PT_SYSCALL PTRACE_SYSCALL
+#define PT_WRITE_D PTRACE_POKEDATA
+#define PT_WRITE_I PTRACE_POKETEXT
+#define PT_WRITE_U PTRACE_POKEUSER
-#if !(__ASSEMBLER__ + __LINKER__ + 0)
-COSMOPOLITAN_C_START_
-
-hidden extern const long PT_ATTACH;
-hidden extern const long PT_CONTINUE;
-hidden extern const long PT_DETACH;
-hidden extern const long PT_GETEVENTMSG;
-hidden extern const long PT_GETFPREGS;
-hidden extern const long PT_GETFPXREGS;
-hidden extern const long PT_GETREGS;
-hidden extern const long PT_GETSIGINFO;
-hidden extern const long PT_KILL;
-hidden extern const long PT_READ_D;
-hidden extern const long PT_READ_I;
-hidden extern const long PT_READ_U;
-hidden extern const long PT_SETFPREGS;
-hidden extern const long PT_SETFPXREGS;
-hidden extern const long PT_SETOPTIONS;
-hidden extern const long PT_SETREGS;
-hidden extern const long PT_SETSIGINFO;
-hidden extern const long PT_STEP;
-hidden extern const long PT_SYSCALL;
-hidden extern const long PT_TRACE_ME;
-hidden extern const long PT_WRITE_D;
-hidden extern const long PT_WRITE_I;
-hidden extern const long PT_WRITE_U;
-
-COSMOPOLITAN_C_END_
-#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PT_H_ */
diff --git a/libc/sysv/consts/ptrace.h b/libc/sysv/consts/ptrace.h
index b2ec1f62..270298cf 100644
--- a/libc/sysv/consts/ptrace.h
+++ b/libc/sysv/consts/ptrace.h
@@ -1,21 +1,32 @@
#ifndef COSMOPOLITAN_LIBC_SYSV_CONSTS_PTRACE_H_
#define COSMOPOLITAN_LIBC_SYSV_CONSTS_PTRACE_H_
#include "libc/runtime/symbolic.h"
-
-#define PTRACE_GETREGSET SYMBOLIC(PTRACE_GETREGSET)
-#define PTRACE_GETSIGMASK SYMBOLIC(PTRACE_GETSIGMASK)
-#define PTRACE_INTERRUPT SYMBOLIC(PTRACE_INTERRUPT)
-#define PTRACE_LISTEN SYMBOLIC(PTRACE_LISTEN)
-#define PTRACE_PEEKSIGINFO SYMBOLIC(PTRACE_PEEKSIGINFO)
-#define PTRACE_SECCOMP_GET_FILTER SYMBOLIC(PTRACE_SECCOMP_GET_FILTER)
-#define PTRACE_SEIZE SYMBOLIC(PTRACE_SEIZE)
-#define PTRACE_SETREGSET SYMBOLIC(PTRACE_SETREGSET)
-#define PTRACE_SETSIGMASK SYMBOLIC(PTRACE_SETSIGMASK)
-#define PTRACE_SYSCALL SYMBOLIC(PTRACE_SYSCALL)
-
#if !(__ASSEMBLER__ + __LINKER__ + 0)
COSMOPOLITAN_C_START_
+hidden extern const long PTRACE_TRACEME;
+hidden extern const long PTRACE_PEEKTEXT;
+hidden extern const long PTRACE_PEEKDATA;
+hidden extern const long PTRACE_PEEKUSER;
+hidden extern const long PTRACE_POKETEXT;
+hidden extern const long PTRACE_POKEDATA;
+hidden extern const long PTRACE_POKEUSER;
+hidden extern const long PTRACE_CONT;
+hidden extern const long PTRACE_KILL;
+hidden extern const long PTRACE_SINGLESTEP;
+hidden extern const long PTRACE_GETREGS;
+hidden extern const long PTRACE_SETREGS;
+hidden extern const long PTRACE_GETFPREGS;
+hidden extern const long PTRACE_SETFPREGS;
+hidden extern const long PTRACE_ATTACH;
+hidden extern const long PTRACE_DETACH;
+hidden extern const long PTRACE_GETFPXREGS;
+hidden extern const long PTRACE_SETFPXREGS;
+hidden extern const long PTRACE_SYSCALL;
+hidden extern const long PTRACE_GETEVENTMSG;
+hidden extern const long PTRACE_GETSIGINFO;
+hidden extern const long PTRACE_SETOPTIONS;
+hidden extern const long PTRACE_SETSIGINFO;
hidden extern const long PTRACE_GETREGSET;
hidden extern const long PTRACE_GETSIGMASK;
hidden extern const long PTRACE_INTERRUPT;
@@ -25,8 +36,69 @@ hidden extern const long PTRACE_SECCOMP_GET_FILTER;
hidden extern const long PTRACE_SEIZE;
hidden extern const long PTRACE_SETREGSET;
hidden extern const long PTRACE_SETSIGMASK;
-hidden extern const long PTRACE_SYSCALL;
+hidden extern const long PTRACE_O_TRACESYSGOOD;
+hidden extern const long PTRACE_O_TRACEFORK;
+hidden extern const long PTRACE_O_TRACEVFORK;
+hidden extern const long PTRACE_O_TRACECLONE;
+hidden extern const long PTRACE_O_TRACEEXEC;
+hidden extern const long PTRACE_O_TRACEVFORKDONE;
+hidden extern const long PTRACE_O_TRACEEXIT;
+hidden extern const long PTRACE_O_MASK;
+hidden extern const long PTRACE_EVENT_FORK;
+hidden extern const long PTRACE_EVENT_VFORK;
+hidden extern const long PTRACE_EVENT_CLONE;
+hidden extern const long PTRACE_EVENT_EXEC;
+hidden extern const long PTRACE_EVENT_VFORK_DONE;
+hidden extern const long PTRACE_EVENT_EXIT;
COSMOPOLITAN_C_END_
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
+
+#define PTRACE_TRACEME SYMBOLIC(PTRACE_TRACEME)
+#define PTRACE_PEEKTEXT SYMBOLIC(PTRACE_PEEKTEXT)
+#define PTRACE_PEEKDATA SYMBOLIC(PTRACE_PEEKDATA)
+#define PTRACE_PEEKUSER SYMBOLIC(PTRACE_PEEKUSER)
+#define PTRACE_POKETEXT SYMBOLIC(PTRACE_POKETEXT)
+#define PTRACE_POKEDATA SYMBOLIC(PTRACE_POKEDATA)
+#define PTRACE_POKEUSER SYMBOLIC(PTRACE_POKEUSER)
+#define PTRACE_CONT SYMBOLIC(PTRACE_CONT)
+#define PTRACE_KILL SYMBOLIC(PTRACE_KILL)
+#define PTRACE_SINGLESTEP SYMBOLIC(PTRACE_SINGLESTEP)
+#define PTRACE_GETREGS SYMBOLIC(PTRACE_GETREGS)
+#define PTRACE_SETREGS SYMBOLIC(PTRACE_SETREGS)
+#define PTRACE_GETFPREGS SYMBOLIC(PTRACE_GETFPREGS)
+#define PTRACE_SETFPREGS SYMBOLIC(PTRACE_SETFPREGS)
+#define PTRACE_ATTACH SYMBOLIC(PTRACE_ATTACH)
+#define PTRACE_DETACH SYMBOLIC(PTRACE_DETACH)
+#define PTRACE_GETFPXREGS SYMBOLIC(PTRACE_GETFPXREGS)
+#define PTRACE_SETFPXREGS SYMBOLIC(PTRACE_SETFPXREGS)
+#define PTRACE_SYSCALL SYMBOLIC(PTRACE_SYSCALL)
+#define PTRACE_GETEVENTMSG SYMBOLIC(PTRACE_GETEVENTMSG)
+#define PTRACE_GETSIGINFO SYMBOLIC(PTRACE_GETSIGINFO)
+#define PTRACE_SETOPTIONS SYMBOLIC(PTRACE_SETOPTIONS)
+#define PTRACE_SETSIGINFO SYMBOLIC(PTRACE_SETSIGINFO)
+#define PTRACE_GETREGSET SYMBOLIC(PTRACE_GETREGSET)
+#define PTRACE_GETSIGMASK SYMBOLIC(PTRACE_GETSIGMASK)
+#define PTRACE_INTERRUPT SYMBOLIC(PTRACE_INTERRUPT)
+#define PTRACE_LISTEN SYMBOLIC(PTRACE_LISTEN)
+#define PTRACE_PEEKSIGINFO SYMBOLIC(PTRACE_PEEKSIGINFO)
+#define PTRACE_SECCOMP_GET_FILTER SYMBOLIC(PTRACE_SECCOMP_GET_FILTER)
+#define PTRACE_SEIZE SYMBOLIC(PTRACE_SEIZE)
+#define PTRACE_SETREGSET SYMBOLIC(PTRACE_SETREGSET)
+#define PTRACE_SETSIGMASK SYMBOLIC(PTRACE_SETSIGMASK)
+#define PTRACE_O_TRACESYSGOOD SYMBOLIC(PTRACE_O_TRACESYSGOOD)
+#define PTRACE_O_TRACEFORK SYMBOLIC(PTRACE_O_TRACEFORK)
+#define PTRACE_O_TRACEVFORK SYMBOLIC(PTRACE_O_TRACEVFORK)
+#define PTRACE_O_TRACECLONE SYMBOLIC(PTRACE_O_TRACECLONE)
+#define PTRACE_O_TRACEEXEC SYMBOLIC(PTRACE_O_TRACEEXEC)
+#define PTRACE_O_TRACEVFORKDONE SYMBOLIC(PTRACE_O_TRACEVFORKDONE)
+#define PTRACE_O_TRACEEXIT SYMBOLIC(PTRACE_O_TRACEEXIT)
+#define PTRACE_O_MASK SYMBOLIC(PTRACE_O_MASK)
+#define PTRACE_EVENT_FORK SYMBOLIC(PTRACE_EVENT_FORK)
+#define PTRACE_EVENT_VFORK SYMBOLIC(PTRACE_EVENT_VFORK)
+#define PTRACE_EVENT_CLONE SYMBOLIC(PTRACE_EVENT_CLONE)
+#define PTRACE_EVENT_EXEC SYMBOLIC(PTRACE_EVENT_EXEC)
+#define PTRACE_EVENT_VFORK_DONE SYMBOLIC(PTRACE_EVENT_VFORK_DONE)
+#define PTRACE_EVENT_EXIT SYMBOLIC(PTRACE_EVENT_EXIT)
+
#endif /* COSMOPOLITAN_LIBC_SYSV_CONSTS_PTRACE_H_ */
diff --git a/libc/sysv/nr.py b/libc/sysv/nr.py
new file mode 100644
index 00000000..f3b74d20
--- /dev/null
+++ b/libc/sysv/nr.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+lines = open('libc/sysv/syscalls.sh').read().split('\n')
+for line in lines:
+ if not line.startswith('scall'):
+ continue
+ fields = line.split()
+ name = fields[1]
+ if name.startswith("'"): name = name[1:]
+ if name.endswith("'"): name = name[:-1]
+ if name.startswith("__"): name = name[2:]
+ if name.endswith("$sysv"): name = name[:-5]
+ if name.endswith("$bsd"): name = name[:-4]
+ if name.endswith("$freebsd"): name = name[:-8]
+ numbers = int(fields[2][2:], 16)
+ systemd = (numbers >> 000) & 0xffff
+ xnu = (numbers >> 020) & 0x0fff | ((numbers >> 28) & 0xf) << 20
+ freebsd = (numbers >> 040) & 0xffff
+ openbsd = (numbers >> 060) & 0xffff
+ print "syscon\tnr\t__NR_%s\t\t\t\t0x%04x\t\t\t0x%07x\t\t0x%04x\t\t\t0x%04x\t\t\t-1" % (name, systemd, xnu, freebsd, openbsd)
diff --git a/libc/sysv/syscalls.sh b/libc/sysv/syscalls.sh
index 35b416c8..7eb8d254 100755
--- a/libc/sysv/syscalls.sh
+++ b/libc/sysv/syscalls.sh
@@ -22,14 +22,14 @@ dir=libc/sysv/calls
# The Fifth Bell System Interface, Community Edition ┌─────────────────────────┐
# » so many numbers │ legend │
# ├─────────────────────────┤
-# Systemd┐ │ ffff │ unavailable │
+# GNU/Systemd┐ │ ffff │ unavailable │
# 2.6.18+│ │ $ │ wrapped │
# Mac OS X┐ │ │ __ │ wrapped twice │
# 15.6+│ │ └─────────────────────────┘
# FreeBSD┐ │ │
# 12+│ ┌─│───│── XnuClass{1:Mach,2:Unix}
# OpenBSD┐ │ │ │ │
-# 6.4│ │ │ │ │
+# 6.4+│ │ │ │ │
# Symbol ┌─┴┐┌─┴┐│┬┴┐┌─┴┐ Directives & Commentary
scall 'exit$sysv' 0x00010001200100e7 globl hidden # a.k.a. exit_group
scall 'read$sysv' 0x0003000320030000 globl hidden
@@ -76,7 +76,7 @@ scall 'getpid$sysv' 0x0014001420140027 globl hidden
scall 'sendfile$sysv' 0xffff018921510028 globl hidden # Linux vs. XNU/BSD ABIs very different
scall '__socket$sysv' 0x0061006120610029 globl hidden
scall '__connect$sysv' 0x006200622062002a globl hidden
-scall '__accept$sysv' 0x001e0063201e002b globl hidden
+scall '__accept$sysv' 0x001e021d201e002b globl hidden # accept4 on freebsd
scall 'sendto$sysv' 0x008500852085002c globl hidden
scall 'recvfrom$sysv' 0x001d001d201d002d globl hidden
scall 'sendmsg$sysv' 0x001c001c201c002e globl hidden
@@ -89,10 +89,10 @@ scall '__getpeername$sysv' 0x001f008d201f0034 globl hidden
scall 'socketpair$sysv' 0x0087008720870035 globl hidden
scall 'setsockopt$sysv' 0x0069006920690036 globl hidden
scall 'getsockopt$sysv' 0x0076007620760037 globl hidden
-scall 'fork$sysv' 0x0002000220020039 globl hidden
-#scall vfork 0x004200422042003a globl # needs to be called via vfork.S
+scall '__fork$sysv' 0x0002000220020039 globl hidden # xnu needs eax=~-edx b/c eax always holds pid and edx is 0 for parent and 1 for child
+#scall vfork 0x004200422042003a globl # this syscall is from the moon so we implement it by hand in libc/calls/hefty/vfork.S
scall posix_spawn 0xffffffff20f4ffff globl hidden # TODO: put in spawnve()
-scall 'execve$sysv' 0x003b003b203b003b globl hidden
+scall '__execve$sysv' 0x003b003b203b003b globl hidden
scall 'wait4$sysv' 0x000b00072007003d globl hidden
scall 'kill$sysv' 0x007a00252025003e globl hidden # kill(pid, sig, 1) b/c xnu
scall 'killpg$sysv' 0xffff0092ffffffff globl hidden
@@ -138,7 +138,7 @@ scall 'getrlimit$sysv' 0x00c200c220c20061 globl hidden
scall 'getrusage$sysv' 0x0013007520750062 globl hidden
scall 'sysinfo$sysv' 0xffffffffffff0063 globl hidden
scall 'times$sysv' 0xffffffffffff0064 globl hidden
-scall ptrace 0x001a001a201a0065 globl
+scall 'ptrace$sysv' 0x001a001a201a0065 globl hidden
scall syslog 0xffffffffffff0067 globl
scall 'getuid$sysv' 0x0018001820180066 globl hidden
scall 'getgid$sysv' 0x002f002f202f0068 globl hidden
@@ -242,7 +242,7 @@ scall lookup_dcookie 0xffffffffffff00d4 globl
scall 'epoll_create$sysv' 0xffffffffffff00d5 globl
scall 'epoll_wait$sysv' 0xffffffffffff00e8 globl
scall 'epoll_ctl$sysv' 0xffffffffffff00e9 globl
-scall getdents 0x00630110ffff00d9 globl hidden # getdents64 on linux
+scall getdents 0x0063011020c400d9 globl hidden # four args b/c xnu, getdirentries on xnu, 32-bit on xnu/freebsd, getdents64 on linux, 64-bit on openbsd
scall set_tid_address 0xffffffffffff00da globl
scall restart_syscall 0xffffffffffff00db globl
scall semtimedop 0xffffffffffff00dc globl
@@ -299,12 +299,12 @@ scall 'sync_file_range$sysv' 0xffffffffffff0115 globl hidden # Linux 2.6.17+
scall 'vmsplice$sysv' 0xffffffffffff0116 globl hidden
scall migrate_pages 0xffffffffffff0100 globl # numa numa yay
scall move_pages 0xffffffffffff0117 globl # NOTE: We view Red Hat versions as "epochs" for all distros.
-#──────────────────────RHEL 5.0 LIMIT──────────────────────── # ←┬─ last gplv2 distro w/ sysv init was rhel5 c. 2007
-scall '__preadv$sysv' 0x010b0121ffff0127 globl hidden # ├─ cosmopolitan at minimum requires rhel5
-scall '__pwritev$sysv' 0x010c0122ffff0128 globl hidden # ├─ python modules need to work on this (pep513)
-scall '__utimensat$sysv' 0x00540223ffff0118 globl hidden # └─ end of life 2020-11-30 (extended)
-scall 'fallocate$sysv' 0xffffffffffff011d globl hidden
-scall 'posix_fallocate$sysv' 0xffff0212ffffffff globl hidden
+#──────────────────────RHEL 5.0 LIMIT──────────────────────── # ←┬─ last distro with gplv2 licensed compiler c. 2007
+scall '__preadv$sysv' 0x010b0121ffff0127 globl hidden # ├─ last distro with system v shell script init
+scall '__pwritev$sysv' 0x010c0122ffff0128 globl hidden # ├─ rob landley unleashes busybox gpl lawsuits
+scall '__utimensat$sysv' 0x00540223ffff0118 globl hidden # ├─ python modules need this due to pep513
+scall 'fallocate$sysv' 0xffffffffffff011d globl hidden # ├─ end of life 2020-11-30 (extended)
+scall 'posix_fallocate$sysv' 0xffff0212ffffffff globl hidden # └─ cosmopolitan supports rhel5+
scall '__accept4$sysv' 0x005d021dffff0120 globl hidden # Linux 2.6.28+
scall '__dup3$sysv' 0x0066ffffffff0124 globl hidden # Linux 2.6.27+
scall '__pipe2$sysv' 0x0065021effff0125 globl hidden # Linux 2.6.27+
@@ -320,10 +320,10 @@ scall eventfd2 0xffffffffffff0122 globl # won't polyfill; see INTON/INTOFF tuto
scall timerfd_create 0xffffffffffff011b globl # won't polyfill; see INTON/INTOFF tutorial in examples/unbourne.c
scall timerfd_settime 0xffffffffffff011e globl # won't polyfill; see INTON/INTOFF tutorial in examples/unbourne.c
scall timerfd_gettime 0xffffffffffff011f globl # won't polyfill; see INTON/INTOFF tutorial in examples/unbourne.c
-#──────────────────────RHEL 6.0 LIMIT──────────────────────── # ←┬─ modern glibc at minimum requires rhel6+
-scall recvmmsg 0xffffffffffff012b globl # └─ end of life 2024-06-30 (extended)
-scall fanotify_init 0xffffffffffff012c globl
-scall fanotify_mark 0xffffffffffff012d globl
+#──────────────────────RHEL 6.0 LIMIT──────────────────────── # ←┬─ modern glibc needs rhel6+ c. 2011
+scall recvmmsg 0xffffffffffff012b globl # ├─ end of life 2024-06-30 (extended)
+scall fanotify_init 0xffffffffffff012c globl # ├─ last distro with the original gnome desktop
+scall fanotify_mark 0xffffffffffff012d globl # └─ apple and google condemn the gplv3/gccrtev3
scall prlimit 0xffffffffffff012e globl
scall name_to_handle_at 0xffffffffffff012f globl
scall open_by_handle_at 0xffffffffffff0130 globl
@@ -336,10 +336,10 @@ scall process_vm_readv 0xffffffffffff0136 globl
scall process_vm_writev 0xffffffffffff0137 globl
scall kcmp 0xffffffffffff0138 globl
scall finit_module 0xffffffffffff0139 globl
-#──────────────────────RHEL 7.0 LIMIT──────────────────────── # ←┬─ distros switched to systemd
-scall sched_setattr 0xffffffffffff013a globl # └─ C++11 needs this
-scall sched_getattr 0xffffffffffff013b globl
-scall renameat2 0xffffffffffff013c globl
+#──────────────────────RHEL 7.0 LIMIT──────────────────────── # ←┬─ anything that links or uses c++11 code needs rhel7+ c. 2014
+scall sched_setattr 0xffffffffffff013a globl # ├─ desktop replaced with tablet-first gui inspired by mac os x
+scall sched_getattr 0xffffffffffff013b globl # ├─ karen sandler requires systemd init and boot for tablet gui
+scall renameat2 0xffffffffffff013c globl # └─ debian founder ian murdock found strangled with vacuum cord
scall seccomp 0xffffffffffff013d globl
scall 'getrandom$sysv' 0x0007023321f4013e globl hidden # Linux 3.17+ and getentropy() on XNU/OpenBSD
scall memfd_create 0xffffffffffff013f globl # wut
@@ -349,7 +349,7 @@ scall execveat 0xffffffffffff0142 globl
scall userfaultfd 0xffffffffffff0143 globl # Linux 4.3+ (c. 2015)
scall membarrier 0xffffffffffff0144 globl # Linux 4.3+ (c. 2015)
scall mlock2 0xffffffffffff0145 globl # Linux 4.5+ (c. 2016)
-scall 'copy_file_range$sysv' 0xffffffffffff0146 globl hidden # Linux 4.5+ (c. 2016)
+scall 'copy_file_range$sysv' 0xffff0239ffff0146 globl hidden # Linux 4.5+ (c. 2016), FreeBSD 13+
scall preadv2 0xffffffffffff0147 globl
scall pwritev2 0xffffffffffff0148 globl
scall pkey_mprotect 0xffffffffffff0149 globl
@@ -358,12 +358,13 @@ scall pkey_free 0xffffffffffff014b globl
scall statx 0xffffffffffff014c globl # lool https://lkml.org/lkml/2010/7/22/249
scall io_pgetevents 0xffffffffffff014d globl
scall rseq 0xffffffffffff014e globl # Linux 4.18+ (c. 2018)
-#──────────────────────LINUX 4.18 LIMIT────────────────────── # ← last kernel buildable w/ gplv2 libraries
-scall pidfd_send_signal 0xffffffffffff01a8 globl # won't polyfill; see INTON/INTOFF tutorial in examples/unbourne.c
-scall io_uring_setup 0xffffffffffff01a9 globl # Linux 5.1+ (c. 2019)
-scall io_uring_enter 0xffffffffffff01aa globl # Linux 5.1+ (c. 2019)
-scall io_uring_register 0xffffffffffff01ab globl # Linux 5.1+ (c. 2019)
-scall pledge 0x006cffffffffffff globl # it's cross-platorm if you ignore the return code
+#──────────────────────LINUX 4.18 LIMIT────────────────────── # ←┬─ last version of linux kernel buildable with only gplv2
+scall pidfd_send_signal 0xffffffffffff01a8 globl # ├─ linux conferences ban linux founder linus torvalds
+scall io_uring_setup 0xffffffffffff01a9 globl # └─ gnu founder richard stallman publicly disgraced
+scall io_uring_enter 0xffffffffffff01aa globl
+scall io_uring_register 0xffffffffffff01ab globl
+#────────────────────────RHEL CLOUD────────────────────────── # ←┬─ red hat terminates community release of enterprise linux circa 2020
+scall pledge 0x006cffffffffffff globl # └─ online linux services ban the president of united states of america
# The Fifth Bell System Interface, Community Edition
# » besiyata dishmaya
@@ -391,7 +392,7 @@ scall unmount 0x00160016209fffff globl
scall issetugid 0x00fd00fd2147ffff globl
scall minherit 0x00fa00fa20faffff globl
scall pathconf 0x00bf00bf20bfffff globl
-scall sysctl 0x00caffff20caffff globl
+scall sysctl 0x00ca00ca20caffff globl
#───────────────────────XNU & FREEBSD────────────────────────
scall ntp_adjtime 0xffff00b0220fffff globl
scall ntp_gettime 0xffff00f82210ffff globl
@@ -415,7 +416,7 @@ scall setauid 0xffff01c02162ffff globl
scall audit 0xffff01bd215effff globl
scall auditctl 0xffff01c52167ffff globl
scall getaudit_addr 0xffff01c32165ffff globl
-scall getdirentries 0xffff022a2158ffff globl
+scall getdirentries 0xffff022a20c4ffff globl # xnu getdirentries64 is 0x158
scall lio_listio 0xffff01402140ffff globl
scall setaudit_addr 0xffff01c42166ffff globl
scall getauid 0xffff01bf2161ffff globl
diff --git a/libc/sysv/systemfive.S b/libc/sysv/systemfive.S
index 369fde45..b980fb59 100644
--- a/libc/sysv/systemfive.S
+++ b/libc/sysv/systemfive.S
@@ -68,19 +68,27 @@ __hostos:
/ Performs System Five System Call.
/
/ Cosmopolitan is designed to delegate all function calls into the
-/ Linux, FreeBSD, OpenBSD, and XNU kernels through this function,
-/ with few exceptions. This function is intended to be called via
+/ Linux, FreeBSD, OpenBSD, and XNU kernels via this function, with
+/ few exceptions. This function should generally only be called by
/ generated thunks in the libc/sysv/syscalls/ directory.
/
-/ It's safe to call this function on Windows, where it'll always
-/ return -1 w/ errno == ENOSYS. Further note that -1 is the only
+/ It's safe to call this function on Windows, where it will always
+/ return -1 with errno == ENOSYS. Further note that -1 is the only
/ return value that means error, a common anti-pattern is to check
/ for values less than 0 (which is more problematic on 32-bit).
/
-/ It's important to consider that system calls are an order of a
+/ It is important to consider that system calls are one order of a
/ magnitude more expensive than normal function calls. For example
/ getpid() on Linux usually takes 500ns, and cached i/o calls will
-/ take 1µs or more.
+/ take 1µs or more. So we don't need to inline them like Chromium.
+/
+/ Another thing to consider is that BSDs only loosely follow the
+/ System Five ABI for the SYSCALL instruction. For example Linux
+/ always follows the six argument limit but the FreeBSD sendfile
+/ system call accepts a seventh argument that is passed on stack
+/ and OpenBSD modifies functions like mmap so that the sixth arg
+/ is passed on the stack. There's also the carry flag convention
+/ that XNU, FreeBSD, and OpenBSD inherited from 386BSD aka Jolix
/
/ @param %rax function ordinal supplied by jump slot
/ @param %rdi,%rsi,%rdx,%rcx,%r8,%r9 and rest on stack
@@ -93,16 +101,16 @@ __systemfive:
.previous
.Lanchorpoint:
systemfive.linux:
- movswl %ax,%eax
- test %eax,%eax
- js systemfive.enosys
- mov %rcx,%r10
- push %rbp
- mov %rsp,%rbp
- syscall
- pop %rbp
- cmp $-4095,%rax
- jae systemfive.error
+ movswl %ax,%eax # gnu/systemd ordinal is first word
+ test %eax,%eax # sign extend to optimize code size
+ js systemfive.enosys # test for syscalls.sh ordinal ffff
+ mov %rcx,%r10 # syscall instruction clobbers %rcx
+ push %rbp # linux never reads args from stack
+ mov %rsp,%rbp # having frame will help backtraces
+ syscall # this is known as a context switch
+ pop %rbp # next we check to see if it failed
+ cmp $-4095,%rax # system five nexgen32e abi § A.2.1
+ jae systemfive.error # encodes errno as neg return value
ret
.endfn systemfive.linux,globl,hidden
systemfive.error:
@@ -110,10 +118,9 @@ systemfive.error:
/ 𝑠𝑙𝑖𝑑𝑒
.endfn systemfive.error,globl,hidden
systemfive.errno:
- mov %eax,errno(%rip)
- push $-1
- pop %rax
- stc
+ mov %eax,errno(%rip) # normalize to c library convention
+ push $-1 # negative one is only error result
+ pop %rax # the push pop is to save code size
ret
.endfn systemfive.errno,globl,hidden
systemfive.enosys:
@@ -132,20 +139,16 @@ systemfive.freebsd:
systemfive.bsd:
cmp $0xfff,%ax
jae systemfive.enosys
- mov %rcx,%r10
- push %rbp
- mov %rsp,%rbp
- syscall
- pop %rbp
- jc systemfive.errno
+ mov %rcx,%r10 # note: we do not create a stack frame
+ syscall # bsd will need arg on stack sometimes
+ jc systemfive.errno # bsd sets carry flag if %rax is errno
ret
.endfn systemfive.bsd
systemfive.xnu:
-/ do this to rax
-/ 0x????????2153????
+/ 0x????????2153???? # how syscalls.sh encodes xnu ordinals
/ │└┴┴─┐
/ └┐ ├┬┐
-/ 0x0000000002000153
+/ 0x0000000002000153 # how xnu wants ordinals to be encoded
mov %eax,%r11d
shr $4*7,%r11d
shl $4*6,%r11d
diff --git a/libc/testlib/showerror_.c b/libc/testlib/showerror_.c
index 3b24eeed..f0d61c09 100644
--- a/libc/testlib/showerror_.c
+++ b/libc/testlib/showerror_.c
@@ -27,6 +27,7 @@
#include "libc/nt/runtime.h"
#include "libc/runtime/runtime.h"
#include "libc/stdio/stdio.h"
+#include "libc/str/str.h"
#include "libc/testlib/testlib.h"
STATIC_YOINK("__isfdkind");
@@ -41,10 +42,14 @@ const char *testlib_showerror_symbol;
testonly void testlib_showerror_(int line, const char *wantcode,
const char *gotcode, char *FREED_want,
char *FREED_got, const char *fmt, ...) {
+ int err;
va_list va;
+ char hostname[32];
+ err = errno;
- getpid$sysv(); /* make strace easier to read */
- getpid$sysv();
+ /* make strace easier to read */
+ getpid();
+ getpid();
fflush(stdout);
fflush(stderr);
@@ -77,10 +82,12 @@ testonly void testlib_showerror_(int line, const char *wantcode,
fputc('\n', stderr);
}
+ strcpy(hostname, "unknown");
+ gethostname(hostname, sizeof(hostname));
fprintf(stderr,
"\t%s%s\n"
- "\t%s%s\n",
- SUBTLE, strerror(errno), program_invocation_name, RESET);
+ "\t%s @ %s%s\n",
+ SUBTLE, strerror(err), program_invocation_name, hostname, RESET);
free_s(&FREED_want);
free_s(&FREED_got);
diff --git a/libc/zipos/close.c b/libc/zipos/close.c
index 7df9e8ab..6be9b02d 100644
--- a/libc/zipos/close.c
+++ b/libc/zipos/close.c
@@ -35,7 +35,9 @@ int __zipos_close(int fd) {
} else {
CloseHandle(h->handle);
}
- free(h->freeme);
- free(h);
+ if (!__vforked) {
+ free(h->freeme);
+ free(h);
+ }
return 0;
}
diff --git a/net/http/http.mk b/net/http/http.mk
index 786faca4..c9b1260a 100644
--- a/net/http/http.mk
+++ b/net/http/http.mk
@@ -27,7 +27,6 @@ NET_HTTP_A_CHECKS = \
$(NET_HTTP_A_HDRS:%=o/$(MODE)/%.ok)
NET_HTTP_A_DIRECTDEPS = \
- LIBC_ALG \
LIBC_CALLS \
LIBC_FMT \
LIBC_INTRIN \
diff --git a/net/http/negotiatehttprequest.c b/net/http/negotiatehttprequest.c
index c41e2b4e..fa58546d 100644
--- a/net/http/negotiatehttprequest.c
+++ b/net/http/negotiatehttprequest.c
@@ -16,11 +16,11 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/alg/alg.h"
#include "libc/calls/calls.h"
#include "libc/macros.h"
#include "libc/math.h"
#include "libc/sock/sock.h"
+#include "libc/str/str.h"
#include "libc/sysv/consts/poll.h"
#include "libc/sysv/consts/shut.h"
#include "libc/sysv/errfuns.h"
diff --git a/test/ape/lib/test.mk b/test/ape/lib/test.mk
index f828c440..172126f7 100644
--- a/test/ape/lib/test.mk
+++ b/test/ape/lib/test.mk
@@ -24,7 +24,6 @@ TEST_APE_LIB_CHECKS = \
TEST_APE_LIB_DIRECTDEPS = \
APE_LIB \
- LIBC_CALLS_HEFTY \
LIBC_INTRIN \
LIBC_LOG \
LIBC_NEXGEN32E \
diff --git a/test/libc/alg/replacestr_test.c b/test/libc/alg/replacestr_test.c
index f0b107fc..e7721c98 100644
--- a/test/libc/alg/replacestr_test.c
+++ b/test/libc/alg/replacestr_test.c
@@ -20,20 +20,20 @@
#include "libc/errno.h"
#include "libc/testlib/testlib.h"
-#define S(x) x
-#define REPLACESTR replacestr
-#include "test/libc/alg/replacestr_test.inc"
-#undef REPLACESTR
-#undef S
+TEST(replacestr, demo) {
+ EXPECT_STREQ("hello friends", replacestr("hello world", "world", "friends"));
+ EXPECT_STREQ("bbbbbbbb", replacestr("aaaa", "a", "bb"));
+}
-#define S(x) u##x
-#define REPLACESTR replacestr16
-#include "test/libc/alg/replacestr_test.inc"
-#undef REPLACESTR
-#undef S
+TEST(replacestr, emptyString) {
+ EXPECT_STREQ("", replacestr("", "x", "y"));
+}
-/* #define S(x) L##x */
-/* #define REPLACESTR replacewcs */
-/* #include "test/libc/alg/replacestr_test.inc" */
-/* #undef REPLACESTR */
-/* #undef S */
+TEST(replacestr, emptyNeedle) {
+ EXPECT_EQ(NULL, replacestr("a", "", "a"));
+ EXPECT_EQ(EINVAL, errno);
+}
+
+TEST(replacestr, needleInReplacement_doesntExplode) {
+ EXPECT_STREQ("xxxxxxx", replacestr("x", "x", "xxxxxxx"));
+}
diff --git a/test/libc/alg/test.mk b/test/libc/alg/test.mk
index 1c2fb6bf..5ff888ef 100644
--- a/test/libc/alg/test.mk
+++ b/test/libc/alg/test.mk
@@ -23,7 +23,6 @@ TEST_LIBC_ALG_CHECKS = \
TEST_LIBC_ALG_DIRECTDEPS = \
LIBC_ALG \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_LOG \
diff --git a/test/libc/calls/fallocate_test.c b/test/libc/calls/fallocate_test.c
index 0cad467f..fd555624 100644
--- a/test/libc/calls/fallocate_test.c
+++ b/test/libc/calls/fallocate_test.c
@@ -38,13 +38,16 @@ TEST(fallocate_000, setup) {
}
TEST(fallocate_010, testBadFileDescriptor) {
- if (IsFreebsd()) return; /* TODO: FreeBSD failing to set carry flag bug */
- ASSERT_EQ(-1, fallocate(/*RHEL*/ 5, 0, 0, 1));
- if (errno == ENOSYS) exit(0);
+ if (IsOpenbsd()) return; /* ENOSYS */
+ if (IsFreebsd()) return; /* TODO: Where's my carry flag FreeBSD? */
+ close(70); /* just in case */
+ ASSERT_EQ(-1, fallocate(/*RHEL*/ 70, 0, 0, 1));
+ if (errno == ENOSYS) exit(0); /* RHEL5 */
EXPECT_EQ(EBADF, errno);
}
TEST(fallocate_020, test) {
+ if (IsOpenbsd()) return; /* ENOSYS */
path = gc(xasprintf("o/tmp/%s.%d", program_invocation_short_name));
ASSERT_NE(-1, (fd = creat(path, 0755)));
ASSERT_EQ(5, write(fd, "hello", 5));
@@ -60,6 +63,8 @@ TEST(fallocate_020, test) {
}
TEST(fallocate_020, testSparseFile) {
+ if (IsOpenbsd()) return; /* ENOSYS */
+ if (IsWindows()) return; /* TODO */
ASSERT_NE(-1, stat("o", &st));
emptyspace = rounddown(6 * 1000 * 1000 * 1000, st.st_blksize);
physicalspace = roundup(4096, st.st_blksize);
diff --git a/libc/calls/hefty/spawnlp.c b/test/libc/calls/hefty/fork_test.c
similarity index 51%
rename from libc/calls/hefty/spawnlp.c
rename to test/libc/calls/hefty/fork_test.c
index fa2b76cd..5d737c93 100644
--- a/libc/calls/hefty/spawnlp.c
+++ b/test/libc/calls/hefty/fork_test.c
@@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
@@ -17,37 +17,62 @@
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
-#include "libc/calls/hefty/mkvarargv.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/mem/mem.h"
#include "libc/runtime/runtime.h"
+#include "libc/sysv/consts/map.h"
+#include "libc/sysv/consts/msync.h"
+#include "libc/sysv/consts/prot.h"
+#include "libc/testlib/testlib.h"
-/**
- * Launches program, with PATH search and current environment.
- *
- * @param stdiofds may optionally be passed to customize standard i/o
- * @param stdiofds[𝑖] may be -1 to receive a pipe() fd
- * @param prog is program to launch (may be PATH searched)
- * @param arg[0] is the name of the program to run
- * @param arg[1,n-2] optionally specify program arguments
- * @param arg[n-1] is NULL
- * @return pid of child, or -1 w/ errno
- */
-nodiscard int spawnlp(unsigned flags, int stdiofds[3], const char *prog,
- const char *arg, ... /*, NULL*/) {
- int pid;
- char *exe;
- va_list va;
- void *argv;
- char pathbuf[PATH_MAX];
- pid = -1;
- if ((exe = commandv(prog, pathbuf))) {
- va_start(va, arg);
- if ((argv = mkvarargv(arg, va))) {
- pid = spawnve(flags, stdiofds, exe, argv, environ);
- free(argv);
- }
- va_end(va);
+TEST(fork, testPipes) {
+ int a, b;
+ int ws, pid;
+ int pipefds[2];
+ ASSERT_NE(-1, pipe(pipefds));
+ ASSERT_NE(-1, (pid = fork()));
+ if (!pid) {
+ a = 31337;
+ close(pipefds[0]);
+ write(pipefds[1], &a, sizeof(a));
+ close(pipefds[1]);
+ _exit(0);
}
- return pid;
+ EXPECT_NE(-1, close(pipefds[1]));
+ EXPECT_EQ(sizeof(b), read(pipefds[0], &b, sizeof(b)));
+ EXPECT_NE(-1, close(pipefds[0]));
+ EXPECT_NE(-1, waitpid(pid, &ws, 0));
+ EXPECT_EQ(31337, b);
+}
+
+TEST(fork, testSharedMemory) {
+ int ws, pid;
+ int stackvar;
+ int *sharedvar;
+ int *privatevar;
+ EXPECT_NE(MAP_FAILED,
+ (sharedvar = mmap(NULL, FRAMESIZE, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_ANONYMOUS, -1, 0)));
+ EXPECT_NE(MAP_FAILED,
+ (privatevar = mmap(NULL, FRAMESIZE, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)));
+ stackvar = 1;
+ *sharedvar = 1;
+ *privatevar = 1;
+ EXPECT_NE(-1, (pid = fork()));
+ if (!pid) {
+ EXPECT_EQ(NULL, getenv("_FORK"));
+ ++stackvar;
+ ++*sharedvar;
+ ++*privatevar;
+ msync((void *)ROUNDDOWN((intptr_t)&stackvar, FRAMESIZE), FRAMESIZE,
+ MS_SYNC);
+ EXPECT_NE(-1, msync(privatevar, FRAMESIZE, MS_SYNC));
+ EXPECT_NE(-1, msync(sharedvar, FRAMESIZE, MS_SYNC));
+ _exit(0);
+ }
+ EXPECT_NE(-1, waitpid(pid, &ws, 0));
+ EXPECT_EQ(1, stackvar);
+ EXPECT_EQ(2, *sharedvar);
+ EXPECT_EQ(1, *privatevar);
+ EXPECT_NE(-1, munmap(sharedvar, FRAMESIZE));
+ EXPECT_NE(-1, munmap(privatevar, FRAMESIZE));
}
diff --git a/test/libc/calls/hefty/spawnve_test.c b/test/libc/calls/hefty/spawnve_test.c
deleted file mode 100644
index 03b3af82..00000000
--- a/test/libc/calls/hefty/spawnve_test.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
-│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
-╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
-│ │
-│ Permission to use, copy, modify, and/or distribute this software for │
-│ any purpose with or without fee is hereby granted, provided that the │
-│ above copyright notice and this permission notice appear in all copies. │
-│ │
-│ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL │
-│ WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED │
-│ WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE │
-│ AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL │
-│ DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR │
-│ PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER │
-│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
-│ PERFORMANCE OF THIS SOFTWARE. │
-╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/calls/calls.h"
-#include "libc/calls/hefty/spawn.h"
-#include "libc/dce.h"
-#include "libc/errno.h"
-#include "libc/runtime/runtime.h"
-#include "libc/str/str.h"
-#include "libc/sysv/consts/auxv.h"
-#include "libc/sysv/consts/exit.h"
-#include "libc/sysv/consts/fileno.h"
-#include "libc/testlib/testlib.h"
-
-/*
- * TODO: Re-enable me.
- *
- * Multiple users have reported that this test fails, for reasons that
- * are currently unknown. It's possible that, some type of environment
- * variable configuration, e.g. PATH, CC, etc. is causing the failure.
- *
- * https://github.com/jart/cosmopolitan/issues/14
- */
-#if 0
-
-#define CMD (IsWindows() ? "cmd" : "sh")
-#define ARG (IsWindows() ? "/c" : "-c")
-#define COD (IsWindows() ? "echo %BOOP%" : "echo $BOOP")
-#define OUT (IsWindows() ? u"hello♪◙" : u"hello◙")
-
-TEST(spawnve, testIpc) {
- ssize_t got;
- int pid, wstatus;
- char buf[16] = {0};
- int tubes[3] = {STDIN_FILENO, -1, STDERR_FILENO};
- errno = 0;
- setenv("BOOP", "hello", true);
- ASSERT_EQ(0, errno);
- ASSERT_NE(-1, (pid = spawnlp(0, tubes, CMD, CMD, ARG, COD, NULL)));
- ASSERT_EQ(0, errno);
- ASSERT_NE(-1, (got = read(tubes[1], buf, sizeof(buf))));
- ASSERT_EQ(0, errno);
- ASSERT_NE(-1, waitpid(pid, &wstatus, 0));
- ASSERT_EQ(0, errno);
- EXPECT_EQ(0, WEXITSTATUS(wstatus));
- EXPECT_BINEQ(OUT, buf);
-}
-
-TEST(spawnve, testExit) {
- int pid, wstatus;
- ASSERT_NE(-1, (pid = spawnlp(0, NULL, CMD, CMD, ARG, "exit 42", NULL)));
- ASSERT_NE(-1, waitpid(pid, &wstatus, 0));
- EXPECT_EQ(42, WEXITSTATUS(wstatus));
-}
-
-TEST(spawnve, testSpawnSelf) {
- int pid, wstatus;
- ASSERT_NE(-1,
- (pid = spawnlp(0, NULL, (const char *)getauxval(AT_EXECFN),
- program_invocation_name, "--testSpawnSelf", NULL)));
- ASSERT_NE(-1, waitpid(pid, &wstatus, 0));
- EXPECT_EQ(123, WEXITSTATUS(wstatus));
-}
-static textstartup void onspawnself() {
- if (g_argc > 1 && strcmp(g_argv[1], "--testSpawnSelf") == 0) {
- _exit(123);
- }
-}
-const void *const onspawnself_ctor[] initarray = {onspawnself};
-
-#endif /* #if 0 */
diff --git a/tool/decode/getdents.c b/test/libc/calls/hefty/vfork_test.c
similarity index 71%
rename from tool/decode/getdents.c
rename to test/libc/calls/hefty/vfork_test.c
index b4f5554c..1ce18ab5 100644
--- a/tool/decode/getdents.c
+++ b/test/libc/calls/hefty/vfork_test.c
@@ -1,7 +1,7 @@
/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
-│ Copyright 2020 Justine Alexandra Roberts Tunney │
+│ Copyright 2021 Justine Alexandra Roberts Tunney │
│ │
│ Permission to use, copy, modify, and/or distribute this software for │
│ any purpose with or without fee is hereby granted, provided that the │
@@ -18,32 +18,29 @@
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/calls/calls.h"
#include "libc/calls/internal.h"
-#include "libc/mem/mem.h"
-#include "libc/stdio/stdio.h"
-#include "libc/str/str.h"
+#include "libc/runtime/runtime.h"
#include "libc/sysv/consts/o.h"
+#include "libc/testlib/testlib.h"
-int main(int argc, char *argv[]) {
- char *p;
- int i, j, rc, fd;
- char16_t glyphs[17] = {0};
- p = malloc(4096);
- fd = open(".", O_RDONLY | O_DIRECTORY | O_CLOEXEC, 0);
- if ((rc = getdents(fd, p, 4096)) != -1) {
- for (i = 0; i < ROUNDUP(rc, 16); ++i) {
- if (i % 16 == 0) printf("%08x ", i);
- if (i < rc) {
- glyphs[i % 16] = kCp437[p[i] & 0xff];
- printf("%02x ", p[i] & 0xff);
- } else {
- glyphs[i % 16] = u'\0';
- printf(" ");
- }
- if (i % 8 == 7) printf(" ");
- if (i % 16 == 15) printf("%hs\n", glyphs);
- }
+#define PATH "o/vfork_test"
+
+TEST(vfork, test) {
+ int fd;
+ char buf[8] = {0};
+ mkdir("o", 0755);
+ ASSERT_NE(-1, (fd = open(PATH, O_RDWR | O_CREAT, 0644)));
+ ASSERT_EQ(5, write(fd, "hello", 5));
+ ASSERT_NE(-1, lseek(fd, 0, SEEK_SET));
+ if (!vfork()) {
+ EXPECT_EQ(5, pread(fd, buf, 5, 0));
+ EXPECT_STREQ("hello", buf);
+ EXPECT_NE(-1, close(fd));
+ _exit(0);
}
- close(fd);
- free(p);
- return 0;
+ EXPECT_EQ(0, __vforked);
+ EXPECT_EQ(5, read(fd, buf, 5));
+ EXPECT_STREQ("hello", buf);
+ EXPECT_NE(-1, close(fd));
+ EXPECT_NE(-1, wait(0));
+ unlink(PATH);
}
diff --git a/test/libc/calls/hefty/mkntcmdline_test.c b/test/libc/calls/mkntcmdline_test.c
similarity index 69%
rename from test/libc/calls/hefty/mkntcmdline_test.c
rename to test/libc/calls/mkntcmdline_test.c
index 6e5db653..6e72d406 100644
--- a/test/libc/calls/hefty/mkntcmdline_test.c
+++ b/test/libc/calls/mkntcmdline_test.c
@@ -16,61 +16,70 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
-#include "libc/calls/hefty/ntspawn.h"
+#include "libc/calls/ntspawn.h"
#include "libc/errno.h"
#include "libc/mem/mem.h"
#include "libc/runtime/gc.h"
#include "libc/str/str.h"
#include "libc/testlib/testlib.h"
-TEST(mkntcmdline, emptyArgvList_isntValidCommandLine) {
+char16_t cmdline[ARG_MAX];
+
+TEST(mkntcmdline, emptyArgvList_isEmpty) {
char *argv[] = {NULL};
- EXPECT_EQ(NULL, gc(mkntcmdline(argv)));
- EXPECT_EQ(EINVAL, errno);
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"", cmdline);
}
-TEST(mkntcmdline, emptyArgs_isEmptyString) {
+TEST(mkntcmdline, emptyArg_getsQuoted) {
char *argv[] = {"", NULL};
- EXPECT_STREQ(u"", gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"\"\"", cmdline);
}
TEST(mkntcmdline, ignoranceIsBliss) {
char *argv[] = {"echo", "hello", "world", NULL};
- EXPECT_STREQ(u"echo hello world", gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"echo hello world", cmdline);
}
TEST(mkntcmdline, spaceInArgument_getQuotesWrappedAround) {
char *argv[] = {"echo", "hello there", "world", NULL};
- EXPECT_STREQ(u"echo \"hello there\" world", gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"echo \"hello there\" world", cmdline);
}
TEST(mkntcmdline, justQuote) {
char *argv[] = {"\"", NULL};
- EXPECT_STREQ(u"\"\\\"\"", gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"\"\\\"\"", cmdline);
}
TEST(mkntcmdline, justSlash) {
char *argv[] = {"\\", NULL};
- EXPECT_STREQ(u"\\", gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"\\", cmdline);
}
TEST(mkntcmdline, justSlashQuote) {
char *argv[] = {"\\\"", NULL};
- EXPECT_STREQ(u"\"\\\\\\\"\"" /* "\\\"" */, gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"\"\\\\\\\"\"" /* "\\\"" */, cmdline);
}
TEST(mkntcmdline, basicQuoting) {
char *argv[] = {"a\"b c", "d", NULL};
- EXPECT_STREQ(u"\"a\\\"b c\" d" /* "a\"b c" d */, gc(mkntcmdline(argv)));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv));
+ EXPECT_STREQ(u"\"a\\\"b c\" d" /* "a\"b c" d */, cmdline);
}
TEST(mkntcmdline, testUnicode) {
char *argv1[] = {
- gc(strdup("(╯°□°)╯")),
- gc(strdup("要依法治国是赞美那些谁是公义的和惩罚恶人。 - 韩非")),
+ strdup("(╯°□°)╯"),
+ strdup("要依法治国是赞美那些谁是公义的和惩罚恶人。 - 韩非"),
NULL,
};
- EXPECT_STREQ(
- u"(╯°□°)╯ \"要依法治国是赞美那些谁是公义的和惩罚恶人。 - 韩非\"",
- gc(mkntcmdline(memcpy(gc(malloc(sizeof(argv1))), argv1, sizeof(argv1)))));
+ EXPECT_NE(-1, mkntcmdline(cmdline, argv1));
+ EXPECT_STREQ(u"(╯°□°)╯ \"要依法治国是赞美那些谁是公义的和惩罚恶人。 - 韩非\"",
+ cmdline);
}
diff --git a/test/libc/calls/hefty/mkntenvblock_test.c b/test/libc/calls/mkntenvblock_test.c
similarity index 83%
rename from test/libc/calls/hefty/mkntenvblock_test.c
rename to test/libc/calls/mkntenvblock_test.c
index 13c14084..cd4e395a 100644
--- a/test/libc/calls/hefty/mkntenvblock_test.c
+++ b/test/libc/calls/mkntenvblock_test.c
@@ -16,23 +16,26 @@
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
│ PERFORMANCE OF THIS SOFTWARE. │
╚─────────────────────────────────────────────────────────────────────────────*/
+#include "libc/calls/ntspawn.h"
#include "libc/runtime/gc.h"
-#include "libc/calls/hefty/ntspawn.h"
#include "libc/testlib/testlib.h"
+char16_t envvars[ARG_MAX];
+
TEST(mkntenvblock, emptyList_onlyOutputsDoubleNulStringTerminator) {
char *envp[] = {NULL};
- ASSERT_BINEQ(u" ", gc(mkntenvblock(envp)));
+ ASSERT_NE(-1, mkntenvblock(envvars, envp));
+ ASSERT_BINEQ(u" ", envvars);
}
TEST(mkntenvblock, envp_becomesSortedDoubleNulTerminatedUtf16String) {
char *envp[] = {"u=b", "c=d", "韩=非", "uh=d", "hduc=d", NULL};
- ASSERT_BINEQ(
- u"c = d "
- u"h d u c = d "
- u"u = b "
- u"u h = d "
- u"Θù= ^ù "
- u" ",
- gc(mkntenvblock(envp)));
+ ASSERT_NE(-1, mkntenvblock(envvars, envp));
+ ASSERT_BINEQ(u"c = d "
+ u"h d u c = d "
+ u"u = b "
+ u"u h = d "
+ u"Θù= ^ù "
+ u" ",
+ envvars);
}
diff --git a/test/libc/dns/test.mk b/test/libc/dns/test.mk
index 6189bf4b..199d621b 100644
--- a/test/libc/dns/test.mk
+++ b/test/libc/dns/test.mk
@@ -23,7 +23,6 @@ TEST_LIBC_DNS_CHECKS = \
$(TEST_LIBC_DNS_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
TEST_LIBC_DNS_DIRECTDEPS = \
- LIBC_CALLS_HEFTY \
LIBC_DNS \
LIBC_FMT \
LIBC_INTRIN \
diff --git a/test/libc/fmt/strerror_test.c b/test/libc/fmt/strerror_test.c
index 7e53ceb5..b6b60713 100644
--- a/test/libc/fmt/strerror_test.c
+++ b/test/libc/fmt/strerror_test.c
@@ -45,7 +45,7 @@ TEST(strerror, einval) {
}
TEST(strerror, symbolizingTheseNumbersAsErrorsIsHeresyInUnixStyle) {
- EXPECT_STARTSWITH("E?/err=0/errno:0/GetLastError:0", strerror(0));
+ EXPECT_STARTSWITH("E?", strerror(0));
EXPECT_STARTSWITH("E?", strerror(-1));
}
diff --git a/test/libc/fmt/test.mk b/test/libc/fmt/test.mk
index 8b2369b3..eaec2dba 100644
--- a/test/libc/fmt/test.mk
+++ b/test/libc/fmt/test.mk
@@ -19,7 +19,6 @@ TEST_LIBC_FMT_CHECKS = \
TEST_LIBC_FMT_DIRECTDEPS = \
LIBC_ALG \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_LOG \
diff --git a/test/libc/math/test.mk b/test/libc/math/test.mk
index 7d3919f1..f4d75341 100644
--- a/test/libc/math/test.mk
+++ b/test/libc/math/test.mk
@@ -22,7 +22,6 @@ TEST_LIBC_MATH_CHECKS = \
$(TEST_LIBC_MATH_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
TEST_LIBC_MATH_DIRECTDEPS = \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_MATH \
diff --git a/test/libc/nexgen32e/memset_test.c b/test/libc/nexgen32e/memset_test.c
index 9a07a67c..8dba4e06 100644
--- a/test/libc/nexgen32e/memset_test.c
+++ b/test/libc/nexgen32e/memset_test.c
@@ -19,6 +19,52 @@
#include "libc/nexgen32e/nexgen32e.h"
#include "libc/testlib/testlib.h"
+void *_memset(void *, int, size_t) asm("memset");
+
+TEST(memset, size0_doesNothing) {
+ _memset(NULL, 0, 0);
+}
+
+TEST(memset, size1) {
+ char *b = tgc(tmalloc(1));
+ _memset(b, 7, 1);
+ EXPECT_EQ(7, b[0]);
+}
+
+TEST(memset, size2) {
+ char *b = tgc(tmalloc(2));
+ _memset(b, 7, 2);
+ EXPECT_EQ(7, b[0]);
+ EXPECT_EQ(7, b[1]);
+}
+
+TEST(memset, size3) {
+ char *b = tgc(tmalloc(3));
+ _memset(b, 7, 3);
+ EXPECT_EQ(7, b[0]);
+ EXPECT_EQ(7, b[1]);
+ EXPECT_EQ(7, b[2]);
+}
+
+TEST(memset, size4) {
+ char *b = tgc(tmalloc(4));
+ _memset(b, 7, 4);
+ EXPECT_EQ(7, b[0]);
+ EXPECT_EQ(7, b[1]);
+ EXPECT_EQ(7, b[2]);
+ EXPECT_EQ(7, b[3]);
+}
+
+TEST(memset, size5) {
+ char *b = tgc(tmalloc(5));
+ _memset(b, 7, 5);
+ EXPECT_EQ(7, b[0]);
+ EXPECT_EQ(7, b[1]);
+ EXPECT_EQ(7, b[2]);
+ EXPECT_EQ(7, b[3]);
+ EXPECT_EQ(7, b[4]);
+}
+
TEST(memset, testMulTrick4) {
long i, j;
unsigned long x;
diff --git a/test/libc/nexgen32e/test.mk b/test/libc/nexgen32e/test.mk
index 4affd2f6..c86b2ad2 100644
--- a/test/libc/nexgen32e/test.mk
+++ b/test/libc/nexgen32e/test.mk
@@ -27,7 +27,6 @@ TEST_LIBC_NEXGEN32E_CHECKS = \
TEST_LIBC_NEXGEN32E_DIRECTDEPS = \
LIBC_ALG \
LIBC_CALLS \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_LOG \
diff --git a/test/libc/rand/test.mk b/test/libc/rand/test.mk
index 597abe9e..427367e7 100644
--- a/test/libc/rand/test.mk
+++ b/test/libc/rand/test.mk
@@ -19,7 +19,6 @@ TEST_LIBC_RAND_CHECKS = \
$(TEST_LIBC_RAND_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
TEST_LIBC_RAND_DIRECTDEPS = \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_NEXGEN32E \
diff --git a/test/libc/runtime/memtrack_test.c b/test/libc/runtime/memtrack_test.c
index ace4225c..8ad9d4f7 100644
--- a/test/libc/runtime/memtrack_test.c
+++ b/test/libc/runtime/memtrack_test.c
@@ -71,15 +71,18 @@ static void RunTrackMemoryIntervalTest(const struct MemoryIntervals t[2], int x,
free(mm);
}
-static void RunReleaseMemoryIntervalsTest(const struct MemoryIntervals t[2],
- int x, int y) {
+static int RunReleaseMemoryIntervalsTest(const struct MemoryIntervals t[2],
+ int x, int y) {
+ int rc;
struct MemoryIntervals *mm;
mm = memcpy(memalign(alignof(*t), sizeof(*t)), t, sizeof(*t));
CheckMemoryIntervalsAreOk(mm);
- CHECK_NE(-1, ReleaseMemoryIntervals(mm, x, y, NULL));
- CheckMemoryIntervalsAreOk(mm);
- CheckMemoryIntervalsEqual(t + 1, mm);
+ if ((rc = ReleaseMemoryIntervals(mm, x, y, NULL)) != -1) {
+ CheckMemoryIntervalsAreOk(mm);
+ CheckMemoryIntervalsEqual(t + 1, mm);
+ }
free(mm);
+ return rc;
}
TEST(TrackMemoryInterval, TestEmpty) {
@@ -182,7 +185,7 @@ TEST(ReleaseMemoryIntervals, TestEmpty) {
{0, {}},
{0, {}},
};
- RunReleaseMemoryIntervalsTest(mm, 2, 2);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 2, 2));
}
TEST(ReleaseMemoryIntervals, TestRemoveElement_UsesInclusiveRange) {
@@ -190,7 +193,7 @@ TEST(ReleaseMemoryIntervals, TestRemoveElement_UsesInclusiveRange) {
{3, {{0, 0}, {2, 2}, {4, 4}}},
{2, {{0, 0}, {4, 4}}},
};
- RunReleaseMemoryIntervalsTest(mm, 2, 2);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 2, 2));
}
TEST(ReleaseMemoryIntervals, TestPunchHole) {
@@ -198,39 +201,43 @@ TEST(ReleaseMemoryIntervals, TestPunchHole) {
{1, {{0, 9}}},
{2, {{0, 3}, {6, 9}}},
};
- RunReleaseMemoryIntervalsTest(mm, 4, 5);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 4, 5));
}
TEST(ReleaseMemoryIntervals, TestShortenLeft) {
+ if (IsWindows()) return;
static const struct MemoryIntervals mm[2] = {
{1, {{0, 9}}},
{1, {{0, 7}}},
};
- RunReleaseMemoryIntervalsTest(mm, 8, 9);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 8, 9));
}
TEST(ReleaseMemoryIntervals, TestShortenRight) {
+ if (IsWindows()) return;
static const struct MemoryIntervals mm[2] = {
{1, {{0, 9}}},
{1, {{3, 9}}},
};
- RunReleaseMemoryIntervalsTest(mm, 0, 2);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 0, 2));
}
TEST(ReleaseMemoryIntervals, TestShortenLeft2) {
+ if (IsWindows()) return;
static const struct MemoryIntervals mm[2] = {
{1, {{0, 9}}},
{1, {{0, 7}}},
};
- RunReleaseMemoryIntervalsTest(mm, 8, 11);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 8, 11));
}
TEST(ReleaseMemoryIntervals, TestShortenRight2) {
+ if (IsWindows()) return;
static const struct MemoryIntervals mm[2] = {
{1, {{0, 9}}},
{1, {{3, 9}}},
};
- RunReleaseMemoryIntervalsTest(mm, -3, 2);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, -3, 2));
}
TEST(ReleaseMemoryIntervals, TestZeroZero) {
@@ -238,7 +245,7 @@ TEST(ReleaseMemoryIntervals, TestZeroZero) {
{1, {{3, 9}}},
{1, {{3, 9}}},
};
- RunReleaseMemoryIntervalsTest(mm, 0, 0);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 0, 0));
}
TEST(ReleaseMemoryIntervals, TestNoopLeft) {
@@ -246,7 +253,7 @@ TEST(ReleaseMemoryIntervals, TestNoopLeft) {
{1, {{3, 9}}},
{1, {{3, 9}}},
};
- RunReleaseMemoryIntervalsTest(mm, 1, 2);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 1, 2));
}
TEST(ReleaseMemoryIntervals, TestNoopRight) {
@@ -254,7 +261,7 @@ TEST(ReleaseMemoryIntervals, TestNoopRight) {
{1, {{3, 9}}},
{1, {{3, 9}}},
};
- RunReleaseMemoryIntervalsTest(mm, 10, 10);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 10, 10));
}
TEST(ReleaseMemoryIntervals, TestBigFree) {
@@ -262,7 +269,7 @@ TEST(ReleaseMemoryIntervals, TestBigFree) {
{2, {{0, 3}, {6, 9}}},
{0, {}},
};
- RunReleaseMemoryIntervalsTest(mm, INT_MIN, INT_MAX);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, INT_MIN, INT_MAX));
}
TEST(ReleaseMemoryIntervals, TestWeirdGap) {
@@ -270,7 +277,7 @@ TEST(ReleaseMemoryIntervals, TestWeirdGap) {
{3, {{10, 10}, {20, 20}, {30, 30}}},
{2, {{10, 10}, {30, 30}}},
};
- RunReleaseMemoryIntervalsTest(mm, 15, 25);
+ EXPECT_NE(-1, RunReleaseMemoryIntervalsTest(mm, 15, 25));
}
TEST(ReleaseMemoryIntervals, TestOutOfMemory) {
diff --git a/test/libc/runtime/test.mk b/test/libc/runtime/test.mk
index 813b9215..6ba9a41a 100644
--- a/test/libc/runtime/test.mk
+++ b/test/libc/runtime/test.mk
@@ -25,7 +25,6 @@ TEST_LIBC_RUNTIME_CHECKS = \
TEST_LIBC_RUNTIME_DIRECTDEPS = \
LIBC_ALG \
LIBC_CALLS \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_LOG \
diff --git a/test/libc/sock/test.mk b/test/libc/sock/test.mk
index c0deafef..839da31e 100644
--- a/test/libc/sock/test.mk
+++ b/test/libc/sock/test.mk
@@ -24,7 +24,6 @@ TEST_LIBC_SOCK_CHECKS = \
TEST_LIBC_SOCK_DIRECTDEPS = \
LIBC_CALLS \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_NEXGEN32E \
diff --git a/test/libc/stdio/mkostempsm_test.c b/test/libc/stdio/mkostempsm_test.c
index b6374f04..f59abc40 100644
--- a/test/libc/stdio/mkostempsm_test.c
+++ b/test/libc/stdio/mkostempsm_test.c
@@ -45,6 +45,7 @@ static int MockOpen1(const char *file, int flags, ...) {
}
TEST(mkostempsm, test1) {
+ if (IsWindows()) return; /* TODO */
uint64_t rando = 1;
char path[PATH_MAX] = "/tmp/mkostemps.XXXXXX";
EXPECT_EQ(123L, mkostempsmi(path, 0, 0, &rando, 0600, MockOpen1));
@@ -73,6 +74,7 @@ static int MockOpen2(const char *file, int flags, ...) {
}
TEST(mkostempsm, test2) {
+ if (IsWindows()) return; /* TODO */
uint64_t rando = 1;
char path[PATH_MAX] = "/tmp/mkostemps.XXXXXX";
EXPECT_EQ(123, mkostempsmi(path, 0, 0, &rando, 0600, MockOpen2));
diff --git a/test/libc/stdio/test.mk b/test/libc/stdio/test.mk
index 2ba4d054..565fa0c0 100644
--- a/test/libc/stdio/test.mk
+++ b/test/libc/stdio/test.mk
@@ -25,7 +25,6 @@ TEST_LIBC_STDIO_CHECKS = \
TEST_LIBC_STDIO_DIRECTDEPS = \
LIBC_BITS \
LIBC_CALLS \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_MEM \
diff --git a/test/libc/alg/memmem_test.c b/test/libc/str/memmem_test.c
similarity index 100%
rename from test/libc/alg/memmem_test.c
rename to test/libc/str/memmem_test.c
diff --git a/test/libc/str/strlen_test.c b/test/libc/str/strlen_test.c
index 85711b56..d0399e31 100644
--- a/test/libc/str/strlen_test.c
+++ b/test/libc/str/strlen_test.c
@@ -136,7 +136,7 @@ TEST(tinystrnlen16, test) {
BENCH(strlen, bench) {
extern size_t strlen_(const char *) asm("strlen");
- static char b[1024];
+ static char b[2048];
memset(b, -1, sizeof(b) - 1);
EZBENCH2("strlen 1", donothing, strlen_(""));
EZBENCH2("strlen 2", donothing, strlen_("1"));
diff --git a/test/libc/str/test.mk b/test/libc/str/test.mk
index 34dbc1e1..a6dc739e 100644
--- a/test/libc/str/test.mk
+++ b/test/libc/str/test.mk
@@ -25,7 +25,6 @@ TEST_LIBC_STR_CHECKS = \
TEST_LIBC_STR_DIRECTDEPS = \
LIBC_ALG \
LIBC_CALLS \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_LOG \
diff --git a/test/libc/time/test.mk b/test/libc/time/test.mk
index a3b4d97e..4744b92d 100644
--- a/test/libc/time/test.mk
+++ b/test/libc/time/test.mk
@@ -19,7 +19,6 @@ TEST_LIBC_TIME_CHECKS = \
TEST_LIBC_TIME_DIRECTDEPS = \
LIBC_CALLS \
- LIBC_CALLS_HEFTY \
LIBC_INTRIN \
LIBC_LOG \
LIBC_MEM \
diff --git a/test/libc/tinymath/test.mk b/test/libc/tinymath/test.mk
index 68fa4edc..9ed495ad 100644
--- a/test/libc/tinymath/test.mk
+++ b/test/libc/tinymath/test.mk
@@ -23,7 +23,6 @@ TEST_LIBC_TINYMATH_CHECKS = \
$(TEST_LIBC_TINYMATH_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
TEST_LIBC_TINYMATH_DIRECTDEPS = \
- LIBC_CALLS_HEFTY \
LIBC_FMT \
LIBC_INTRIN \
LIBC_MEM \
diff --git a/test/libc/xed/test.mk b/test/libc/xed/test.mk
index 0a30a7f6..3de406a7 100644
--- a/test/libc/xed/test.mk
+++ b/test/libc/xed/test.mk
@@ -69,7 +69,6 @@ TEST_LIBC_XED_CHECKS = \
$(TEST_LIBC_XED_SRCS:%.c=o/$(MODE)/%.com.runs)
TEST_LIBC_XED_DIRECTDEPS = \
- LIBC_CALLS_HEFTY \
LIBC_INTRIN \
LIBC_MEM \
LIBC_NEXGEN32E \
diff --git a/test/tool/build/lib/divmul_test.c b/test/tool/build/lib/divmul_test.c
index c819da4c..35dade71 100644
--- a/test/tool/build/lib/divmul_test.c
+++ b/test/tool/build/lib/divmul_test.c
@@ -240,6 +240,7 @@ TEST(mul64, test) {
}
TEST(idiv8, test) {
+ if (IsWindows()) return; /* TODO */
static const uint8_t A[] = {0x00, 0x01, 0x80, 0x7F, 0x81, 0x7E, 0xFF, 0xBF};
uint16_t remquo;
bool gotthrow, gotsigfpe;
@@ -279,6 +280,7 @@ TEST(idiv8, test) {
}
TEST(idiv16, test) {
+ if (IsWindows()) return; /* TODO */
static const uint16_t A[] = {0x0000, 0x0001, 0x8000, 0x7FFF,
0x8001, 0x7FFE, 0xFFFF, 0xBeef};
bool gotthrow, gotsigfpe;
@@ -316,6 +318,7 @@ TEST(idiv16, test) {
}
TEST(idiv32, test) {
+ if (IsWindows()) return; /* TODO */
static const uint32_t A[] = {0x00000000, 0x00000001, 0x80000000, 0x7FFFFFFF,
0x80000001, 0x7FFFFFFE, 0xFFFFFFFF, 0xDeadBeef};
bool gotthrow, gotsigfpe;
@@ -353,6 +356,7 @@ TEST(idiv32, test) {
}
TEST(idiv64, test) {
+ if (IsWindows()) return; /* TODO */
static const uint64_t A[] = {0x0000000000000000, 0x0000000000000001,
0x8000000000000000, 0x7FFFFFFFFFFFFFFF,
0x8000000000000001, 0x7FFFFFFFFFFFFFFE,
@@ -392,6 +396,7 @@ TEST(idiv64, test) {
}
TEST(div, test) {
+ if (IsWindows()) return; /* TODO */
static const uint8_t A[] = {0x00, 0x01, 0x80, 0x7F, 0x81, 0x7E, 0xFF, 0xBF};
uint16_t remquo;
bool gotthrow, gotsigfpe;
@@ -431,6 +436,7 @@ TEST(div, test) {
}
TEST(div16, test) {
+ if (IsWindows()) return; /* TODO */
static const uint16_t A[] = {0x0000, 0x0001, 0x8000, 0x7FFF,
0x8001, 0x7FFE, 0xFFFF, 0xBeef};
bool gotthrow, gotsigfpe;
@@ -468,6 +474,7 @@ TEST(div16, test) {
}
TEST(div32, test) {
+ if (IsWindows()) return; /* TODO */
static const uint32_t A[] = {0x00000000, 0x00000001, 0x80000000, 0x7FFFFFFF,
0x80000001, 0x7FFFFFFE, 0xFFFFFFFF, 0xDeadBeef};
bool gotthrow, gotsigfpe;
@@ -505,6 +512,7 @@ TEST(div32, test) {
}
TEST(div64, test) {
+ if (IsWindows()) return; /* TODO */
static const uint64_t A[] = {0x0000000000000000, 0x0000000000000001,
0x8000000000000000, 0x7FFFFFFFFFFFFFFF,
0x8000000000000001, 0x7FFFFFFFFFFFFFFE,
diff --git a/test/tool/build/lib/xlaterrno_test.c b/test/tool/build/lib/xlaterrno_test.c
index 9af03ea7..b641e559 100644
--- a/test/tool/build/lib/xlaterrno_test.c
+++ b/test/tool/build/lib/xlaterrno_test.c
@@ -23,5 +23,4 @@
TEST(xlaterrno, test) {
EXPECT_EQ(95, XlatErrno(EOPNOTSUPP));
EXPECT_EQ(90, XlatErrno(EMSGSIZE));
- EXPECT_EQ(133, XlatErrno(EHWPOISON));
}
diff --git a/third_party/chibicc/dox2.c b/third_party/chibicc/dox2.c
index 8fa79386..09b91db3 100644
--- a/third_party/chibicc/dox2.c
+++ b/third_party/chibicc/dox2.c
@@ -512,6 +512,10 @@ static void PrintDox(struct Dox *dox, FILE *f) {
\n\
\n\
\n\
+\n\
+\n\
+\n\
+\n\