feat: 实现电脑端被控与控制界面

This commit is contained in:
Nixevol
2026-10-12 07:06:49 +08:00
parent 9dcf8f4837
commit 12adf2951f
110 changed files with 12468 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
//go:build !windows
package lockfile
import (
"os"
"syscall"
)
func lockExclusive(f *os.File) error {
err := syscall.Flock(int(f.Fd()), syscall.LOCK_EX|syscall.LOCK_NB)
if err == syscall.EWOULDBLOCK || err == syscall.EAGAIN {
return ErrBusy
}
return err
}
func unlock(f *os.File) {
_ = syscall.Flock(int(f.Fd()), syscall.LOCK_UN)
}
func ownOnly(path string) {
_ = os.Chmod(path, 0o600)
}