feat(watchdog): 检测主机丢失安装时的地址与时钟未经 NTP 同步

This commit is contained in:
Lemon-miaow committed 2026-09-26 01:25:48 +08:00
1 parent c15eec6c2d
commit 298a1e635d
5 files changed
+173 -1

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
//go:build linux
package watchdog
import "syscall"
// ClockStatus reads the kernel's clock status word. Modes stays zero, so the
// call only reads and needs no privilege.
func ClockStatus() (int32, bool) {
var t syscall.Timex
if _, err := syscall.Adjtimex(&t); err != nil {
return 0, false
}
return t.Status, true
}