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

Method isCriticalSystemProcess

lib/process_validator.go:386–405  ·  view source on GitHub ↗

isCriticalSystemProcess checks if a PID represents a critical system process

(pid int)

Source from the content-addressed store, hash-verified

384
385// isCriticalSystemProcess checks if a PID represents a critical system process
386func (pv *ProcessValidator) isCriticalSystemProcess(pid int) bool {
387 criticalPIDs := []int{
388 0, // kernel/swapper
389 1, // init/systemd
390 2, // kthreadd (Linux)
391 }
392
393 for _, criticalPID := range criticalPIDs {
394 if pid == criticalPID {
395 return true
396 }
397 }
398
399 // Additional checks for low-numbered PIDs that are typically system processes
400 if pid <= 10 {
401 return true
402 }
403
404 return false
405}
406
407// verifyProcessExists checks if a process with the given PID exists
408func (pv *ProcessValidator) verifyProcessExists(pid int) error {

Callers 1

ValidatePIDMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected