2023-07-09 23:04:17 +08:00
|
|
|
package system
|
|
|
|
|
|
|
|
import "github.com/shirou/gopsutil/process"
|
|
|
|
|
2023-07-15 23:29:03 +08:00
|
|
|
func (i *InfoUtils) GetAllProcessPid() []int32 {
|
2023-07-09 23:04:17 +08:00
|
|
|
pidList, _ := process.Pids()
|
|
|
|
return pidList
|
|
|
|
}
|
|
|
|
|
2023-07-15 23:29:03 +08:00
|
|
|
func (i *InfoUtils) GetProcessInfo(pid int32) *process.Process {
|
2023-07-09 23:04:17 +08:00
|
|
|
info, _ := process.NewProcess(pid)
|
|
|
|
return info
|
|
|
|
}
|