A patch for linuxthreads

H . J . Lu hjl@valinux.com
Thu Dec 16 16:12:00 GMT 1999


Hi,

While working on the ia64 port for linuxthreads, I found
this patch was necessary. Any comments?

Thanks.


-- 
H.J. Lu (hjl@gnu.org)
---
Thu Dec 16 15:59:58 1999  H.J. Lu  <hjl@gnu.org>

	* manager.c (pthread_allocate_stack): Correct the calculation
	of "new_thread_bottom".

Index: manager.c
===================================================================
RCS file: /work/cvs/gnu/glibc-2.1/linuxthreads/manager.c,v
retrieving revision 1.1.1.22
diff -u -p -r1.1.1.22 manager.c
--- manager.c	1999/11/27 18:44:03	1.1.1.22
+++ manager.c	1999/12/17 00:10:18
@@ -291,7 +291,7 @@ static int pthread_allocate_stack(const 
     {
       /* Allocate space for stack and thread descriptor at default address */
       new_thread = default_new_thread;
-      new_thread_bottom = (char *) new_thread - STACK_SIZE;
+      new_thread_bottom = (char *) (new_thread + 1) - STACK_SIZE;
       if (mmap((caddr_t)((char *)(new_thread + 1) - INITIAL_STACK_SIZE),
                INITIAL_STACK_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC,
                MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED | MAP_GROWSDOWN,


More information about the Libc-hacker mailing list