summaryrefslogtreecommitdiff
path: root/src/exec.zig
diff options
context:
space:
mode:
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;
}