github.com/gaukas/wazerofs@v0.1.0/sysfs/stat.go (about) 1 package sysfs 2 3 import ( 4 "io/fs" 5 6 experimentalsys "github.com/tetratelabs/wazero/experimental/sys" 7 "github.com/tetratelabs/wazero/sys" 8 ) 9 10 func defaultStatFile(f fs.File) (sys.Stat_t, experimentalsys.Errno) { 11 if info, err := f.Stat(); err != nil { 12 return sys.Stat_t{}, experimentalsys.UnwrapOSError(err) 13 } else { 14 return sys.NewStat_t(info), 0 15 } 16 }