updated vendor

This commit is contained in:
2026-06-16 08:02:19 +02:00
parent 2f7f99d3f0
commit 77299d0c64
1283 changed files with 67302 additions and 208958 deletions
+40
View File
@@ -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
View File
@@ -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)
}