diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-23 09:12:54 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-01-23 09:12:54 +0000 |
| commit | a6b66b73b10d5bbac68bdbdcc230653132e67b17 (patch) | |
| tree | d09cb9fd5ac02ed02965c41e87296bc152f4da29 /render.c | |
| parent | themes: fix typos in themes/selenized-black (diff) | |
| parent | changelog: freebsd support (diff) | |
Merge branch 'freebsd'
Closes #238
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -5,7 +5,13 @@ #include <sys/ioctl.h> #include <sys/time.h> #include <sys/timerfd.h> -#include <sys/prctl.h> +#include <pthread.h> +#if __has_include(<pthread_np.h>) +#include <pthread_np.h> +#define pthread_setname_np(thread, name) (pthread_set_name_np(thread, name), 0) +#elif defined(__NetBSD__) +#define pthread_setname_np(thread, name) pthread_setname_np(thread, "%s", (void *)name) +#endif #include <wayland-cursor.h> #include <xdg-shell.h> @@ -1231,7 +1237,7 @@ render_worker_thread(void *_ctx) char proc_title[16]; snprintf(proc_title, sizeof(proc_title), "foot:render:%d", my_id); - if (prctl(PR_SET_NAME, proc_title, 0, 0, 0) < 0) + if (pthread_setname_np(pthread_self(), proc_title) < 0) LOG_ERRNO("render worker %d: failed to set process title", my_id); sem_t *start = &term->render.workers.start; |
