summaryrefslogtreecommitdiff
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1999-11-05 01:18:02 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1999-11-05 01:18:02 +0000
commit8332337530b29e3156a5e9c2842f404a3a07ab9b (patch)
treef69c5b139ad7aa90017f0e06ad21a5a46edd54fa /sys/kern/kern_resource.c
parent5da8f7d8903617ae0b00ee23a3c3e4614ee07563 (diff)
more stack direction fixes; art@ ok
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 29ed4c743b2..4db024054c9 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_resource.c,v 1.9 1999/07/15 14:07:41 art Exp $ */
+/* $OpenBSD: kern_resource.c,v 1.10 1999/11/05 01:18:01 mickey Exp $ */
/* $NetBSD: kern_resource.c,v 1.38 1996/10/23 07:19:38 matthias Exp $ */
/*-
@@ -282,11 +282,19 @@ dosetrlimit(p, which, limp)
if (limp->rlim_cur > alimp->rlim_cur) {
prot = VM_PROT_ALL;
size = limp->rlim_cur - alimp->rlim_cur;
+#ifdef MACHINE_STACK_GROWS_UP
+ addr = USRSTACK + alimp->rlim_cur;
+#else
addr = USRSTACK - limp->rlim_cur;
+#endif
} else {
prot = VM_PROT_NONE;
size = alimp->rlim_cur - limp->rlim_cur;
+#ifdef MACHINE_STACK_GROWS_UP
+ addr = USRSTACK + limp->rlim_cur;
+#else
addr = USRSTACK - alimp->rlim_cur;
+#endif
}
addr = trunc_page(addr);
size = round_page(size);