Every // ---- section banner dies (132 -> 0): names carry the WHAT. Narration deleted (filename restatements, run-with lines, what-the- next-line-does); every ref/hare cite, task cite, divergence, ABI/ layout contract, and ownership qualifier kept (borrowed-view lines restored where the sweep over-cut). Comment-only proven: all 442 walk-workdir .s and 32 import-probe .s byte-identical before/after; libbyteid 56-roster all-ID.
23 lines
926 B
Plaintext
23 lines
926 B
Plaintext
// These declarations cover the small surface the bootstrap wants:
|
|
// process exit, three io syscalls, and the malloc/free pair. Higher
|
|
// ergonomics live in sibling pure-ww packages. Each declaration is
|
|
// body-less, resolved from the C side at link time; @symbol pins the
|
|
// linker name (without it the binding name itself is used).
|
|
|
|
package libc;
|
|
|
|
@symbol("malloc") fn malloc(n: u64) *void;
|
|
@symbol("free") fn free(p: *void) void;
|
|
@symbol("calloc") fn calloc(n: u64, sz: u64) *void;
|
|
|
|
@symbol("read") fn read(fd: i32, buf: *u8, n: u64) i64;
|
|
@symbol("write") fn write(fd: i32, buf: *u8, n: u64) i64;
|
|
@symbol("open") fn open(path: *u8, flags: i32, mode: i32) i32;
|
|
@symbol("close") fn close(fd: i32) i32;
|
|
|
|
@symbol("exit") fn exit(code: i32) void;
|
|
|
|
@symbol("strlen") fn strlen(s: *u8) u64;
|
|
@symbol("memcpy") fn memcpy(dst: *void, src: *void, n: u64) *void;
|
|
@symbol("memset") fn memset(p: *void, b: i32, n: u64) *void;
|