1 #include "pthread_impl.h" 2 #include <threads.h> 3 __pthread_self()4pthread_t __pthread_self() 5 { 6 uintptr_t p; 7 p = __syscall(SYS_get_thread_area); 8 return (void *)(p - sizeof(struct pthread)); 9 } 10 __pthread_self_internal()11static pthread_t __pthread_self_internal() 12 { 13 return __pthread_self(); 14 } 15 16 weak_alias(__pthread_self_internal, pthread_self); 17 weak_alias(__pthread_self_internal, thrd_current); 18