diff --git a/lib/fmt/fmttest.ww b/lib/fmt/fmttest.ww index 08ccfd88..0eea56b1 100644 --- a/lib/fmt/fmttest.ww +++ b/lib/fmt/fmttest.ww @@ -10,20 +10,13 @@ use fmt; use io; use memio; - -// Direct exit(2) binding rather than `use os;` — os exports -// read/write/close, which collide with io.read/write/close under -// the driver's flat-scope concat. -@symbol("rt_syscall") fn syscall1ww(num: i64, a: i64) i64; -fn doexit(code: i32) void = { - syscall1ww(60i64, code: i64); -}; +use os; // signalled — bumped before each scenario so a failing exit code // pinpoints the offending case. let signalled: i32 = 0; -fn fail() void = { doexit(signalled + 10); }; +fn fail() void = { os.exit(signalled + 10); }; fn streq(a: str, b: str) bool = { if (a.len != b.len) { return false; }; diff --git a/lib/log/logtest.ww b/lib/log/logtest.ww index 6bd9efa7..e5caeede 100644 --- a/lib/log/logtest.ww +++ b/lib/log/logtest.ww @@ -13,21 +13,13 @@ use fmt; use io; use log; use memio; - -// Direct exit(2) binding rather than `use os;` — os exports -// read/write/close, which collide with io.read/write/close under -// the driver's flat-scope concat. Same workaround as bufiotest / -// fmttest / memiotest. -@symbol("rt_syscall") fn syscall1ww(num: i64, a: i64) i64; -fn doexit(code: i32) void = { - syscall1ww(60i64, code: i64); -}; +use os; // signalled — bumped before each scenario so a failing exit code // pinpoints the offending case. let signalled: i32 = 0; -fn fail() void = { doexit(signalled + 10); }; +fn fail() void = { os.exit(signalled + 10); }; fn streq(a: str, b: str) bool = { if (a.len != b.len) { return false; }; diff --git a/lib/memio/memio.ww b/lib/memio/memio.ww index 2ed5fb3e..753f81aa 100644 --- a/lib/memio/memio.ww +++ b/lib/memio/memio.ww @@ -28,9 +28,9 @@ use io; -// Direct rt_alloc/rt_free bindings rather than `use os;` because os -// exports read/write/close, which collide with io.read/write/close -// under the driver's flat-scope concatenation. Same pattern as +// Direct rt_alloc/rt_free bindings — the runtime heap primitives +// memio.dynamic / dynamicfrom need to own the backing buffer. lib/os +// holds the same FFI shape but doesn't export it; same pattern as // rt/ensure.ww. @symbol("rt_alloc") fn rtalloc(n: u64) *void; @symbol("rt_free") fn rtfree(p: *void, n: u64) void; diff --git a/lib/memio/memiotest.ww b/lib/memio/memiotest.ww index 34dbcab1..228fe003 100644 --- a/lib/memio/memiotest.ww +++ b/lib/memio/memiotest.ww @@ -8,20 +8,13 @@ use bytes; use io; use memio; - -// Direct exit(2) binding rather than `use os;` — os exports -// read/write/close, which collide with io.read/write/close under -// the driver's flat-scope concat (task #7). -@symbol("rt_syscall") fn syscall1ww(num: i64, a: i64) i64; -fn doexit(code: i32) void = { - syscall1ww(60i64, code: i64); -}; +use os; // signalled — bumped by main before each test so a failing exit code // pinpoints the offending case. let signalled: i32 = 0; -fn fail() void = { doexit(signalled + 10); }; +fn fail() void = { os.exit(signalled + 10); }; fn putstr(s: str, into: []u8, off: i32) i32 = { let i: i32 = 0;