mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 21:01:05 +01:00
kern: Introduce kern.pid_max_limit sysctl.
The kern.pid_max_limit will hold the PID_MAX value the kernel was compiled with. The existing kern.pid_max sysctl can be modified and doesn't really represent maximum PID number in the system, as there may still be processes created with higher PIDs before kern.pid_max was lowered. Reivewed by: kib, zlei Approved by: oshogbo Differential Revision: https://reviews.freebsd.org/D43077
This commit is contained in:
parent
84b4342c0d
commit
1b8d70b2eb
@ -754,6 +754,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 <sys/bio.h>
|
||||
#include <sys/buf.h>
|
||||
SYSCTL_INT(_debug_sizeof, OID_AUTO, bio, CTLFLAG_RD,
|
||||
|
@ -955,7 +955,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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user