GoToSocial/vendor/github.com/tetratelabs/wazero/internal/sysfs/nonblock_unix.go

18 lines
336 B
Go
Raw Normal View History

//go:build !windows && !plan9 && !tinygo
package sysfs
import (
"syscall"
"github.com/tetratelabs/wazero/experimental/sys"
)
func setNonblock(fd uintptr, enable bool) sys.Errno {
return sys.UnwrapOSError(syscall.SetNonblock(int(fd), enable))
}
func isNonblock(f *osFile) bool {
return f.flag&sys.O_NONBLOCK == sys.O_NONBLOCK
}