MCPcopy Create free account
hub / github.com/cronitorio/cronitor-cli / ValidateProcessList

Method ValidateProcessList

lib/process_validator.go:351–364  ·  view source on GitHub ↗

ValidateProcessList validates a list of processes for ownership and returns those that pass

(pids []int)

Source from the content-addressed store, hash-verified

349
350// ValidateProcessList validates a list of processes for ownership and returns those that pass
351func (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
367func (pv *ProcessValidator) getMaxPID() int {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected