summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/builtins.zig5
-rw-r--r--src/builtins_json.zig2
-rw-r--r--src/config.zig2
-rw-r--r--src/exec.zig10
4 files changed, 14 insertions, 5 deletions
diff --git a/src/builtins.zig b/src/builtins.zig
index b101e34d..38a4d835 100644
--- a/src/builtins.zig
+++ b/src/builtins.zig
@@ -1487,8 +1487,11 @@ pub const Tty = struct {
};
/// A Linux terminal with the current session mounted through kernel v9fs.
+/// A word of every hosted build, Linux's or not: a build's words are its
+/// Help's rows, which a replica of another build's session makes as its
+/// session did (a Linux client of a FreeBSD one diverged at SPC ?).
pub const Tty9p = struct {
- pub const enabled = pardes.hosted and @import("builtin").os.tag == .linux;
+ pub const enabled = pardes.hosted;
pub fn run(c: Ctx) void {
exec.spawnV9fsTty(c.p, c.id);
}
diff --git a/src/builtins_json.zig b/src/builtins_json.zig
index 489f1e22..3402b2ee 100644
--- a/src/builtins_json.zig
+++ b/src/builtins_json.zig
@@ -74,7 +74,7 @@ pub fn write(w: *std.Io.Writer) !void {
test "docs/typ/builtins-<platform>.json is what the registry says now" {
// a terminal build checks its file, a window build its own; both are
- // Linux builds' lists (Tty9p is Linux's)
+ // Linux builds' lists
if (comptime @import("builtin").os.tag != .linux) return error.SkipZigTest;
const file = switch (pardes.platform) {
.tty => "builtins-tty.json",
diff --git a/src/config.zig b/src/config.zig
index ebca14ea..c1f1981c 100644
--- a/src/config.zig
+++ b/src/config.zig
@@ -2283,7 +2283,7 @@ const doc_typ = struct {
for (std.enums.values(Builtin)) |b| if (leader_path.get(b)) |p|
if (std.mem.eql(u8, p, path[0..n])) return true;
for (leader_args) |la| if (std.mem.eql(u8, la.path, path[0..n])) return true;
- // A word this build leaves out (Tty9p off Linux) keeps its leader in the other's.
+ // A word this build leaves out keeps its leader in the other's.
var buf: [96]u8 = undefined;
const needle = std.fmt.bufPrint(&buf, "\"leader\": \"{s}\"", .{k}) catch return false;
return std.mem.indexOf(u8, other_build, needle) != null;
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;
}