ONNX
security
malware-detection
Vigil / source /pkg /compactonnx /linkcount_unix.go
turentomer's picture
Publish self-contained Vigil distribution
d2507b5 verified
Raw
History Blame Contribute Delete
290 Bytes
//go:build unix
package compactonnx
import (
"fmt"
"os"
"syscall"
)
func openedHardLinkCount(_ *os.File, info os.FileInfo) (uint64, error) {
stat, ok := info.Sys().(*syscall.Stat_t)
if !ok {
return 0, fmt.Errorf("hard-link count unavailable")
}
return uint64(stat.Nlink), nil
}