github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/sysfs/ino.go (about) 1 //go:build !windows && !plan9 && !tinygo 2 3 package sysfs 4 5 import ( 6 "io/fs" 7 "syscall" 8 9 experimentalsys "github.com/tetratelabs/wazero/experimental/sys" 10 "github.com/tetratelabs/wazero/sys" 11 ) 12 13 func inoFromFileInfo(_ string, info fs.FileInfo) (sys.Inode, experimentalsys.Errno) { 14 switch v := info.Sys().(type) { 15 case *sys.Stat_t: 16 return v.Ino, 0 17 case *syscall.Stat_t: 18 return v.Ino, 0 19 default: 20 return 0, 0 21 } 22 }