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.
()
| 129 | // unless the container state is PAUSED in which case every PID in the slice is |
| 130 | // valid. |
| 131 | func (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. |
| 140 | func (c *Container) Stats() (*Stats, error) { |