|
|
|
@ -228,6 +228,14 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) {
|
|
|
|
|
return p.gids, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) {
|
|
|
|
|
err := p.fillFromStatusWithContext(ctx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return []int32{}, err
|
|
|
|
|
}
|
|
|
|
|
return p.groups, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Terminal returns a terminal which is associated with the process.
|
|
|
|
|
func (p *Process) Terminal() (string, error) {
|
|
|
|
|
return p.TerminalWithContext(context.Background())
|
|
|
|
@ -1015,6 +1023,16 @@ func (p *Process) fillFromStatusWithContext(ctx context.Context) error {
|
|
|
|
|
}
|
|
|
|
|
p.gids = append(p.gids, int32(v))
|
|
|
|
|
}
|
|
|
|
|
case "Groups":
|
|
|
|
|
groups := strings.Fields(value)
|
|
|
|
|
p.groups = make([]int32, 0, len(groups))
|
|
|
|
|
for _, i := range groups {
|
|
|
|
|
v, err := strconv.ParseInt(i, 10, 32)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
|
|
|
|
p.groups = append(p.groups, int32(v))
|
|
|
|
|
}
|
|
|
|
|
case "Threads":
|
|
|
|
|
v, err := strconv.ParseInt(value, 10, 32)
|
|
|
|
|
if err != nil {
|
|
|
|
|