summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjasoni <jasoni@cvs.openbsd.org>2000-10-16 20:10:51 +0000
committerjasoni <jasoni@cvs.openbsd.org>2000-10-16 20:10:51 +0000
commitf12f7594275319ecac79b26fa379306dd319cbf4 (patch)
tree6586890f4501da691e80e0cf899210a08646f1b6
parent720a79541fde2753de166b3d47758f77395f3b32 (diff)
- Fix for some linux apps that broke with recent changes; from NetBSD
-rw-r--r--sys/compat/common/compat_util.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/compat/common/compat_util.c b/sys/compat/common/compat_util.c
index 57585ad9734..0e320e35819 100644
--- a/sys/compat/common/compat_util.c
+++ b/sys/compat/common/compat_util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compat_util.c,v 1.7 2000/09/07 17:56:39 ericj Exp $ */
+/* $OpenBSD: compat_util.c,v 1.8 2000/10/16 20:10:50 jasoni Exp $ */
/* $NetBSD: compat_util.c,v 1.4 1996/03/14 19:31:45 christos Exp $ */
/*
@@ -215,13 +215,16 @@ stackgap_alloc(sgp, sz)
caddr_t *sgp;
size_t sz;
{
+ void *n = (void *) *sgp;
caddr_t nsgp;
-
- struct emul *e = curproc->p_emul; /* XXX */
+ struct proc *p = curproc; /* XXX */
+ struct emul *e = p->p_emul;
int sigsize = e->e_esigcode - e->e_sigcode;
-
- nsgp = *sgp + ALIGN(sz);
- if (nsgp > (((caddr_t)PS_STRINGS) - sigsize))
+
+ sz = ALIGN(sz);
+ nsgp = *sgp + sz;
+ if (nsgp > ((caddr_t)PS_STRINGS - sigsize))
return NULL;
- return (void *)nsgp;
+ *sgp = nsgp;
+ return n;
}