From 262bd6369634636e10c9faa9afae66a0c5330779 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 18 Feb 1997 22:53:31 +0000 Subject: (cproc_setup): Correctly leave space at top of stack for account for GNU per-thread variables. --- libthreads/i386/thread.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'libthreads/i386/thread.c') diff --git a/libthreads/i386/thread.c b/libthreads/i386/thread.c index 8ba81826..38f91192 100644 --- a/libthreads/i386/thread.c +++ b/libthreads/i386/thread.c @@ -25,7 +25,10 @@ */ /* * HISTORY - * $Log: thread.c,v $ + * $Log: thread.c,v $ + * Revision 1.2 1994/05/04 19:05:26 mib + * entered into RCS + * * Revision 2.6 91/07/31 18:37:07 dbg * Undefine cthread_sp macro around function definition. * [91/07/30 17:36:23 dbg] @@ -52,7 +55,7 @@ */ #ifndef lint -static char rcs_id[] = "$Header: cvs-sans-libpthread/hurd/libthreads/i386/thread.c,v 1.2 1994/05/04 19:05:26 mib Exp $"; +static char rcs_id[] = "$Header: cvs-sans-libpthread/hurd/libthreads/i386/thread.c,v 1.3 1997/02/18 22:53:31 miles Exp $"; #endif not lint @@ -78,7 +81,13 @@ cproc_setup(child, thread, routine) int thread; int routine; { - register int *top = (int *) (child->stack_base + child->stack_size); + extern unsigned int __hurd_threadvar_max; /* GNU */ + register int *top = (int *) + cproc_stack_base (child, + sizeof(ur_cthread_t *) + + /* Account for GNU per-thread variables. */ + __hurd_threadvar_max * + sizeof (long int)); struct i386_thread_state state; register struct i386_thread_state *ts = &state; kern_return_t r; -- cgit v1.2.3