WasiHostFunction

WASI Preview1 function descriptors

https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/witx/wasi_snapshot_preview1.witx

Entries

Link copied to clipboard

Read command-line argument data.

Link copied to clipboard

Return command-line argument data sizes.

Link copied to clipboard

Read environment variable data. The sizes of the buffers should match that returned by environ_sizes_get. Key/value pairs are expected to be joined with =s, and terminated with \0s.

Link copied to clipboard

Return environment variable data sizes.

Link copied to clipboard

Return the resolution of a clock. Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, return errno::inval.

Link copied to clipboard

Return the time value of a clock. Note: This is similar to clock_gettime in POSIX.

Link copied to clipboard

Provide file advisory information on a file descriptor. Note: This is similar to posix_fadvise in POSIX.

Link copied to clipboard

Force the allocation of space in a file. Note: This is similar to posix_fallocate in POSIX.

Link copied to clipboard

Close a file descriptor. Note: This is similar to close in POSIX.

Link copied to clipboard
Link copied to clipboard

Get the attributes of a file descriptor.

Link copied to clipboard

Adjust the flags associated with a file descriptor.

Link copied to clipboard

Adjust the rights associated with a file descriptor. This can only be used to remove rights, and returns errno::notcapable if called in a way that would attempt to add rights

Link copied to clipboard

Return the attributes of an open file.

Link copied to clipboard

Adjust the size of an open file. If this increases the file's size, the extra bytes are filled with zeros. Note: This is similar to ftruncate in POSIX.

Link copied to clipboard

Adjust the timestamps of an open file or directory. Note: This is similar to futimens in POSIX.

Link copied to clipboard

Read from a file descriptor, without using and updating the file descriptor's offset. Note: This is similar to preadv in Linux (and other Unix-es).

Link copied to clipboard

Return a description of the given preopened file descriptor.

Link copied to clipboard

Return a description of the given preopened file descriptor.

Link copied to clipboard

Write to a file descriptor, without using and updating the file descriptor's offset. Note: This is similar to pwritev in Linux (and other Unix-es).

Link copied to clipboard

Read from a file descriptor. Note: This is similar to readv in POSIX.

Link copied to clipboard

Read directory entries from a directory. When successful, the contents of the output buffer consist of a sequence of directory entries. Each directory entry consists of a dirent object, followed by dirent::d_namlen bytes holding the name of the directory entry.

Link copied to clipboard

Atomically replace a file descriptor by renumbering another file descriptor.

Link copied to clipboard

Move the offset of a file descriptor. Note: This is similar to lseek in POSIX.

Link copied to clipboard

Synchronize the data and metadata of a file to disk. Note: This is similar to fsync in POSIX.

Link copied to clipboard

Return the current offset of a file descriptor. Note: This is similar to lseek(fd, 0, SEEK_CUR) in POSIX.

Link copied to clipboard

Write to a file descriptor. Note: This is similar to writev in POSIX.

Link copied to clipboard

Create a directory. Note: This is similar to mkdirat in POSIX.

Link copied to clipboard

Return the attributes of a file or directory. Note: This is similar to stat in POSIX.

Link copied to clipboard

Adjust the timestamps of a file or directory. Note: This is similar to utimensat in POSIX.

Link copied to clipboard

Create a hard link. Note: This is similar to linkat in POSIX.

Link copied to clipboard

Open a file or directory.

Link copied to clipboard

Read the contents of a symbolic link.

Link copied to clipboard

Remove a directory.

Link copied to clipboard

Rename a file or directory. Note: This is similar to renameat in POSIX.

Link copied to clipboard

Create a symbolic link. Note: This is similar to symlinkat in POSIX.

Link copied to clipboard

Unlink a file.

Link copied to clipboard

Concurrently poll for the occurrence of a set of events.

Link copied to clipboard

Terminate the process normally. An exit code of 0 indicates successful termination of the program. The meanings of other values is dependent on the environment.

Link copied to clipboard

Send a signal to the process of the calling thread. Note: This is similar to raise in POSIX.

Link copied to clipboard

Temporarily yield execution of the calling thread. Note: This is similar to sched_yield in POSIX.

Link copied to clipboard

Write high-quality random data into a buffer. This function blocks when the implementation is unable to immediately provide sufficient high-quality random data. This function may execute slowly, so when large mounts of random data are required, it's advisable to use this function to seed a pseudo-random number generator, rather than to provide the random data directly.

Link copied to clipboard

Accept a new incoming connection. Note: This is similar to accept in POSIX.

Link copied to clipboard

Receive a message from a socket.

Link copied to clipboard

Send a message on a socket. Note: This is similar to send in POSIX, though it also supports writing the data from multiple buffers in the manner of writev.

Link copied to clipboard

Shut down socket send and receive channels. Note: This is similar to shutdown in POSIX.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
open override val wasmName: String

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.