MAP_GROWSDOWN missing in linuxthreads/manager.c?

Ine Ya ineyaa at gmail.com
Thu Feb 18 21:06:57 UTC 2010


How is the stack expanded in this case?
I'm looking at kernel sources (for mips) do_page_fault(), and the code
is relying on VM_GROWDOWN.

On Thu, Feb 18, 2010 at 9:44 PM, Khem Raj <raj.khem at gmail.com> wrote:
> On Thu, Feb 18, 2010 at 12:05 PM, Ine Ya <ineyaa at gmail.com> wrote:
>> The code, which is creating stack (pthread_allocate_stack) in
>> linuxthreads.old/manager.c looks like:
>>
>>      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,
>>
>> however in linuxthreads/manager.c MAP_GROWSDOWN is missing in case of
>> _STACK_GROWS_DOWN
>>      map_addr = mmap(new_thread, stacksize + guardsize,
>>                      PROT_READ | PROT_WRITE | PROT_EXEC,
>>                      MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1
>>
>> Is this deliberate?
>
> yes. Also see calculation of new_thread_bottom is changed too.
>
>> _______________________________________________
>> uClibc mailing list
>> uClibc at uclibc.org
>> http://lists.busybox.net/mailman/listinfo/uclibc
>>
>


More information about the uClibc mailing list