Register full POSIX surface in static builds

ober

aa046cd984f46e2e8e2f284e2bb967699d5b5bd8

diff --git a/build-jcode-cross.ss b/build-jcode-cross.ss
index 03b1b53..1725f48 100644
--- a/build-jcode-cross.ss
+++ b/build-jcode-cross.ss
@@ -341,18 +341,20 @@
     "fork" "waitpid" "kill" "getpid" "getppid"
     "getpgid" "setpgid" "setsid"
     "getuid" "geteuid" "getgid" "getegid"
+    "setuid" "setgid" "setrlimit"
     "sigemptyset" "sigfillset" "sigaddset" "sigdelset"
-    "sigismember" "sigprocmask"
+    "sigismember" "sigprocmask" "sigwait"
     ;; terminal/fd — TUI + REPL + jsqlite locking/WAL shm
     "isatty" "tcgetattr" "tcsetattr" "tcgetpgrp" "tcsetpgrp"
-    "pipe" "dup" "dup2" "lseek"
+    "pipe" "dup" "dup2" "lseek" "ioctl"
     "open" "ftruncate" "mmap" "munmap" "flock" "usleep"
     ;; env/misc — std/os/env, std/text/time
     "setenv" "unsetenv" "strerror" "localtime" "strftime"
     "sysconf" "getpagesize" "getrlimit"
     "system" "getenv" "putenv" "_exit" "exit" "execvp" "execve"
-    ;; temporary files/directories and FIFOs — std/os/temp, std/os/posix
-    "mkstemp" "mkdtemp" "mkfifo" "unlink" "rmdir"
+    ;; files/directories/FIFOs — std/os/temp, std/os/posix
+    "access" "chdir" "stat" "fstat" "lstat"
+    "mkstemp" "mkdtemp" "mkfifo" "umask" "unlink" "rmdir"
     ;; errno location + Linux sandboxing
     "__errno_location" "fcntl" "prctl" "syscall"))
 
@@ -373,6 +375,7 @@
   (display "#include <sys/prctl.h>\n" out)
   (display "#include <sys/file.h>\n" out)
   (display "#include <sys/socket.h>\n" out)
+  (display "#include <sys/ioctl.h>\n" out)
   (display "#include <netinet/in.h>\n" out)
   (display "#include <arpa/inet.h>\n" out)
   (display "#include <netdb.h>\n" out)
diff --git a/build-jcode-freebsd-cross.ss b/build-jcode-freebsd-cross.ss
index 9693511..49d6dcd 100644
--- a/build-jcode-freebsd-cross.ss
+++ b/build-jcode-freebsd-cross.ss
@@ -330,18 +330,19 @@
     "fork" "waitpid" "kill" "getpid" "getppid"
     "getpgid" "setpgid" "setsid"
     "getuid" "geteuid" "getgid" "getegid"
+    "setuid" "setgid" "setrlimit"
     "sigemptyset" "sigfillset" "sigaddset" "sigdelset"
-    "sigismember" "sigprocmask"
+    "sigismember" "sigprocmask" "sigwait"
     ;; terminal/fd — TUI + REPL + jsqlite locking/WAL shm
     "isatty" "tcgetattr" "tcsetattr" "tcgetpgrp" "tcsetpgrp"
-    "pipe" "dup" "dup2" "lseek"
+    "pipe" "dup" "dup2" "lseek" "ioctl"
     "open" "ftruncate" "mmap" "munmap" "flock" "usleep"
     ;; env/misc — std/os/env, std/text/time
     "setenv" "unsetenv" "strerror" "localtime" "strftime"
     "sysconf" "getpagesize" "getrlimit"
     "system" "getenv" "putenv" "_exit" "execvp" "execve"
-    ;; FIFOs — std/os/posix
-    "mkfifo"
+    ;; files/directories/FIFOs — std/os/posix
+    "access" "chdir" "stat" "fstat" "lstat" "mkfifo" "umask" "unlink"
     "fcntl"))
 
 (define main-c-path (string-append output "-main.c"))
@@ -359,6 +360,7 @@
   (display "#include <sys/mman.h>\n" out)
   (display "#include <sys/file.h>\n" out)
   (display "#include <sys/socket.h>\n" out)
+  (display "#include <sys/ioctl.h>\n" out)
   (display "#include <netinet/in.h>\n" out)
   (display "#include <arpa/inet.h>\n" out)
   (display "#include <netdb.h>\n" out)
diff --git a/build-jcode-musl.ss b/build-jcode-musl.ss
index 71ccdef..908bfb8 100644
--- a/build-jcode-musl.ss
+++ b/build-jcode-musl.ss
@@ -208,18 +208,20 @@
     "fork" "waitpid" "kill" "getpid" "getppid"
     "getpgid" "setpgid" "setsid"
     "getuid" "geteuid" "getgid" "getegid"
+    "setuid" "setgid" "setrlimit"
     "sigemptyset" "sigfillset" "sigaddset" "sigdelset"
-    "sigismember" "sigprocmask"
+    "sigismember" "sigprocmask" "sigwait"
     ;; terminal / fd — TUI + REPL + jsqlite locking/WAL shm
     "isatty" "tcgetattr" "tcsetattr" "tcgetpgrp" "tcsetpgrp"
-    "pipe" "dup" "dup2" "lseek"
+    "pipe" "dup" "dup2" "lseek" "ioctl"
     "open" "ftruncate" "mmap" "munmap" "flock" "usleep"
     ;; env / misc — std/os/env, std/text/time
     "setenv" "unsetenv" "strerror" "localtime" "strftime"
     "sysconf" "getpagesize" "getrlimit"
     "system" "getenv" "putenv" "_exit" "exit" "execvp" "execve"
-    ;; temporary files/directories and FIFOs — std/os/temp, std/os/posix
-    "mkstemp" "mkdtemp" "mkfifo" "unlink" "rmdir"
+    ;; files/directories/FIFOs — std/os/temp, std/os/posix
+    "access" "chdir" "stat" "fstat" "lstat"
+    "mkstemp" "mkdtemp" "mkfifo" "umask" "unlink" "rmdir"
     ;; errno location + Linux sandboxing
     "__errno_location" "fcntl" "prctl" "syscall"))
 
@@ -531,6 +533,7 @@
     (display "#include <sys/resource.h>\n"  out)  ;; getrlimit
     (display "#include <sys/prctl.h>\n"     out)  ;; prctl
     (display "#include <sys/file.h>\n"      out)  ;; flock
+    (display "#include <sys/ioctl.h>\n"     out)  ;; ioctl
     (display "#include <termios.h>\n"       out)  ;; tcgetattr/tcsetattr/tcgetpgrp/tcsetpgrp
     (display "#include <signal.h>\n"        out)  ;; kill, sigemptyset/sigprocmask family
     (display "#include <time.h>\n"          out)  ;; localtime, strftime