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

Method getMaxPID

lib/process_validator.go:367–383  ·  view source on GitHub ↗

getMaxPID returns the maximum PID value for the current OS

()

Source from the content-addressed store, hash-verified

365
366// getMaxPID returns the maximum PID value for the current OS
367func (pv *ProcessValidator) getMaxPID() int {
368 switch runtime.GOOS {
369 case "linux":
370 // Linux default max PID is 4194304 (2^22)
371 // Could also read from /proc/sys/kernel/pid_max but using safe default
372 return 4194304
373 case "darwin":
374 // macOS typical max PID
375 return 99998
376 case "windows":
377 // Windows typical max PID
378 return 65536
379 default:
380 // Conservative default for other Unix-like systems
381 return 32768
382 }
383}
384
385// isCriticalSystemProcess checks if a PID represents a critical system process
386func (pv *ProcessValidator) isCriticalSystemProcess(pid int) bool {

Callers 1

ValidatePIDMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected