chore: 并入 iotlcm-bot 历史到 bot/(原提交 31dbc1d)

This commit is contained in:
MiFaZhan
2026-11-02 13:28:00 +08:00
36 changed files with 3006 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
//go:build linux
package notify
import (
"os"
"syscall"
)
// linkCount 返回目录的硬链接数。
// 宿主机把 bind mount 的源目录删掉后,容器内该目录的 nlink 会变成 0
// (mountinfo 里也能看到 "//deleted"),这是唯一可靠的失效信号。
func linkCount(info os.FileInfo) (uint64, bool) {
st, ok := info.Sys().(*syscall.Stat_t)
if !ok {
return 0, false
}
return uint64(st.Nlink), true
}