adds experimental sys.Errno to begin decoupling from the syscall package (#1582)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -3,8 +3,8 @@ package sysfs
|
||||
import (
|
||||
"net"
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
experimentalsys "github.com/tetratelabs/wazero/experimental/sys"
|
||||
"github.com/tetratelabs/wazero/internal/fsapi"
|
||||
socketapi "github.com/tetratelabs/wazero/internal/sock"
|
||||
"github.com/tetratelabs/wazero/sys"
|
||||
@@ -24,14 +24,14 @@ type baseSockFile struct {
|
||||
var _ fsapi.File = (*baseSockFile)(nil)
|
||||
|
||||
// IsDir implements the same method as documented on File.IsDir
|
||||
func (*baseSockFile) IsDir() (bool, syscall.Errno) {
|
||||
func (*baseSockFile) IsDir() (bool, experimentalsys.Errno) {
|
||||
// We need to override this method because WASI-libc prestats the FD
|
||||
// and the default impl returns ENOSYS otherwise.
|
||||
return false, 0
|
||||
}
|
||||
|
||||
// Stat implements the same method as documented on File.Stat
|
||||
func (f *baseSockFile) Stat() (fs sys.Stat_t, errno syscall.Errno) {
|
||||
func (f *baseSockFile) Stat() (fs sys.Stat_t, errno experimentalsys.Errno) {
|
||||
// The mode is not really important, but it should be neither a regular file nor a directory.
|
||||
fs.Mode = os.ModeIrregular
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user