isCriticalSystemProcess checks if a PID represents a critical system process
(pid int)
| 384 | |
| 385 | // isCriticalSystemProcess checks if a PID represents a critical system process |
| 386 | func (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 |
| 408 | func (pv *ProcessValidator) verifyProcessExists(pid int) error { |