[PATCH] Return EAGAIN if allocate stack error when creating thread

Mike Frysinger vapier at gentoo.org
Wed Dec 21 04:57:41 UTC 2005


On Wed, Dec 21, 2005 at 11:00:06AM +0800, Jie Zhang wrote:
> This is a patch for libpthread/linuxthreads.old. When used for uClinux
> on nommu processor, allocating a large stack for thread is likely to
> fail. However, pthread_handle_create () does not check the return
> value of pthread_allocate_stack () to see if stack is successfully
> allocated. This patch makes pthread_handle_create () return EAGAIN
> immediately if the stack cannot be allocated.

why does it need to be immediately ?  the code is executed in a loop
and if a the allocate stack continues to fail, it will return EAGIN
-mike



More information about the uClibc mailing list