-- ffi/libc.lua — shared libc bindings: errno, signal, write, read, chdir. local ffi = require("ffi") ffi.cdef[[ int chdir(const char *path); int errno; char *strerror(int errnum); ]] local M = {} -- Apply chdir per PHASE0.md §7 (intercepts `cd` so wd persists across popen). function M.chdir(path) error("libc.chdir: not implemented (Phase 0 pending)") end return M