跳到主要内容

Claude Cage · 面向 Claude 的隔离开发环境,支持桌面工作台、多账号、远程部署与移动端连接。上游 Lee-xeo/Claude-Cage 完整源码镜像,非灵栈原创;主许可 MIT,第三方组件遵循各自许可。来源:https://github.com/Lee-xeo/Claude-Cage 。手动同步,不附带 Release 安装包。

浏览文件

osutil_others.go

40 行 · 812 B历史下载
1//go:build !linux && !windows
2
3// SPDX-FileCopyrightText: Copyright The Lima Authors
4// SPDX-License-Identifier: Apache-2.0
5
6package osutil
7
8import (
9 "io/fs"
10 "syscall"
11)
12
13// UnixPathMax is the value of UNIX_PATH_MAX.
14const UnixPathMax = 104
15
16// Stat is a selection of syscall.Stat_t.
17type Stat struct {
18 Uid uint32
19 Gid uint32
20}
21
22func SysStat(fi fs.FileInfo) (Stat, bool) {
23 stat, ok := fi.Sys().(*syscall.Stat_t)
24 return Stat{Uid: stat.Uid, Gid: stat.Gid}, ok
25}
26
27// SigInt is the value of SIGINT.
28const SigInt = Signal(syscall.SIGINT)
29
30// SigTerm is the value of SIGTERM.
31const SigTerm = Signal(syscall.SIGTERM)
32
33// SigKill is the value of SIGKILL.
34const SigKill = Signal(syscall.SIGKILL)
35
36type Signal syscall.Signal
37
38func SysKill(pid int, sig Signal) error {
39 return syscall.Kill(pid, syscall.Signal(sig))
40}