MCPcopy
hub / github.com/opencontainers/runc / Processes

Method Processes

libcontainer/container_linux.go:131–137  ·  view source on GitHub ↗

Processes returns the PIDs inside this container. The PIDs are in the namespace of the calling process. Some of the returned PIDs may no longer refer to processes in the container, unless the container state is PAUSED in which case every PID in the slice is valid.

()

Source from the content-addressed store, hash-verified

129// unless the container state is PAUSED in which case every PID in the slice is
130// valid.
131func (c *Container) Processes() ([]int, error) {
132 pids, err := c.cgroupManager.GetAllPids()
133 if err = c.ignoreCgroupError(err); err != nil {
134 return nil, fmt.Errorf("unable to get all container pids: %w", err)
135 }
136 return pids, nil
137}
138
139// Stats returns statistics for the container.
140func (c *Container) Stats() (*Stats, error) {

Callers 4

TestGetContainerPidsFunction · 0.95
ps.goFile · 0.80
Example_containerFunction · 0.80
TestEnterFunction · 0.80

Calls 2

ignoreCgroupErrorMethod · 0.95
GetAllPidsMethod · 0.80

Tested by 3

TestGetContainerPidsFunction · 0.76
Example_containerFunction · 0.64
TestEnterFunction · 0.64