Files
devvm/internal/platform/procargs_linux.go
T
w3cjandClaude Opus 5.5 ff57370ffb feat(network): network policy for VMs
A new VM can get network policy: --network-policy, else a question in a
terminal (no by default), else off. devvm makes its CA, writes the VM's
secret bindings, starts the VM's proxy (devvm _proxy, its password in a
file) and starts the VM confined to it, then runs the self-check before
the setup and the shell: a VM that isn't held to its proxy is stopped.
Tokens stay on the host; the hidden devvm secret get reads them for the
proxy, from the Keychain or a file. e2e gets a network section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 10:46:24 -06:00

18 lines
379 B
Go

package platform
import (
"os"
"strconv"
"strings"
)
// ProcessArgs returns a running process's arguments, its program's name
// first, from /proc.
func ProcessArgs(pid int) ([]string, error) {
b, err := os.ReadFile("/proc/" + strconv.Itoa(pid) + "/cmdline")
if err != nil {
return nil, err
}
return strings.Split(strings.TrimSuffix(string(b), "\x00"), "\x00"), nil
}