aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-23 09:12:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-23 09:12:54 +0000
commita6b66b73b10d5bbac68bdbdcc230653132e67b17 (patch)
treed09cb9fd5ac02ed02965c41e87296bc152f4da29 /render.c
parentthemes: fix typos in themes/selenized-black (diff)
parentchangelog: freebsd support (diff)
Merge branch 'freebsd'
Closes #238
Diffstat (limited to 'render.c')
-rw-r--r--render.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/render.c b/render.c
index f8bb4968..2dccd6a8 100644
--- a/render.c
+++ b/render.c
@@ -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;