]>
git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/src/thread/__unmapself.c
1 #include "pthread_impl.h"
4 /* cheat and reuse CRTJMP macro from dynlink code */
7 static void *unmap_base
;
8 static size_t unmap_size
;
9 static char shared_stack
[256];
11 static void do_unmap()
13 __syscall(SYS_munmap
, unmap_base
, unmap_size
);
17 void __unmapself(void *base
, size_t size
)
19 char *stack
= shared_stack
+ sizeof shared_stack
;
20 stack
-= (uintptr_t)stack
% 16;
23 CRTJMP(do_unmap
, stack
);