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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user