|
|
|
@ -10,8 +10,8 @@ import (
|
|
|
|
|
"syscall"
|
|
|
|
|
"unsafe"
|
|
|
|
|
|
|
|
|
|
"github.com/shirou/gopsutil/internal/common"
|
|
|
|
|
"github.com/shirou/gopsutil/cpu"
|
|
|
|
|
"github.com/shirou/gopsutil/internal/common"
|
|
|
|
|
"github.com/shirou/gopsutil/net"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
@ -278,7 +278,19 @@ func (p *Process) MemoryPercent() (float32, error) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) Children() ([]*Process, error) {
|
|
|
|
|
return nil, common.NotImplementedError
|
|
|
|
|
pids, err := common.CallPgrep(invoke, p.Pid)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
ret := make([]*Process, 0, len(pids))
|
|
|
|
|
for _, pid := range pids {
|
|
|
|
|
np, err := NewProcess(pid)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
ret = append(ret, np)
|
|
|
|
|
}
|
|
|
|
|
return ret, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *Process) OpenFiles() ([]OpenFilesStat, error) {
|
|
|
|
|