wasi: fix nonblocking sockets on *NIX (gotip net/http) (#1503)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Edoardo Vacchi <evacchi@users.noreply.github.com>
This commit is contained in:
Crypt Keeper
2023-06-13 04:51:32 +08:00
committed by GitHub
parent b4d97e5e69
commit f3778cae08
10 changed files with 471 additions and 186 deletions

View File

@@ -5,11 +5,22 @@ package sysfs
import (
"net"
"syscall"
socketapi "github.com/tetratelabs/wazero/internal/sock"
)
// MSG_PEEK is a filler value
// MSG_PEEK is a filler value.
const MSG_PEEK = 0x2
func recvfromPeek(conn *net.TCPConn, p []byte) (n int, errno syscall.Errno) {
return 0, syscall.ENOSYS
func newTCPListenerFile(tl *net.TCPListener) socketapi.TCPSock {
return &unsupportedSockFile{}
}
type unsupportedSockFile struct {
baseSockFile
}
// Accept implements the same method as documented on socketapi.TCPSock
func (f *unsupportedSockFile) Accept() (socketapi.TCPConn, syscall.Errno) {
return nil, syscall.ENOSYS
}