[PATCH] attr.c in _STACK_GROWS_UP case.
Carlos O'Donell
carlos@baldric.uwo.ca
Mon Dec 29 00:56:00 GMT 2003
> No, because the VMA is growing.
Okay.
> But IMHO it makes sense to cap it by the end of the previous vma
> (resp. for S_G_U beginning of next vma).
Not possible, the stack is the last vma. It grows until all of memory is
exhausted. Your previous recommendation was the best solution for S_G_D.
> For S_G_D this means remembering to from previous VMA in last_to
> (initialized to 0 at the beginning) and:
> attr->__stacksize = rl.rlim_cur;
> attr->__stackaddr = (void *) to;
> if ((size_t) attr->__stacksize > (size_t) attr->__stackaddr - last_to)
> attr->__stacksize = (size_t) attr->__stackaddr - last_to;
That looks good for the S_G_D case.
c.
More information about the Libc-alpha
mailing list