From 2d5a4c1c2f160534cd59ec9bd0504219263116e3 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 14 Jun 2017 19:57:04 +0000 Subject: recent musl has pthread_setname_np(). --- libgcompat/pthread.c | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 libgcompat/pthread.c (limited to 'libgcompat') diff --git a/libgcompat/pthread.c b/libgcompat/pthread.c deleted file mode 100644 index b4ea054..0000000 --- a/libgcompat/pthread.c +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* "Now we are all sons of bitches." */ -int pthread_setname_np(pthread_t thread, const char *name) -{ - char path[PATH_MAX]; - int fd; - /* Cthulhu have mercy */ - pid_t *my_pid = (pid_t *)((void *)thread + (sizeof(uintptr_t) * 7)); - size_t len = strlen(name); - - if(len > 15) - { - return -ERANGE; - } - - snprintf(path, PATH_MAX, "/proc/self/tid/%u/name", *my_pid); - fd = open(path, O_RDWR); - write(fd, name, len + 1); - close(fd); - - return 0; -} -- cgit v1.2.3-70-g09d2