WASIState

The state of a WASI virtual machine.

Declaration

class WASIState: @unchecked
Sendable

Initializers

Initializes the instance.

Members

Signals

An array threads currently executing a syscall.

An array of pending signals.

Descriptors

The host’s file descriptor of the standard input handle. Setting it will map the fileno 0 to this one.

The host’s file descriptor of the standard output handle. Setting it maps the fileno 1 to this one.

The host’s file descriptor of the standard error handle. Setting it maps the fileno 0 to this one.

The working directory path.

Represents an opened file.

A dictionary of opened files keyed by the WASI file descriptor.

Default value for rightsBase and rightsInheriting.

Resolves a relative path with a file descriptor.

Opens a file descriptor.

Returns a FileDescriptor from a WASI file number.

Sets the fdflags for a file descriptor.

Sets the fs_rights_base and fs_rights_inheriting values for the file descriptor.

Closes a file descriptor.

Sockets

A socket file descriptor.

A dictionary of opened sockets, keyed by their WASI file number.

Opens a socket.

Returns the SocketInfo for a given WASI socket file number.

Closes a socket.

Clock

The clock’s offset in nano seconds.

Subprocesses

The id of the current process. It is assigned by ios_system and passed via the wasm command.

The id of the parent process.

Maps PIDs to their WASI states.

Conforms to

  • @unchecked Sendable