Add GNU/Hurd support

This commit is contained in:
Samuel Thibault 2023-09-24 16:17:12 +02:00 committed by Wim Taymans
parent f9559d2e83
commit 8b807ded35
8 changed files with 21 additions and 10 deletions

View file

@ -35,6 +35,9 @@
#if defined(__FreeBSD__) || defined(__MidnightBSD__)
#include <sys/thr.h>
#endif
#if defined(__GNU__)
#include <mach.h>
#endif
#include <fcntl.h>
#include <unistd.h>
#include <pthread.h>
@ -221,6 +224,9 @@ static pid_t _gettid(void)
long pid;
thr_self(&pid);
return (pid_t)pid;
#elif defined(__GNU__)
mach_port_t thread = mach_thread_self();
return (pid_t)thread;
#else
#error "No gettid impl"
#endif