updated vendor
This commit is contained in:
+22
-1
@@ -14,5 +14,26 @@ import "github.com/tetratelabs/wazero/api"
|
||||
// without mmap, consider editing the binary to reduce the max size setting of memory.
|
||||
const CoreFeaturesThreads = api.CoreFeatureSIMD << 1
|
||||
|
||||
// CoreFeaturesThreads enables tail call instructions ("tail-call").
|
||||
// CoreFeaturesTailCall enables tail call instructions ("tail-call").
|
||||
const CoreFeaturesTailCall = api.CoreFeatureSIMD << 2
|
||||
|
||||
// CoreFeaturesExtendedConst enables extended constant expressions.
|
||||
//
|
||||
// # Notes
|
||||
//
|
||||
// - Enables i32.add/sub/mul and i64.add/sub/mul in constant expressions.
|
||||
// - Enables references to any previous global index in constant expressions,
|
||||
// instead of just imported globals.
|
||||
//
|
||||
// See https://github.com/WebAssembly/extended-const for further details.
|
||||
const CoreFeaturesExtendedConst = api.CoreFeatureSIMD << 3
|
||||
|
||||
// CoreFeaturesExceptionHandling enables exception handling instructions.
|
||||
//
|
||||
// See https://github.com/WebAssembly/exception-handling for further details.
|
||||
const CoreFeaturesExceptionHandling = api.CoreFeatureSIMD << 4
|
||||
|
||||
// CoreFeaturesTypedFunctionReferences enables typed function references.
|
||||
//
|
||||
// See https://github.com/WebAssembly/function-references for further details.
|
||||
const CoreFeaturesTypedFunctionReferences = api.CoreFeatureSIMD << 5
|
||||
|
||||
+40
@@ -314,3 +314,43 @@ type File interface {
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/close.html
|
||||
Close() Errno
|
||||
}
|
||||
|
||||
// PollableFile is a File that additionally supports polling for readiness
|
||||
// and non-blocking mode. This is separated from File to avoid breaking
|
||||
// downstream implementations that do not need polling.
|
||||
//
|
||||
// Implementations should embed UnimplementedFile for forward compatibility
|
||||
// of the base File methods, and add Poll, IsNonblock, and SetNonblock.
|
||||
//
|
||||
// # Notes
|
||||
//
|
||||
// - This is the public equivalent of the internal fsapi.File interface.
|
||||
// - See Pollable for a standalone poll interface usable with io.Reader
|
||||
// or fs.File implementations that are not full File implementations.
|
||||
type PollableFile interface {
|
||||
File
|
||||
Pollable
|
||||
|
||||
// IsNonblock returns true if the file was opened with O_NONBLOCK, or
|
||||
// SetNonblock was successfully enabled on this file.
|
||||
//
|
||||
// # Notes
|
||||
//
|
||||
// - This might not match the underlying state of the file descriptor if
|
||||
// the file was not opened via OpenFile.
|
||||
IsNonblock() bool
|
||||
|
||||
// SetNonblock toggles the non-blocking mode (O_NONBLOCK) of this file.
|
||||
//
|
||||
// # Errors
|
||||
//
|
||||
// A zero Errno is success. The below are expected otherwise:
|
||||
// - ENOSYS: the implementation does not support this function.
|
||||
// - EBADF: the file or directory was closed.
|
||||
//
|
||||
// # Notes
|
||||
//
|
||||
// - This is like syscall.SetNonblock and `fcntl` with O_NONBLOCK in
|
||||
// POSIX. See https://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
|
||||
SetNonblock(enable bool) Errno
|
||||
}
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package sys
|
||||
|
||||
// Pflag are bit flags used for polling. Values, including zero, should not
|
||||
// be interpreted numerically. Instead, use by constants prefixed with 'POLL'.
|
||||
//
|
||||
// # Notes
|
||||
//
|
||||
// - This is like `pollfd.events` flags for `poll` in POSIX. See
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html
|
||||
type Pflag uint32
|
||||
|
||||
// Only define bitflags we support and are needed by `poll_oneoff` in wasip1
|
||||
// See https://github.com/WebAssembly/WASI/blob/snapshot-01/phases/snapshot/docs.md#eventrwflags
|
||||
const (
|
||||
// POLLIN is a read event.
|
||||
POLLIN Pflag = 1 << iota
|
||||
|
||||
// POLLOUT is a write event.
|
||||
POLLOUT
|
||||
)
|
||||
|
||||
// Pollable is implemented by custom readers that support polling for
|
||||
// readiness. If a custom io.Reader passed to WithStdin implements this
|
||||
// interface, poll_oneoff will use it for asynchronous I/O instead of
|
||||
// returning "always ready".
|
||||
//
|
||||
// # Parameters
|
||||
//
|
||||
// The `flag` parameter determines which event to await, such as POLLIN,
|
||||
// POLLOUT, or a combination like `POLLIN|POLLOUT`.
|
||||
//
|
||||
// The `timeoutMillis` parameter is how long to block for an event, or
|
||||
// interrupted, in milliseconds. There are two special values:
|
||||
// - zero returns immediately
|
||||
// - any negative value blocks any amount of time
|
||||
//
|
||||
// # Results
|
||||
//
|
||||
// `ready` means there was data ready to read or written. False can mean no
|
||||
// event was ready or `errno` is not zero.
|
||||
//
|
||||
// A zero `errno` is success. The below are expected otherwise:
|
||||
// - ENOSYS: the implementation does not support this function.
|
||||
// - ENOTSUP: the implementation does not support the flag combination.
|
||||
// - EINTR: the call was interrupted prior to an event.
|
||||
type Pollable interface {
|
||||
Poll(flag Pflag, timeoutMillis int32) (ready bool, errno Errno)
|
||||
}
|
||||
Reference in New Issue
Block a user