Platform-specific accessors for the C runtime error-number storage used by system and runtime wrappers. Import paths: linux/errno, macos/errno, and windows/errno.


errno

(-- errnoRef) Returns a borrowed mutable Int32 reference to the calling thread's C errno storage.
  • Each selected platform accessor is called at run time; it does not capture an error number during compilation.

Platform Code bindings

__errno_location

(-- errnoRef) Linux Code binding that calls the C runtime accessor and returns an Int32 Ref to the calling thread's errno storage.

__error

(-- errnoRef) macOS Code binding that calls the C runtime accessor and returns an Int32 Ref to the calling thread's errno storage.

_errno

(-- errnoRef) Windows Code binding that calls the C runtime accessor and returns an Int32 Ref to the calling thread's C errno storage, not the separate Win32 last-error state.


Read timing and overwrite


Thread-local behavior


Examples

Linux runtime example

"String"      use
"control"     use
"linux/errno" use

{} Int32 {} [
  123 errno set
  errno new toString print
  LF print
  0
] "main" exportFunction

Expected Output

123

See also