summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_map.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>1999-06-17 21:29:38 +0000
committeralc <alc@FreeBSD.org>1999-06-17 21:29:38 +0000
commit90cdb68b0a3d08ab2f6d7ff5afebf43083a25f2f (patch)
tree409c8c5f0fb1d8b91ef7598070dd4b1d4fadd0c2 /sys/vm/vm_map.c
parent21c748c1498a684fb7c91f5ef34a46442e074acd (diff)
downloadFreeBSD-src-90cdb68b0a3d08ab2f6d7ff5afebf43083a25f2f.zip
FreeBSD-src-90cdb68b0a3d08ab2f6d7ff5afebf43083a25f2f.tar.gz
vm_map_growstack uses vmspace::vm_ssize as though it contained
the stack size in bytes when in fact it is the stack size in pages.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r--sys/vm/vm_map.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index dce5cb1..c96c0d7 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_map.c,v 1.168 1999/06/17 00:39:26 alc Exp $
+ * $Id: vm_map.c,v 1.169 1999/06/17 05:49:00 alc Exp $
*/
/*
@@ -2281,7 +2281,7 @@ Retry:
/* If this is the main process stack, see if we're over the
* stack limit.
*/
- if (is_procstack && (vm->vm_ssize + grow_amount >
+ if (is_procstack && (ctob(vm->vm_ssize) + grow_amount >
p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
vm_map_unlock_read(map);
return (KERN_NO_SPACE);
@@ -2292,10 +2292,10 @@ Retry:
if (grow_amount > stack_entry->avail_ssize) {
grow_amount = stack_entry->avail_ssize;
}
- if (is_procstack && (vm->vm_ssize + grow_amount >
+ if (is_procstack && (ctob(vm->vm_ssize) + grow_amount >
p->p_rlimit[RLIMIT_STACK].rlim_cur)) {
grow_amount = p->p_rlimit[RLIMIT_STACK].rlim_cur -
- vm->vm_ssize;
+ ctob(vm->vm_ssize);
}
if (vm_map_lock_upgrade(map))
@@ -2330,8 +2330,8 @@ Retry:
(new_stack_entry->end -
new_stack_entry->start);
if (is_procstack)
- vm->vm_ssize += new_stack_entry->end -
- new_stack_entry->start;
+ vm->vm_ssize += btoc(new_stack_entry->end -
+ new_stack_entry->start);
}
}
OpenPOWER on IntegriCloud