//go:build (linux || darwin) && !tinygo

package sysfs

import (
	
	

	
	
	socketapi 
)

// MSG_PEEK is the constant syscall.MSG_PEEK
const MSG_PEEK = syscall.MSG_PEEK

func newTCPListenerFile( *net.TCPListener) socketapi.TCPSock {
	return newDefaultTCPListenerFile()
}

func _pollSock( syscall.Conn,  fsapi.Pflag,  int32) (bool, sys.Errno) {
	,  := syscallConnControl(, func( uintptr) (int, sys.Errno) {
		if ,  := poll(, fsapi.POLLIN, 0); ! ||  != 0 {
			return -1, 
		} else {
			return 0, 
		}
	})
	return  >= 0, 
}

func setNonblockSocket( uintptr,  bool) sys.Errno {
	return sys.UnwrapOSError(setNonblock(, ))
}

func readSocket( uintptr,  []byte) (int, sys.Errno) {
	,  := syscall.Read(int(), )
	return , sys.UnwrapOSError()
}

func writeSocket( uintptr,  []byte) (int, sys.Errno) {
	,  := syscall.Write(int(), )
	return , sys.UnwrapOSError()
}

func recvfrom( uintptr,  []byte,  int32) ( int,  sys.Errno) {
	, ,  := syscall.Recvfrom(int(), , int())
	return , sys.UnwrapOSError()
}