diff --git a/src/unix/darwin-proctitle.c b/src/unix/darwin-proctitle.c index dabde223..97eaa053 100644 --- a/src/unix/darwin-proctitle.c +++ b/src/unix/darwin-proctitle.c @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -35,21 +36,13 @@ static int uv__pthread_setname_np(const char* name) { - int (*dynamic_pthread_setname_np)(const char* name); char namebuf[64]; /* MAXTHREADNAMESIZE */ int err; - /* pthread_setname_np() first appeared in OS X 10.6 and iOS 3.2. */ - *(void **)(&dynamic_pthread_setname_np) = - dlsym(RTLD_DEFAULT, "pthread_setname_np"); - - if (dynamic_pthread_setname_np == NULL) - return UV_ENOSYS; - strncpy(namebuf, name, sizeof(namebuf) - 1); namebuf[sizeof(namebuf) - 1] = '\0'; - err = dynamic_pthread_setname_np(namebuf); + err = pthread_setname_np(namebuf); if (err) return UV__ERR(err);