summary refs log tree commit diff
path: root/linuxthreads/manager.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-10-09 09:42:48 +0000
committerUlrich Drepper <drepper@redhat.com>2002-10-09 09:42:48 +0000
commit6166815d696407069c33c1f0cad76fb1847e4bc7 (patch)
treed7aaf5fd8551eb6d69fb80863a4a415cfaa9c01a /linuxthreads/manager.c
parent4c2821faea94c4300fe283f13e4a667f1f73b90b (diff)
downloadglibc-6166815d696407069c33c1f0cad76fb1847e4bc7.tar.gz
glibc-6166815d696407069c33c1f0cad76fb1847e4bc7.tar.xz
glibc-6166815d696407069c33c1f0cad76fb1847e4bc7.zip
Update.
2002-10-09  Ulrich Drepper  <drepper@redhat.com>

	* Versions.def (libc): Add GLIBC_2.3.1.
	(libpthread): Add GLIBC_2.3.1.

	* include/signal.h: Add libc_hidden_proto for __sigwait, __sigwaitinfo,
	and __sigtimedwait.
	* signal/Versions: Add __sigtimedwait, __sigwait, and __sigwaitinfo.
	* sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Add
	libc_hidden_def.
	* sysdeps/unix/sysv/linux/sigwait.c (__sigwait): Likewise.
	* sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.

	* include/sys/msg.h: Declare __libc_msgrcv and __libc_msgsnd.
	* sysdeps/unix/sysv/linux/msgrcv.c (__msgrcv): Rename to __libc_msgrcv
	and make old name an alias.
	* sysdeps/unix/sysv/linux/msgsnd.c (__msgsnd): Rename to __libc_msgsnd
	and make old name an alias.
	* sysvipc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_msgrcv and
	__libc_msgsnd.

	* include/sys/uio.h: Declare __libc_readv and __libc_writev.
	* misc/Versions (libc) [GLIBC_PRIVATE]: Add __libc_readv and
	__libc_writev.
	* sysdeps/generic/readv.c (__readv): Rename to __libc_readv and make
	old name an alias.
	* sysdeps/posix/readv.c: Likewise
	* sysdeps/unix/sysv/aix/readv.c: Likewise.
	* sysdeps/unix/sysv/linux/readv.c: Likewise.
	* sysdeps/generic/writev.c (__writev): Rename to __libc_writev and make
	old name an alias.
	* sysdeps/posix/writev.c: Likewise
	* sysdeps/unix/sysv/aix/writev.c: Likewise.
	* sysdeps/unix/sysv/linux/writev.c: Likewise.

	* include/sys/wait.h: Declare __waitid.
	* posix/Versions (libc) [GLIBC_PRIVATE]: Add __waitid.
	* sysdeps/generic/waitid.c (waitid): Rename to __waitid and make old
	name an alias.
	* sysdeps/posix/waitid.c: Likewise.
	* sysdeps/unix/sysv/aix/waitid.c: Likewise.

	* sysdeps/unix/sysv/linux/syscalls.list: Add creat syscall.

2002-10-07  Jakub Jelinek  <jakub@redhat.com>

	* include/alloca.h (__libc_use_alloca, __libc_alloca_cutoff): New
	prototypes.
	(__MAX_ALLOCA_CUTOFF): Define.
	Include allocalim.h.
	* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r,
	_nss_dns_gethostbyaddr_r): Use alloca or malloc to allocate
	host_buffer depending on __libc_use_alloca.
	* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r,
	_nss_dns_getnetbyaddr_r): Use alloca or malloc to allocate
	net_buffer depending on __libc_use_alloca.
	* resolv/res_query.c (res_nquery): Use alloca or malloc to allocate
	buf depending on __libc_use_alloca.
	* resolv/gethnamaddr.c (gethostbyname2, gethostbyaddr): Likewise.
	* stdio-common/vfprintf.c (vfprintf): Use __libc_use_alloca
	instead of hardcoded constants.
	Pass proper size argument to alloca and compute end for wide char
	version.
	* stdio-common/printf_fp.c (__printf_fp): Use __libc_use_alloca
	instead of hardcoded constants.
	* string/strcoll.c (strcoll): Likewise.
	* string/strxfrm.c (strxfrm): Likewise.
	* sysdeps/posix/readv.c (__readv): Likewise.
	* sysdeps/posix/writev.c (__writev): Likewise.
	* sysdeps/generic/allocalim.h: New file.
Diffstat (limited to 'linuxthreads/manager.c')
-rw-r--r--linuxthreads/manager.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 08bf467815..cb9c33ecfb 100644
--- a/linuxthreads/manager.c
+++ b/linuxthreads/manager.c
@@ -334,7 +334,8 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
                                   char ** out_new_thread,
                                   char ** out_new_thread_bottom,
                                   char ** out_guardaddr,
-                                  size_t * out_guardsize)
+                                  size_t * out_guardsize,
+                                  size_t * out_stacksize)
 {
   pthread_descr new_thread;
   char * new_thread_bottom;
@@ -388,6 +389,7 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
       /* Clear the thread data structure.  */
       memset (new_thread, '\0', sizeof (*new_thread));
 #endif
+      stacksize = attr->__stacksize;
     }
   else
     {
@@ -559,6 +561,11 @@ static int pthread_allocate_stack(const pthread_attr_t *attr,
   *out_new_thread_bottom = new_thread_bottom;
   *out_guardaddr = guardaddr;
   *out_guardsize = guardsize;
+#ifdef NEED_SEPARATE_REGISTER_STACK
+  *out_stacksize = stacksize / 2;
+#else
+  *out_stacksize = stacksize;
+#endif
   return 0;
 }
 
@@ -575,7 +582,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
   char * new_thread_bottom;
   pthread_t new_thread_id;
   char *guardaddr = NULL;
-  size_t guardsize = 0;
+  size_t guardsize = 0, stksize = 0;
   int pagesize = __getpagesize();
   int saved_errno = 0;
 
@@ -608,7 +615,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
 	continue;
       if (pthread_allocate_stack(attr, thread_segment(sseg),
 				 pagesize, &stack_addr, &new_thread_bottom,
-                                 &guardaddr, &guardsize) == 0)
+                                 &guardaddr, &guardsize, &stksize) == 0)
 	{
 #ifdef USE_TLS
 	  new_thread->p_stackaddr = stack_addr;
@@ -639,6 +646,8 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr,
   new_thread->p_guardsize = guardsize;
   new_thread->p_nr = sseg;
   new_thread->p_inheritsched = attr ? attr->__inheritsched : 0;
+  new_thread->p_alloca_cutoff = stksize / 4 > __MAX_ALLOCA_CUTOFF
+				 ? __MAX_ALLOCA_CUTOFF : stksize / 4;
   /* Initialize the thread handle */
   __pthread_init_lock(&__pthread_handles[sseg].h_lock);
   __pthread_handles[sseg].h_descr = new_thread;