summaryrefslogtreecommitdiffstats
path: root/sys/nlm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-08-15 15:56:21 +0000
committerkib <kib@FreeBSD.org>2012-08-15 15:56:21 +0000
commit604f552e40a9a201162d6c070fd96bc504b30ff3 (patch)
treea9682200639371dd135caf82e8d5130aa117d0c2 /sys/nlm
parentba66fb6ab507c9347d6b74704834eddfad52ed48 (diff)
downloadFreeBSD-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/nlm')
-rw-r--r--sys/nlm/nlm_advlock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/nlm/nlm_advlock.c b/sys/nlm/nlm_advlock.c
index 416cd1d..0c53be1 100644
--- a/sys/nlm/nlm_advlock.c
+++ b/sys/nlm/nlm_advlock.c
@@ -98,6 +98,7 @@ nlm_client_init(void *dummy)
int i;
mtx_init(&nlm_svid_lock, "NLM svid lock", NULL, MTX_DEF);
+ /* pid_max cannot be greater then PID_MAX */
nlm_svid_allocator = new_unrhdr(PID_MAX + 2, INT_MAX, &nlm_svid_lock);
for (i = 0; i < NLM_SVID_HASH_SIZE; i++)
LIST_INIT(&nlm_file_svids[i]);
OpenPOWER on IntegriCloud