diff options
author | kib <kib@FreeBSD.org> | 2012-08-15 15:56:21 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-08-15 15:56:21 +0000 |
commit | 604f552e40a9a201162d6c070fd96bc504b30ff3 (patch) | |
tree | a9682200639371dd135caf82e8d5130aa117d0c2 /sys/kern/init_main.c | |
parent | ba66fb6ab507c9347d6b74704834eddfad52ed48 (diff) | |
download | FreeBSD-src-604f552e40a9a201162d6c070fd96bc504b30ff3.zip FreeBSD-src-604f552e40a9a201162d6c070fd96bc504b30ff3.tar.gz |
Add a sysctl kern.pid_max, which limits the maximum pid the system is
allowed to allocate, and corresponding tunable with the same
name. Note that existing processes with higher pids are left intact.
MFC after: 1 week
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r-- | sys/kern/init_main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ba905e0..3174a34 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -476,6 +476,7 @@ proc0_init(void *dummy __unused) knlist_init_mtx(&p->p_klist, &p->p_mtx); STAILQ_INIT(&p->p_ktr); p->p_nice = NZERO; + /* pid_max cannot be greater then PID_MAX */ td->td_tid = PID_MAX + 1; LIST_INSERT_HEAD(TIDHASH(td->td_tid), td, td_hash); td->td_state = TDS_RUNNING; |