diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index 305c5dc25b09..add1c89fa53d 100644 --- a/sys/kern/kern_mib.c +++ b/sys/kern/kern_mib.c @@ -774,6 +774,10 @@ SYSCTL_PROC(_kern, OID_AUTO, pid_max, CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_NOFETCH | CTLFLAG_MPSAFE, 0, 0, sysctl_kern_pid_max, "I", "Maximum allowed pid"); +SYSCTL_INT(_kern, OID_AUTO, pid_max_limit, CTLFLAG_RD, + SYSCTL_NULL_INT_PTR, PID_MAX, + "Maximum allowed pid (kern.pid_max) top limit"); + #include #include SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD, diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 203bea71335c..e39b01cdf099 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -969,7 +969,7 @@ MALLOC_DECLARE(M_SUBPROC); * in a pid_t, as it is used to represent "no process group". */ #define PID_MAX 99999 -#define NO_PID 100000 +#define NO_PID (PID_MAX + 1) #define THREAD0_TID NO_PID extern pid_t pid_max;