--- src/debug.c 2024-11-08 13:08:06.174085089 +0100 +++ src/debug.c 2024-11-08 13:11:43.133601548 +0100 @@ -152,8 +152,10 @@ #ifdef HAVE_W32_SYSTEM thread = (uintptr_t)GetCurrentThreadId (); #elif defined(__linux) +#ifdef SYS_gettid thread = (uintptr_t)gettid (); #endif +#endif if (sizeof (thread) < len) { int zerolen = len;