1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-04-26 13:48:59 +08:00

[process][darwin] Remove Groups() as it's non-functional

This commit is contained in:
Lomanic 2020-11-08 01:29:50 +01:00
parent 64e16cc8c3
commit 148a662b06
2 changed files with 20 additions and 18 deletions

View File

@ -212,17 +212,18 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) {
}
func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) {
k, err := p.getKProc()
if err != nil {
return nil, err
}
return nil, common.ErrNotImplementedError
// k, err := p.getKProc()
// if err != nil {
// return nil, err
// }
groups := make([]int32, k.Eproc.Ucred.Ngroups)
for i := int16(0); i < k.Eproc.Ucred.Ngroups; i++ {
groups[i] = int32(k.Eproc.Ucred.Groups[i])
}
// groups := make([]int32, k.Eproc.Ucred.Ngroups)
// for i := int16(0); i < k.Eproc.Ucred.Ngroups; i++ {
// groups[i] = int32(k.Eproc.Ucred.Groups[i])
// }
return groups, nil
// return groups, nil
}
func (p *Process) TerminalWithContext(ctx context.Context) (string, error) {

View File

@ -212,17 +212,18 @@ func (p *Process) GidsWithContext(ctx context.Context) ([]int32, error) {
}
func (p *Process) GroupsWithContext(ctx context.Context) ([]int32, error) {
k, err := p.getKProc()
if err != nil {
return nil, err
}
return nil, common.ErrNotImplementedError
// k, err := p.getKProc()
// if err != nil {
// return nil, err
// }
groups := make([]int32, k.Eproc.Ucred.Ngroups)
for i := int16(0); i < k.Eproc.Ucred.Ngroups; i++ {
groups[i] = int32(k.Eproc.Ucred.Groups[i])
}
// groups := make([]int32, k.Eproc.Ucred.Ngroups)
// for i := int16(0); i < k.Eproc.Ucred.Ngroups; i++ {
// groups[i] = int32(k.Eproc.Ucred.Groups[i])
// }
return groups, nil
// return groups, nil
}
func (p *Process) TerminalWithContext(ctx context.Context) (string, error) {