WasiHostFunction
WASI Preview1 function descriptors
https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/witx/wasi_snapshot_preview1.witx
Entries
Return command-line argument data sizes.
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 \0
s.
Return environment variable data sizes.
Return the resolution of a clock. Implementations are required to provide a non-zero value for supported clocks. For unsupported clocks, return errno::inval
.
Return the time value of a clock. Note: This is similar to clock_gettime
in POSIX.
Force the allocation of space in a file. Note: This is similar to posix_fallocate
in POSIX.
Get the attributes of a file descriptor.
Adjust the flags associated with a file descriptor.
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
Return the attributes of an open file.
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.
Adjust the timestamps of an open file or directory. Note: This is similar to futimens
in POSIX.
Return a description of the given preopened file descriptor.
Return a description of the given preopened file descriptor.
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.
Atomically replace a file descriptor by renumbering another file descriptor.
Create a directory. Note: This is similar to mkdirat
in POSIX.
Return the attributes of a file or directory. Note: This is similar to stat
in POSIX.
Adjust the timestamps of a file or directory. Note: This is similar to utimensat
in POSIX.
Read the contents of a symbolic link.
Remove a directory.
Rename a file or directory. Note: This is similar to renameat
in POSIX.
Create a symbolic link. Note: This is similar to symlinkat
in POSIX.
Unlink a file.
Concurrently poll for the occurrence of a set of events.
Send a signal to the process of the calling thread. Note: This is similar to raise
in POSIX.
Temporarily yield execution of the calling thread. Note: This is similar to sched_yield
in POSIX.
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.
Accept a new incoming connection. Note: This is similar to accept
in POSIX.
Shut down socket send and receive channels. Note: This is similar to shutdown
in POSIX.
Properties
Functions
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.)
Returns an array containing the constants of this enum type, in the order they're declared.