MCPcopy Create free account
hub / github.com/containerd/nerdctl / RootlessKitChildPid

Function RootlessKitChildPid

pkg/rootlessutil/parent_linux.go:54–66  ·  view source on GitHub ↗
(stateDir string)

Source from the content-addressed store, hash-verified

52}
53
54func RootlessKitChildPid(stateDir string) (int, error) {
55 pidFilePath := filepath.Join(stateDir, "child_pid")
56 if _, err := os.Stat(pidFilePath); err != nil {
57 return 0, err
58 }
59
60 pidFileBytes, err := filesystem.ReadFile(pidFilePath)
61 if err != nil {
62 return 0, err
63 }
64 pidStr := strings.TrimSpace(string(pidFileBytes))
65 return strconv.Atoi(pidStr)
66}
67
68func ParentMain(hostGatewayIP string) error {
69 if !IsRootlessParent() {

Callers 2

ParentMainFunction · 0.85

Calls 2

ReadFileFunction · 0.92
StatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…