返回 DeepSeek-Reasonix
nlink_unix.go
根目录 / internal / checkpoint / nlink_unix.go
1 //go:build !windows
2
3 package checkpoint
4
5 import (
6 "os"
7 "syscall"
8 )
9
10 func fileNlink(fi os.FileInfo) uint64 {
11 if fi == nil {
12 return 1
13 }
14 if st, ok := fi.Sys().(*syscall.Stat_t); ok {
15 return uint64(st.Nlink)
16 }
17 return 1
18 }
19
19 lines GO