summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_prot.c
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-04-10 15:50:52 +0000
committerguenther <guenther@openbsd.org>2012-04-10 15:50:52 +0000
commite6fd2ff84860d099ea5ae17d34f29629f598ebc7 (patch)
tree583b593e87386d627543d084f7eab708e15180d9 /sys/kern/kern_prot.c
parentBuild with -O1 on vax for now, pcre_exec can not build with -O2. (diff)
downloadwireguard-openbsd-e6fd2ff84860d099ea5ae17d34f29629f598ebc7.tar.xz
wireguard-openbsd-e6fd2ff84860d099ea5ae17d34f29629f598ebc7.zip
Make the KERN_NPROCS and KERN_MAXPROC sysctl()s and the RLIMIT_NPROC rlimit
count processes instead of threads. New sysctl()s KERN_NTHREADS and KERN_MAXTHREAD count and limit threads. The nprocs and maxproc kernel variables are replaced by nprocess, maxprocess, nthreads, and maxthread. ok tedu@ mikeb@
Diffstat (limited to 'sys/kern/kern_prot.c')
-rw-r--r--sys/kern/kern_prot.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_prot.c b/sys/kern/kern_prot.c
index 95a7c0a2401..c4a833de12e 100644
--- a/sys/kern/kern_prot.c
+++ b/sys/kern/kern_prot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_prot.c,v 1.52 2012/02/20 22:23:39 guenther Exp $ */
+/* $OpenBSD: kern_prot.c,v 1.53 2012/04/10 15:50:52 guenther Exp $ */
/* $NetBSD: kern_prot.c,v 1.33 1996/02/09 18:59:42 christos Exp $ */
/*
@@ -391,8 +391,8 @@ sys_setresuid(struct proc *p, void *v, register_t *retval)
/*
* Transfer proc count to new user.
*/
- (void)chgproccnt(pc->p_ruid, -p->p_p->ps_refcnt);
- (void)chgproccnt(ruid, p->p_p->ps_refcnt);
+ (void)chgproccnt(pc->p_ruid, -1);
+ (void)chgproccnt(ruid, 1);
pc->p_ruid = ruid;
}
if (euid != (uid_t)-1 && euid != pc->pc_ucred->cr_uid) {
@@ -596,8 +596,8 @@ sys_setuid(struct proc *p, void *v, register_t *retval)
* Transfer proc count to new user.
*/
if (uid != pc->p_ruid) {
- (void)chgproccnt(pc->p_ruid, -p->p_p->ps_refcnt);
- (void)chgproccnt(uid, p->p_p->ps_refcnt);
+ (void)chgproccnt(pc->p_ruid, -1);
+ (void)chgproccnt(uid, 1);
}
pc->p_ruid = uid;
pc->p_svuid = uid;