summaryrefslogtreecommitdiff
path: root/src/thread/__unmapself.c
AgeCommit message (Collapse)AuthorLines
2015-06-10implement arch-generic version of __unmapselfRich Felker-0/+29
this can be used to put off writing an asm version of __unmapself for new archs, or as a permanent solution on archs where it's not practical or even possible to run momentarily with no stack. the concept here is simple: the caller takes a lock on a global shared stack and uses it to make the munmap and exit syscalls. the only trick is unlocking, which must be done after the thread exits, and this is achieved by using the set_tid_address syscall to have the kernel zero and futex-wake the lock word as part of the exit syscall.
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+0