ValidateProcessList validates a list of processes for ownership and returns those that pass
(pids []int)
| 349 | |
| 350 | // ValidateProcessList validates a list of processes for ownership and returns those that pass |
| 351 | func (pv *ProcessValidator) ValidateProcessList(pids []int) ([]int, map[int]error) { |
| 352 | validPids := make([]int, 0) |
| 353 | errors := make(map[int]error) |
| 354 | |
| 355 | for _, pid := range pids { |
| 356 | if err := pv.ValidatePIDWithOwnership(pid); err != nil { |
| 357 | errors[pid] = err |
| 358 | } else { |
| 359 | validPids = append(validPids, pid) |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | return validPids, errors |
| 364 | } |
| 365 | |
| 366 | // getMaxPID returns the maximum PID value for the current OS |
| 367 | func (pv *ProcessValidator) getMaxPID() int { |
nothing calls this directly
no test coverage detected