github.com/bananabytelabs/wazero@v0.0.0-20240105073314-54b22a776da8/internal/sysfs/stat.go (about)

     1  package sysfs
     2  
     3  import (
     4  	"io/fs"
     5  
     6  	experimentalsys "github.com/bananabytelabs/wazero/experimental/sys"
     7  	"github.com/bananabytelabs/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  }