...
1 package sysfs
2
3 import (
4 "io/fs"
5 "path"
6
7 experimentalsys "github.com/tetratelabs/wazero/experimental/sys"
8 "github.com/tetratelabs/wazero/sys"
9 )
10
11
12 func inoFromFileInfo(dirPath string, info fs.FileInfo) (ino sys.Inode, errno experimentalsys.Errno) {
13 if v, ok := info.Sys().(*sys.Stat_t); ok {
14 return v.Ino, 0
15 }
16 if dirPath == "" {
17
18
19 return
20 }
21
22 inoPath := path.Clean(path.Join(dirPath, info.Name()))
23 var st sys.Stat_t
24 if st, errno = lstat(inoPath); errno == 0 {
25 ino = st.Ino
26 }
27 return
28 }
29
View as plain text