summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-29 12:32:23 -0300
committerGabriel Schneider <[email protected]>2026-10-29 13:11:16 -0300
commit6b89fed454fd56a3af4b576646538b45d3315146 (patch)
treef4be48c98368bc8c85c461af97528743afc98f59 /src/main.zig
parent34551a64366b3257ac577c5b68288f955c9eea80 (diff)
downloadpardes-6b89fed454fd56a3af4b576646538b45d3315146.tar.gz
pardes-6b89fed454fd56a3af4b576646538b45d3315146.zip
FreeBSD: the tty pardes builds for it and runs there, terminals, 9P and the daemon included
Cross-compiled with -Dtarget=x86_64-freebsd.15.0 (15 ships libutil.so.10; Zig's default 14.0 links .so.9) and run on the FreeBSD 15.1 box: - 9p_io serves there: fstatat, not Linux's statx. madvise is Linux's. - WINCH reaches the sigwait thread through a handler that does nothing: FreeBSD drops a signal ignored by default as it is sent. - A dead terminal answers a write with ENXIO, which std does not expect: a Debug build traced it to stderr, that same terminal, and recursed until the stack ran out (a session whose ssh dropped hung). No tracing there. - waitid's FreeBSD numbers and 64-bit id: a command pane's exit is seen. - No /proc: a shell's directory and program by sysctl, ttyTaken by the foreground group, the foreground job's name by its program. - File watching by FreeBSD 15's inotify. - ghostty's kitty loader: off Linux a stat comes before a t=f open (a FIFO hung it); FreeBSD's shm_open refuses O_NONBLOCK. - vaxis's test terminal has no read off Linux: no input thread for it. - test-install: the test-build programs installed into <prefix>/test, to run where the build cannot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig
index 803ff4da..3d26d1fd 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -21,7 +21,15 @@ else
// the thread starts, so std's 256 KiB made each 9P connection's thread cost
// that much resident. A stack-overflow segfault on a thread still printed its
// whole symbolized trace from 32 KiB up (16 KiB double-faulted): 64 KiB.
-pub const std_options: std.Options = .{ .logFn = logFn, .signal_stack_size = 64 * 1024 };
+//
+// FreeBSD answers a write to a terminal that is gone with ENXIO, an errno std
+// does not expect: a Debug build traced it to stderr, that same terminal,
+// and recursed until the stack ran out (a session whose ssh dropped hung).
+pub const std_options: std.Options = .{
+ .logFn = logFn,
+ .signal_stack_size = 64 * 1024,
+ .unexpected_error_tracing = (std.Options{}).unexpected_error_tracing and builtin.os.tag != .freebsd,
+};
fn logFn(
comptime level: std.log.Level,