linux/errno · macos/errno · windows/errno
Accessors for the C runtime error-number storage used by system and runtime wrappers. The returned reference designates the current thread’s error-number state. Import paths: linux/errno, macos/errno, and windows/errno.
errno (-- errnoRef)
Returns one Int32 Ref to the current thread’s error-number storage.
C runtime scope
- The module exposes one C runtime or POSIX-style error-number location.
- On Windows this accessor designates C runtime
errno storage, not the separate last-error state used by many Win32 APIs.
- The page documents the error-number channel used by low-level imported functions and thin wrappers.
Read timing and overwrite
- The current value is most meaningful immediately after the relevant failing call.
- Later library or platform calls in the same thread may overwrite the stored value before it is read.
- Storing the current numeric value in a separate
Int32 variable preserves it independently of later overwrites.
Thread-local behavior
- The returned reference designates the current thread’s error-number storage.
- Different threads may therefore observe different values through this interface.
- Writing through the returned
Ref changes the value later reads in the same thread observe.
Examples
Linux runtime example
"linux/errno" use
"String" use
"control" use
{} Int32 {} [
123 errno set
errno new toString print
LF print
0
] "main" exportFunction
Expected Output
123
See also
- file: File I/O helpers for byte arrays and String values.
- linux/socket: Linux socket declarations, constants, address schemas, and imported functions.
- linux/posix: POSIX process, timing, descriptor, and context declarations used by Linux support modules.
- linux/Process · windows/Process: Cross-platform process wrapper with explicit creation, waiting, and termination helpers.
- windows/kernel32: Kernel32 declarations for synchronization, process, thread, file, and timing helpers.
- windows/ws2_32: Winsock2 declarations for sockets, overlapped I/O, and address-resolution helpers.