github.com/gaukas/wazerofs@v0.1.0/sysfs/nonblock_unix.go (about)

     1  //go:build !windows && !plan9
     2  
     3  package sysfs
     4  
     5  import (
     6  	"syscall"
     7  
     8  	"github.com/tetratelabs/wazero/experimental/sys"
     9  )
    10  
    11  func setNonblock(fd uintptr, enable bool) sys.Errno {
    12  	return sys.UnwrapOSError(syscall.SetNonblock(int(fd), enable))
    13  }
    14  
    15  func isNonblock(f *osFile) bool {
    16  	return f.flag&sys.O_NONBLOCK == sys.O_NONBLOCK
    17  }