1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
* attr.c (pthread_getattr_np): Don't take thread descriptor size
	into account if USE_TLS.
	* manager.c (pthread_handle_create): Free TLS data structures if call
	failed.  Pass correct stack to clone if USE_TLS.
	* sysdeps/i386/pt-machine.h: Handle multiple inclusion.
	* sysdeps/i386/i686/pt-machine.h: Likewise.
	* sysdeps/i386/tls.h: Unconditionally include <pt-machine.h>.
This commit is contained in:
Ulrich Drepper
2002-02-24 04:57:56 +00:00
parent 6370466d5a
commit b6a0a99693
6 changed files with 61 additions and 8 deletions

View File

@ -283,10 +283,19 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
attr->__inheritsched = descr->p_inheritsched;
attr->__scope = PTHREAD_SCOPE_SYSTEM;
#ifdef _STACK_GROWS_DOWN
# ifdef USE_TLS
attr->__stacksize = descr->p_stackaddr - (char *)descr->p_guardaddr
- descr->p_guardsize;
# else
attr->__stacksize = (char *)(descr + 1) - (char *)descr->p_guardaddr
- descr->p_guardsize;
# endif
#else
# ifdef USE_TLS
attr->__stacksize = (char *)descr->p_guardaddr - descr->p_stackaddr;
# else
attr->__stacksize = (char *)descr->p_guardaddr - (char *)descr;
# endif
#endif
attr->__guardsize = descr->p_guardsize;
attr->__stackaddr_set = descr->p_userstack;
@ -298,10 +307,14 @@ int pthread_getattr_np (pthread_t thread, pthread_attr_t *attr)
otherwise the range of the stack area cannot be computed. */
attr->__stacksize += attr->__guardsize;
#endif
#ifndef _STACK_GROWS_UP
attr->__stackaddr = (char *)(descr + 1);
#ifdef USE_TLS
attr->__stackaddr = descr->p_stackaddr;
#else
# ifndef _STACK_GROWS_UP
attr->__stackaddr = (char *)(descr + 1);
# else
attr->__stackaddr = (char *)descr;
# endif
#endif
return 0;