diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-11-22 09:50:09 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2002-11-22 09:50:09 +0000 |
commit | 6be23702bd0d3d702b7f53c6e3fb06c4a3aa6d75 (patch) | |
tree | 95050a5d5a107888d9ad445ae61db26fe30b5555 /sys | |
parent | a21c36769945ece74d721d13bc2435bc844de2b1 (diff) |
repair proc0 rlimit setup for >2GB machines
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/init_main.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index 8af998125d8..82931441834 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.95 2002/05/27 13:42:16 itojun Exp $ */ +/* $OpenBSD: init_main.c,v 1.96 2002/11/22 09:50:08 deraadt Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -175,6 +175,7 @@ main(framep) register struct pdevinit *pdev; struct timeval rtv; register int i; + quad_t lim; int s; register_t rval[2]; extern struct pdevinit pdevinit[]; @@ -287,10 +288,10 @@ main(framep) limit0.pl_rlimit[RLIMIT_NOFILE].rlim_max = MIN(NOFILE_MAX, (maxfiles - NOFILE > NOFILE) ? maxfiles - NOFILE : NOFILE); limit0.pl_rlimit[RLIMIT_NPROC].rlim_cur = MAXUPRC; - i = ptoa(uvmexp.free); - limit0.pl_rlimit[RLIMIT_RSS].rlim_max = i; - limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = i; - limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = i / 3; + lim = ptoa(uvmexp.free); + limit0.pl_rlimit[RLIMIT_RSS].rlim_max = lim; + limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_max = lim; + limit0.pl_rlimit[RLIMIT_MEMLOCK].rlim_cur = lim / 3; limit0.p_refcnt = 1; /* Allocate a prototype map so we have something to fork. */ |