System

← Reference
Io

C implementation of Io's System object — a slot-only object (no dedicated data pointer or tag) that exposes VM- and environment-level hooks: process exit, errno string, env var get/set, platform name, sleep, symbol table, lobby root, and GC recycler tuning. Under WASI the host-provided surface is minimal: daemon and system() raise errors, thisProcessPid is always 1, activeCpus is 1, and platform/ platformVersion return "wasm"/"wasi-0.1". IO_VERSION_STRING and INSTALL_PREFIX are stamped onto System as slots in IoSystem_proto so Io code can query the build identity.

IoObject_daemon(self, locals, m)

Stub for the historical daemonize call. WASI has no fork/setsid so the method always raises an Io exception. Kept for source compatibility with the standard library.

IoObject_sleep(self, locals, m)

Blocks the current thread for the requested number of seconds by chunking into sub-second usleep calls (usleep's POSIX argument must be less than 1,000,000). Under WASM this is a real synchronous pause, since there is no scheduler to yield to — long sleeps stall the whole runtime.

IoObject_system(self, locals, m)

Stub for the historical system(3) shell bridge. WASI has no process creation so the method always raises an Io exception — preserved as a method so calling Io code can catch a consistent error rather than a slot-not-found.

IoSystem_proto(state)

Constructs the singleton System object: installs the method table and stamps version / installPrefix / type slots derived from compile-time macros (IO_VERSION_STRING, INSTALL_PREFIX). There is no proto registration — System is accessed by name from the lobby rather than via IoState_protoWithId_, and there is nothing to clone.