| //go:build unix | |
| package compactscan | |
| 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 | |
| } | |