Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nasa#1429, adjust pthread stack to account for TCB+TLS
The glibc pthread implementation puts additional data structures at the base of the stack. The size of these is not known, but the only thing to go by is PTHREAD_MIN_STACK -- which should always be enough to hold the required objects. Instead of simply assuring that the stack is at least PTHREAD_MIN_STACK, add this to the requested stack instead. This in turn will ensure that the user always has at least their requested stack size available for actual use. If the pthread implementation does not advertise a PTHREAD_MIN_STACK value, then just reserve 1 extra page.
- Loading branch information