summaryrefslogtreecommitdiff
path: root/9ns/src/main.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 10:39:51 -0300
committerGabriel Schneider <[email protected]>2026-10-01 10:39:51 -0300
commit34834165e2b54dd6ac26babd1e9d0443f1f53ee4 (patch)
tree5dfa88e756e403f58f26ffb4d6f21b50972a9fbb /9ns/src/main.zig
parentc4c75b7e4ecc9c664d1f778e5e7c5305dff65b12 (diff)
downloadcloud9-34834165e2b54dd6ac26babd1e9d0443f1f53ee4.tar.gz
cloud9-34834165e2b54dd6ac26babd1e9d0443f1f53ee4.zip
9ns: under --mntgen the program also gets NINE_MNTGEN=1, so it can tell the registry from a mounted session
$NINE_MOUNT was the mountpoint either way: under --mntgen the registry, each session at $NINE_MOUNT/<service>/<name>; under --unix the session itself. A program working out its own session's directory (pardes's $PARDES_MOUNT for its panes) could not tell which without statting the mount. NINE_MNTGEN=1 now says so; an inherited one is dropped, so a 9ns nested in a registry's program is not taken for one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to '9ns/src/main.zig')
-rw-r--r--9ns/src/main.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/9ns/src/main.zig b/9ns/src/main.zig
index eac0a5e..86763a7 100644
--- a/9ns/src/main.zig
+++ b/9ns/src/main.zig
@@ -38,7 +38,8 @@ const usage_text =
\\ --no-direct-io let the kernel cache file pages (trusts stat length)
\\ --debug trace FUSE and 9P operations on stderr
\\ --help, --version
- \\PROGRAM defaults to $SHELL (else /bin/sh). The mountpoint is exported as $NINE_MOUNT.
+ \\PROGRAM defaults to $SHELL (else /bin/sh). The mountpoint is exported as $NINE_MOUNT,
+ \\and under --mntgen NINE_MNTGEN=1 says it is the registry, a session at $NINE_MOUNT/<service>/<name>.
\\Default name: --unix PATH -> basename of PATH without .sock/.9p/.socket;
\\--tcp IP:PORT -> tcp-IP-PORT (':' becomes '-'); --spawn CMD -> basename of its
\\first word; --fd N -> fdN; 9p when nothing usable comes out of that.
@@ -391,6 +392,7 @@ fn runMntgen(init: std.process.Init, envp: [*:null]const ?[*:0]const u8, cfg: Co
.uid = uid,
.gid = gid,
.max_read = bridge.max_write,
+ .mntgen = true,
}) catch return own_failure;
bridge.serveMntgen(gpa, child.fuse_fd, stop_fd, .{