summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-30 21:06:51 -0300
committerGabriel Schneider <[email protected]>2026-10-30 22:03:33 -0300
commitc07baa7bf83039600a54b261eaae7fdd4d673768 (patch)
tree36377f2eabd9b3cee349d8bd1cf552b3866732f2 /src/exec.zig
parentd00c40694dc239854263616f710b4a197d25d145 (diff)
downloadpardes-c07baa7bf83039600a54b261eaae7fdd4d673768.tar.gz
pardes-c07baa7bf83039600a54b261eaae7fdd4d673768.zip
builtins: Tty9p is a word of every hosted build, not a Linux build's alone, so a build's words, the rows of its Help, are the same on FreeBSD: a Linux client of a box session made SPC ?'s +Help with one row more than its session's and joined again (`pane 4.file.content`, and `.splice` over a +Help made again: two of the box soak's three divergences); whether its host is Linux is the authority's answer (tape.authority), so a replica of a FreeBSD session refuses Tty9p as its session does; test/cross_replay.py's session runs Help (a FreeBSD tape replayed here diverged at its pane's content)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/exec.zig')
-rw-r--r--src/exec.zig10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/exec.zig b/src/exec.zig
index c5218279..af312c45 100644
--- a/src/exec.zig
+++ b/src/exec.zig
@@ -409,14 +409,20 @@ pub fn spawnTty(p: *Pardes, from: usize) ?*Pane {
}
pub fn spawnV9fsTty(p: *Pardes, from: usize) void {
- if (comptime !hosted or @import("builtin").os.tag != .linux)
+ if (comptime !hosted) return p.reportError(from, "Tty9p", error.LinuxRequired);
+ // The session's host's and its 9P server's: a replica, of another
+ // build too (a Linux client of a FreeBSD session), has their answers.
+ if (!pardes.tape.authority(onLinux, .{}))
return p.reportError(from, "Tty9p", error.LinuxRequired);
- // The 9P server's: a replica has the authority's answer.
if (!pardes.tape.authority(servesSocket, .{p}))
return p.reportError(from, "Tty9p", error.SessionSocketRequired);
_ = spawnTtyWithMount(p, from, true);
}
+fn onLinux() bool {
+ return @import("builtin").os.tag == .linux;
+}
+
fn servesSocket(p: *Pardes) bool {
return p.fs.socket_path.len != 0;
}