github.com/wasilibs/wazerox@v0.0.0-20240124024944-4923be63ab5f/internal/sysfs/unlink.go (about)

     1  //go:build !windows && !plan9
     2  
     3  package sysfs
     4  
     5  import (
     6  	"syscall"
     7  
     8  	"github.com/wasilibs/wazerox/experimental/sys"
     9  )
    10  
    11  func unlink(name string) (errno sys.Errno) {
    12  	err := syscall.Unlink(name)
    13  	if errno = sys.UnwrapOSError(err); errno == sys.EPERM {
    14  		errno = sys.EISDIR
    15  	}
    16  	return errno
    17  }