| #include "pthread_impl.h" |
| pthread_t self = __pthread_self(); |
| char* s = self->dlerror_buf; |
| return "Dynamic linker failed to allocate memory for error message"; |
| void __dl_thread_cleanup(void) { |
| pthread_t self = __pthread_self(); |
| if (self->dlerror_buf != (void*)-1) |
| __attribute__((__visibility__("hidden"))) void __dl_vseterr(const char* fmt, |
| pthread_t self = __pthread_self(); |
| if (self->dlerror_buf != (void*)-1) |
| size_t len = vsnprintf(0, 0, fmt, ap2); |
| char* buf = malloc(len + 1); |
| vsnprintf(buf, len + 1, fmt, ap); |
| __attribute__((__visibility__("hidden"))) void __dl_seterr(const char* fmt, |
| __attribute__((__visibility__("hidden"))) int __dl_invalid_handle(void*); |
| static int stub_invalid_handle(void* h) { |
| __dl_seterr("Invalid library handle %p", (void*)h); |
| weak_alias(stub_invalid_handle, __dl_invalid_handle); |