hurd: Avoid local PLTs in libpthread.

* htl/cthreads-compat.c (__cthread_detach): Call __pthread_detach
	instead of pthread_detach.
	(__cthread_fork): Call __pthread_create instead of pthread_create.
	(__cthread_keycreate): Call __pthread_key_create instead of
	pthread_key_create.
	(__cthread_getspecific): Call __pthread_getspecific instead of
	pthread_getspecific.
	(__cthread_setspecific): Call __pthread_setspecific instead of
	pthread_setspecific.
	* htl/pt-alloc.c (__pthread_alloc): Call __pthread_mutex_lock and
	__pthread_mutex_unlock instead of pthread_mutex_lock and
	pthread_mutex_unlock.
	* htl/pt-cleanup.c (__pthread_get_cleanup_stack): Rename to
	___pthread_get_cleanup_stack.
	(__pthread_get_cleanup_stack): New strong alias.
	* htl/pt-create.c: Include <pthreadP.h>.
	(entry_point): Call __pthread_exit instead of pthread_exit.
	(pthread_create): Rename to __pthread_create.
	(pthread_create): New strong alias.
	* htl/pt-detach.c (pthread_detach): Rename to __pthread_detach.
	(pthread_detach): New strong alias.
	(__pthread_detach): Call __pthread_cond_broadcast instead of
	pthread_cond_broadcast.
	* htl/pt-exit.c (__pthread_exit): Call __pthread_setcancelstate
	instead of pthread_setcancelstate.
	* htl/pt-testcancel.c: Include <pthreadP.h>.
	(pthread_testcancel): Call __pthread_exit instead of pthread_exit.
	* sysdeps/htl/pt-attr-getstack.c: Include <pthreadP.h>
	(__pthread_attr_getstack): Call __pthread_attr_getstackaddr and
	__pthread_attr_getstacksize instead of pthread_attr_getstackaddr and
	pthread_attr_getstacksize.
	* sysdeps/htl/pt-attr-getstackaddr.c (pthread_attr_getstackaddr):
	Rename to __pthread_attr_getstackaddr.
	(pthread_attr_getstackaddr): New strong alias.
	* sysdeps/htl/pt-attr-getstacksize.c (pthread_attr_getstacksize):
	Rename to __pthread_attr_getstacksize.
	(pthread_attr_getstacksize): New strong alias.
	* sysdeps/htl/pt-attr-setstack.c: Include <pthreadP.h>.
	(pthread_attr_setstack): Rename to __pthread_attr_setstack.
	(pthread_attr_setstack): New strong alias.
	(__pthread_attr_setstack): Call __pthread_attr_getstacksize,
	__pthread_attr_setstacksize and __pthread_attr_setstackaddr instead of
	pthread_attr_getstacksize, pthread_attr_setstacksize and
	pthread_attr_setstackaddr.
	* sysdeps/htl/pt-attr-setstackaddr.c (pthread_attr_setstackaddr):
	Rename to __pthread_attr_setstackaddr.
	(pthread_attr_setstackaddr): New strong alias.
	* sysdeps/htl/pt-attr-setstacksize.c (pthread_attr_setstacksize):
	Rename to __pthread_attr_setstacksize.
	(pthread_attr_setstacksize): New strong alias.
	* sysdeps/htl/pt-cond-timedwait.c: Include <pthreadP.h>.
	(__pthread_cond_timedwait_internal): Use __pthread_exit instead of
	pthread_exit.
	* sysdeps/htl/pt-key-create.c: Include <pthreadP.h>.
	(__pthread_key_create): New hidden def.
	* sysdeps/htl/pt-key.h: Include <pthreadP.h>.
	* sysdeps/htl/pthreadP.h (_pthread_mutex_init,
	__pthread_cond_broadcast, __pthread_create, __pthread_detach,
	__pthread_exit, __pthread_key_create, __pthread_getspecific,
	__pthread_setspecific, __pthread_setcancelstate,
	__pthread_attr_getstackaddr, __pthread_attr_setstackaddr,
	__pthread_attr_getstacksize, __pthread_attr_setstacksize,
	__pthread_attr_setstack, ___pthread_get_cleanup_stack): New
	declarations.
	(__pthread_key_create, _pthread_mutex_init): New hidden declarations.
	* sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
	(pthread_attr_setstackaddr): Rename to __pthread_attr_setstackaddr.
	(pthread_attr_setstackaddr): New strong alias.
	* sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
	(pthread_attr_setstacksize): Rename to __pthread_attr_setstacksize.
	(pthread_attr_setstacksize): New strong alias.
	* sysdeps/mach/hurd/htl/pt-docancel.c: Include <pthreadP.h>.
	(call_exit): Call __pthread_exit instead of pthread_exit.
	* sysdeps/mach/hurd/htl/pt-mutex-init.c: Include <pthreadP.h>.
	(_pthread_mutex_init): New hidden definition.
	* sysdeps/mach/hurd/htl/pt-sysdep.c: Include <pthreadP.h>.
	(_init_routine): Call __pthread_attr_init and __pthread_attr_setstack
	instead of pthread_attr_init and pthread_attr_setstack.
This commit is contained in:
Samuel Thibault 2018-04-02 18:08:37 +00:00
parent fa9e15558d
commit f6fb29d22e
23 changed files with 163 additions and 35 deletions

View File

@ -226,6 +226,85 @@
* sysdeps/mach/hurd/bits/stat.h [!__USE_MISC && __USE_ATFILE]
(UTIME_NOW, UTIME_OMIT): Define macros.
* htl/cthreads-compat.c (__cthread_detach): Call __pthread_detach
instead of pthread_detach.
(__cthread_fork): Call __pthread_create instead of pthread_create.
(__cthread_keycreate): Call __pthread_key_create instead of
pthread_key_create.
(__cthread_getspecific): Call __pthread_getspecific instead of
pthread_getspecific.
(__cthread_setspecific): Call __pthread_setspecific instead of
pthread_setspecific.
* htl/pt-alloc.c (__pthread_alloc): Call __pthread_mutex_lock and
__pthread_mutex_unlock instead of pthread_mutex_lock and
pthread_mutex_unlock.
* htl/pt-cleanup.c (__pthread_get_cleanup_stack): Rename to
___pthread_get_cleanup_stack.
(__pthread_get_cleanup_stack): New strong alias.
* htl/pt-create.c: Include <pthreadP.h>.
(entry_point): Call __pthread_exit instead of pthread_exit.
(pthread_create): Rename to __pthread_create.
(pthread_create): New strong alias.
* htl/pt-detach.c (pthread_detach): Rename to __pthread_detach.
(pthread_detach): New strong alias.
(__pthread_detach): Call __pthread_cond_broadcast instead of
pthread_cond_broadcast.
* htl/pt-exit.c (__pthread_exit): Call __pthread_setcancelstate
instead of pthread_setcancelstate.
* htl/pt-testcancel.c: Include <pthreadP.h>.
(pthread_testcancel): Call __pthread_exit instead of pthread_exit.
* sysdeps/htl/pt-attr-getstack.c: Include <pthreadP.h>
(__pthread_attr_getstack): Call __pthread_attr_getstackaddr and
__pthread_attr_getstacksize instead of pthread_attr_getstackaddr and
pthread_attr_getstacksize.
* sysdeps/htl/pt-attr-getstackaddr.c (pthread_attr_getstackaddr):
Rename to __pthread_attr_getstackaddr.
(pthread_attr_getstackaddr): New strong alias.
* sysdeps/htl/pt-attr-getstacksize.c (pthread_attr_getstacksize):
Rename to __pthread_attr_getstacksize.
(pthread_attr_getstacksize): New strong alias.
* sysdeps/htl/pt-attr-setstack.c: Include <pthreadP.h>.
(pthread_attr_setstack): Rename to __pthread_attr_setstack.
(pthread_attr_setstack): New strong alias.
(__pthread_attr_setstack): Call __pthread_attr_getstacksize,
__pthread_attr_setstacksize and __pthread_attr_setstackaddr instead of
pthread_attr_getstacksize, pthread_attr_setstacksize and
pthread_attr_setstackaddr.
* sysdeps/htl/pt-attr-setstackaddr.c (pthread_attr_setstackaddr):
Rename to __pthread_attr_setstackaddr.
(pthread_attr_setstackaddr): New strong alias.
* sysdeps/htl/pt-attr-setstacksize.c (pthread_attr_setstacksize):
Rename to __pthread_attr_setstacksize.
(pthread_attr_setstacksize): New strong alias.
* sysdeps/htl/pt-cond-timedwait.c: Include <pthreadP.h>.
(__pthread_cond_timedwait_internal): Use __pthread_exit instead of
pthread_exit.
* sysdeps/htl/pt-key-create.c: Include <pthreadP.h>.
(__pthread_key_create): New hidden def.
* sysdeps/htl/pt-key.h: Include <pthreadP.h>.
* sysdeps/htl/pthreadP.h (_pthread_mutex_init,
__pthread_cond_broadcast, __pthread_create, __pthread_detach,
__pthread_exit, __pthread_key_create, __pthread_getspecific,
__pthread_setspecific, __pthread_setcancelstate,
__pthread_attr_getstackaddr, __pthread_attr_setstackaddr,
__pthread_attr_getstacksize, __pthread_attr_setstacksize,
__pthread_attr_setstack, ___pthread_get_cleanup_stack): New
declarations.
(__pthread_key_create, _pthread_mutex_init): New hidden declarations.
* sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
(pthread_attr_setstackaddr): Rename to __pthread_attr_setstackaddr.
(pthread_attr_setstackaddr): New strong alias.
* sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
(pthread_attr_setstacksize): Rename to __pthread_attr_setstacksize.
(pthread_attr_setstacksize): New strong alias.
* sysdeps/mach/hurd/htl/pt-docancel.c: Include <pthreadP.h>.
(call_exit): Call __pthread_exit instead of pthread_exit.
* sysdeps/mach/hurd/htl/pt-mutex-init.c: Include <pthreadP.h>.
(_pthread_mutex_init): New hidden definition.
* sysdeps/mach/hurd/htl/pt-sysdep.c: Include <pthreadP.h>.
(_init_routine): Call __pthread_attr_init and __pthread_attr_setstack
instead of pthread_attr_init and pthread_attr_setstack.
2018-04-02 Agustina Arzille <avarzille@riseup.net>
Amos Jeffries <squid3@treenet.co.nz>
David Michael <fedora.dm0@gmail.com>

View File

@ -26,7 +26,7 @@ __cthread_detach (__cthread_t thread)
{
int err;
err = pthread_detach ((pthread_t) thread);
err = __pthread_detach ((pthread_t) thread);
assert_perror (err);
}
weak_alias (__cthread_detach, cthread_detach)
@ -37,7 +37,7 @@ __cthread_fork (__cthread_fn_t func, void *arg)
pthread_t thread;
int err;
err = pthread_create (&thread, NULL, func, arg);
err = __pthread_create (&thread, NULL, func, arg);
assert_perror (err);
return (__cthread_t) thread;
@ -49,7 +49,7 @@ __cthread_keycreate (__cthread_key_t *key)
{
error_t err;
err = pthread_key_create (key, 0);
err = __pthread_key_create (key, 0);
if (err)
{
errno = err;
@ -64,7 +64,7 @@ weak_alias (__cthread_keycreate, cthread_keycreate)
int
__cthread_getspecific (__cthread_key_t key, void **val)
{
*val = pthread_getspecific (key);
*val = __pthread_getspecific (key);
return 0;
}
weak_alias (__cthread_getspecific, cthread_getspecific)
@ -74,7 +74,7 @@ __cthread_setspecific (__cthread_key_t key, void *val)
{
error_t err;
err = pthread_setspecific (key, (const void *) val);
err = __pthread_setspecific (key, (const void *) val);
if (err)
{
errno = err;

View File

@ -91,7 +91,7 @@ __pthread_alloc (struct __pthread **pthread)
int max_threads;
int new_max_threads;
pthread_mutex_lock (&__pthread_free_threads_lock);
__pthread_mutex_lock (&__pthread_free_threads_lock);
for (new = __pthread_free_threads; new; new = new->next)
{
/* There is no need to take NEW->STATE_LOCK: if NEW is on this
@ -105,7 +105,7 @@ __pthread_alloc (struct __pthread **pthread)
break;
}
}
pthread_mutex_unlock (&__pthread_free_threads_lock);
__pthread_mutex_unlock (&__pthread_free_threads_lock);
if (new)
{

View File

@ -21,7 +21,8 @@
#include <pt-internal.h>
struct __pthread_cancelation_handler **
__pthread_get_cleanup_stack (void)
___pthread_get_cleanup_stack (void)
{
return &_pthread_self ()->cancelation_handlers;
}
strong_alias (___pthread_get_cleanup_stack, __pthread_cleanup_stack)

View File

@ -26,6 +26,7 @@
#include <hurd/resource.h>
#include <pt-internal.h>
#include <pthreadP.h>
#if IS_IN (libpthread)
# include <ctype.h>
@ -58,14 +59,14 @@ entry_point (struct __pthread *self, void *(*start_routine) (void *), void *arg)
__pthread_startup ();
pthread_exit (start_routine (arg));
__pthread_exit (start_routine (arg));
}
/* Create a thread with attributes given by ATTR, executing
START_ROUTINE with argument ARG. */
int
pthread_create (pthread_t * thread, const pthread_attr_t * attr,
void *(*start_routine) (void *), void *arg)
__pthread_create (pthread_t * thread, const pthread_attr_t * attr,
void *(*start_routine) (void *), void *arg)
{
int err;
struct __pthread *pthread;
@ -78,6 +79,7 @@ pthread_create (pthread_t * thread, const pthread_attr_t * attr,
return err;
}
strong_alias (__pthread_create, pthread_create)
/* Internal version of pthread_create. See comment in
pt-internal.h. */

View File

@ -25,7 +25,7 @@
/* Indicate that the storage for THREAD can be reclaimed when it
terminates. */
int
pthread_detach (pthread_t thread)
__pthread_detach (pthread_t thread)
{
struct __pthread *pthread;
int err = 0;
@ -47,7 +47,7 @@ pthread_detach (pthread_t thread)
/* Broadcast the condition. This will make threads that are
waiting to join THREAD continue with hopefully disastrous
consequences instead of blocking indefinitely. */
pthread_cond_broadcast (&pthread->state_cond);
__pthread_cond_broadcast (&pthread->state_cond);
__pthread_mutex_unlock (&pthread->state_lock);
__pthread_dealloc (pthread);
@ -77,3 +77,4 @@ pthread_detach (pthread_t thread)
return err;
}
strong_alias (__pthread_detach, pthread_detach)

View File

@ -38,14 +38,14 @@ __pthread_exit (void *status)
/* Run any cancelation handlers. According to POSIX, the
cancellation cleanup handlers should be called with cancellation
disabled. */
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
__pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, &oldstate);
for (handlers = __pthread_get_cleanup_stack ();
*handlers != NULL;
*handlers = (*handlers)->__next)
(*handlers)->__handler ((*handlers)->__arg);
pthread_setcancelstate (oldstate, &oldstate);
__pthread_setcancelstate (oldstate, &oldstate);
/* Decrease the number of threads. We use an atomic operation to
make sure that only the last thread calls `exit'. */

View File

@ -19,6 +19,7 @@
#include <pthread.h>
#include <pt-internal.h>
#include <pthreadP.h>
void
pthread_testcancel (void)
@ -31,5 +32,5 @@ pthread_testcancel (void)
__pthread_mutex_unlock (&p->cancel_lock);
if (cancelled)
pthread_exit (PTHREAD_CANCELED);
__pthread_exit (PTHREAD_CANCELED);
}

View File

@ -18,13 +18,14 @@
#include <pthread.h>
#include <pt-internal.h>
#include <pthreadP.h>
int
__pthread_attr_getstack (const pthread_attr_t *attr,
void **stackaddr, size_t * stacksize)
{
pthread_attr_getstackaddr (attr, stackaddr);
pthread_attr_getstacksize (attr, stacksize);
__pthread_attr_getstackaddr (attr, stackaddr);
__pthread_attr_getstacksize (attr, stacksize);
return 0;
}
weak_alias (__pthread_attr_getstack, pthread_attr_getstack)

View File

@ -20,8 +20,9 @@
#include <pt-internal.h>
int
pthread_attr_getstackaddr (const pthread_attr_t *attr, void **stackaddr)
__pthread_attr_getstackaddr (const pthread_attr_t *attr, void **stackaddr)
{
*stackaddr = attr->__stackaddr;
return 0;
}
strong_alias (__pthread_attr_getstackaddr, pthread_attr_getstackaddr)

View File

@ -20,8 +20,9 @@
#include <pt-internal.h>
int
pthread_attr_getstacksize (const pthread_attr_t *attr, size_t * stacksize)
__pthread_attr_getstacksize (const pthread_attr_t *attr, size_t * stacksize)
{
*stacksize = attr->__stacksize;
return 0;
}
strong_alias (__pthread_attr_getstacksize, pthread_attr_getstacksize)

View File

@ -20,25 +20,26 @@
#include <assert.h>
#include <pt-internal.h>
#include <pthreadP.h>
int
pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize)
__pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize)
{
int err;
size_t s;
/* pthread_attr_setstack should always succeed, thus we set the size
first as it is more discriminating. */
pthread_attr_getstacksize (attr, &s);
__pthread_attr_getstacksize (attr, &s);
err = pthread_attr_setstacksize (attr, stacksize);
err = __pthread_attr_setstacksize (attr, stacksize);
if (err)
return err;
err = pthread_attr_setstackaddr (attr, stackaddr);
err = __pthread_attr_setstackaddr (attr, stackaddr);
if (err)
{
int e = pthread_attr_setstacksize (attr, s);
int e = __pthread_attr_setstacksize (attr, s);
assert_perror (e);
return err;
@ -46,3 +47,4 @@ pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize)
return 0;
}
strong_alias (__pthread_attr_setstack, pthread_attr_setstack)

View File

@ -20,8 +20,9 @@
#include <pt-internal.h>
int
pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
__pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
{
attr->__stackaddr = stackaddr;
return 0;
}
strong_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr)

View File

@ -20,9 +20,9 @@
#include <pt-internal.h>
int
pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
__pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
{
attr->__stacksize = stacksize;
return 0;
}
strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)

View File

@ -19,6 +19,7 @@
#include <pthread.h>
#include <pt-internal.h>
#include <pthreadP.h>
extern int __pthread_cond_timedwait_internal (pthread_cond_t *cond,
pthread_mutex_t *mutex,
@ -115,7 +116,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond,
__pthread_mutex_unlock (&self->cancel_lock);
if (cancelled)
pthread_exit (PTHREAD_CANCELED);
__pthread_exit (PTHREAD_CANCELED);
/* Release MUTEX before blocking. */
__pthread_mutex_unlock (mutex);
@ -171,7 +172,7 @@ __pthread_cond_timedwait_internal (pthread_cond_t *cond,
__pthread_mutex_lock (mutex);
if (cancelled)
pthread_exit (PTHREAD_CANCELED);
__pthread_exit (PTHREAD_CANCELED);
return err;
}

View File

@ -21,6 +21,7 @@
#include <assert.h>
#include <pt-internal.h>
#include <pthreadP.h>
pthread_mutex_t __pthread_key_lock;
@ -106,3 +107,4 @@ do_search:
return 0;
}
strong_alias (__pthread_key_create, pthread_key_create)
hidden_def (__pthread_key_create)

View File

@ -18,6 +18,7 @@
#include <pthread.h>
#include <libc-lockP.h>
#include <pthreadP.h>
#define PTHREAD_KEY_MEMBERS \
void **thread_specifics; /* This is only resized by the thread, and always growing */ \

View File

@ -27,20 +27,48 @@ extern pthread_t __pthread_self (void);
extern int __pthread_kill (pthread_t threadid, int signo);
extern struct __pthread **__pthread_threads;
extern int _pthread_mutex_init (pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
extern int __pthread_mutex_lock (pthread_mutex_t *__mutex);
extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex);
extern int __pthread_cond_broadcast (pthread_cond_t *cond);
typedef struct __cthread *__cthread_t;
typedef int __cthread_key_t;
typedef void * (*__cthread_fn_t)(void *__arg);
__cthread_t __cthread_fork (__cthread_fn_t, void *);
int __pthread_create (pthread_t *newthread,
const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg);
void __cthread_detach (__cthread_t);
int __pthread_detach (pthread_t __threadp);
void __pthread_exit (void *value) __attribute__ ((__noreturn__));
int __cthread_keycreate (__cthread_key_t *);
int __cthread_getspecific (__cthread_key_t, void **);
int __cthread_setspecific (__cthread_key_t, void *);
int __pthread_key_create (pthread_key_t *key, void (*destr) (void *));
void *__pthread_getspecific (pthread_key_t key);
int __pthread_setspecific (pthread_key_t key, const void *value);
int __pthread_setcancelstate (int state, int *oldstate);
int __pthread_getattr_np (pthread_t, pthread_attr_t *);
int __pthread_attr_getstackaddr (const pthread_attr_t *__restrict __attr,
void **__restrict __stackaddr);
int __pthread_attr_setstackaddr (pthread_attr_t *__attr, void *__stackaddr);
int __pthread_attr_getstacksize (const pthread_attr_t *__restrict __attr,
size_t *__restrict __stacksize);
int __pthread_attr_setstacksize (pthread_attr_t *__attr, size_t __stacksize);
int __pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
size_t __stacksize);
int __pthread_attr_getstack (const pthread_attr_t *, void **, size_t *);
struct __pthread_cancelation_handler **___pthread_get_cleanup_stack (void);
#if IS_IN (libpthread)
hidden_proto (__pthread_key_create)
hidden_proto (_pthread_mutex_init)
#endif
#endif /* pthreadP.h */

View File

@ -20,8 +20,9 @@
#include <pt-internal.h>
int
pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
__pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
{
attr->__stackaddr = stackaddr;
return 0;
}
strong_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr)

View File

@ -20,8 +20,9 @@
#include <pt-internal.h>
int
pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
__pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
{
attr->__stacksize = stacksize;
return 0;
}
strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)

View File

@ -19,11 +19,12 @@
#include <pthread.h>
#include <pt-internal.h>
#include <pthreadP.h>
static void
call_exit (void)
{
pthread_exit (0);
__pthread_exit (0);
}
int

View File

@ -20,6 +20,7 @@
#include <stdlib.h>
#include <assert.h>
#include <pt-internal.h>
#include <pthreadP.h>
#include "pt-mutex.h"
#include <hurdlock.h>
@ -53,3 +54,4 @@ _pthread_mutex_init (pthread_mutex_t *mtxp, const pthread_mutexattr_t *attrp)
}
strong_alias (_pthread_mutex_init, pthread_mutex_init)
hidden_def (_pthread_mutex_init)

View File

@ -24,6 +24,7 @@
#include <mach/mig_support.h>
#include <pt-internal.h>
#include <pthreadP.h>
__thread struct __pthread *___pthread_self;
@ -57,8 +58,8 @@ _init_routine (void *stack)
while the main program was not linked against libpthread. */
/* Avoid allocating another stack */
attrp = &attr;
pthread_attr_init (attrp);
pthread_attr_setstack (attrp, stack, __vm_page_size);
__pthread_attr_init (attrp);
__pthread_attr_setstack (attrp, stack, __vm_page_size);
}
/* Create the pthread structure for the main thread (i.e. us). */