diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-27 19:37:05 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 7f31e62b63a64cef3916aac21417b7b1414000aa (patch) | |
| tree | 75ae00e196e7eff22fc4659b512b12ce81f10cf6 /src/ninep/tree.zig | |
| parent | 594970f18dee92308fd1554663cc408cda4d102c (diff) | |
| download | pardes-7f31e62b63a64cef3916aac21417b7b1414000aa.tar.gz pardes-7f31e62b63a64cef3916aac21417b7b1414000aa.zip | |
pty/run answers with the command's output; pin cloud9 with 9ns concurrency and E.BUSY
The answer is now the header line (exit N, or exit N cut M when only the
last 64 KiB were kept, or exit N cut when its start scrolled out of the
history), then what the command printed: the screen text between its C and
D marks, which the marks handler pins so scrolling keeps them.
Also from review: a plain /log open honours its offset until follow is
written, so tail -n and less work; whitespace-only run lines are refused.
cloud9 is pinned at 82d8152c: 9ns keeps up to 32 requests in flight per
mount so a waiting read no longer freezes the rest of it, and E.BUSY
replaces the errno pardes spelled locally.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/tree.zig')
| -rw-r--r-- | src/ninep/tree.zig | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ninep/tree.zig b/src/ninep/tree.zig index 0d328594..e8bcad2f 100644 --- a/src/ninep/tree.zig +++ b/src/ninep/tree.zig @@ -68,8 +68,6 @@ pub const e_in_use = "file in use"; /// Handles that mark an open as the one reading `event` or `pty/data`, so the /// release knows to give the file up; other opens get `open_handle`. const open_handle: u32 = 1; -// ponytail: EBUSY spelled locally; use E.BUSY once cloud9 names it and pardes bumps the pin. -const e_busy: u16 = 16; const reader_handle: u32 = 2; fn reads(omode: u8) bool { @@ -527,7 +525,7 @@ fn open(p: *Pardes, req: Req, target: Target) Reply { // the stream; the second is refused rather than robbed. .event => { const reader = reads(req.omode); - if (reader and pf.event_reader) return failText(req.tag, e_busy, e_in_use); + if (reader and pf.event_reader) return failText(req.tag, E.BUSY, e_in_use); pf.readers +|= 1; p.fs.listeners +|= 1; pf.event_reader = pf.event_reader or reader; @@ -535,7 +533,7 @@ fn open(p: *Pardes, req: Req, target: Target) Reply { }, .pty_run => return pty.openRun(p, req, t.serial), .pty_data => if (reads(req.omode)) { - if (pf.pty_readers > 0) return failText(req.tag, e_busy, e_in_use); + if (pf.pty_readers > 0) return failText(req.tag, E.BUSY, e_in_use); pf.pty_readers = 1; return .{ .tag = req.tag, .handle = reader_handle }; }, |
