Repository navigation
2026.09.06-bee599a73
·
5 commits
to master
since this release
Immutable
release. Only release title and notes can be modified.
unix: expose unix.E and unix.SIG as name->value lookup tables (#391)
errno and signal constants were only reachable as individual named
fields (unix.EPERM, unix.SIGHUP, ...), with no way to resolve a name
computed at runtime. Add a plain struct NameValue table (kErrnoNames,
kSignalNames) and a small helper that builds a Lua table from it,
keyed by full name ("ENOENT", "SIGTERM") to match existing lookup
sites. This is deliberately NOT LoadMagnums/MagnumStr: that mechanism
dereferences an address computed from a table offset, which only works
for real OS-resolved extern symbols (IP_/TCP_/SO_/CLOCK_); errno and
signal names are compile-time #define literals with no backing extern,
so feeding them through MAGNUM_NUMBER would segfault.
Every existing individual unix.E<NAME>/unix.SIG<NAME> field is
untouched. unix.SIG excludes the SIG_BLOCK/SIG_UNBLOCK/SIG_SETMASK
sigprocmask() `how` values and the SIG_DFL/SIG_IGN handler-pointer
sentinels, which are not signal numbers.
definitions.lua annotates both as table<string, integer>, which
test_definitions_coverage.lua's Q5 (every constant declares `integer`)
and test_definitions_conformance.lua's per-constant runtime probe both
assumed was universal; extend both, each with a small, explicitly
documented, permanent exception for this one non-scalar constant
shape, rather than weakening either check.
Claude-Session: https://claude.ai/code/session_01AvVXfmQXBBd61b4N9Ri1qq
Co-authored-by: Claude <noreply@anthropic.com>