History log of /seL4-camkes-master/projects/musllibc/src/thread/__unmapself.c
Revision Date Author Comments
# c30cbcb0 09-Jun-2015 Rich Felker <dalias@aerifal.cx>

implement arch-generic version of __unmapself

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.


# 0b44a031 11-Feb-2011 Rich Felker <dalias@aerifal.cx>

initial check-in, version 0.5.0