diff --git a/engine/platform/linux/sys_linux.c b/engine/platform/linux/sys_linux.c index 273d8297..39a92bd9 100644 --- a/engine/platform/linux/sys_linux.c +++ b/engine/platform/linux/sys_linux.c @@ -29,7 +29,8 @@ GNU General Public License for more details. #include "platform/platform.h" #include -#if defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 30) +#if defined( __GLIBC__ ) +#if ( __GLIBC__ <= 2 ) && ( __GLIBC_MINOR__ <= 30 ) // Library support was added in glibc 2.30. // Earlier glibc versions did not provide a wrapper for this system call, // necessitating the use of syscall(2). @@ -39,7 +40,14 @@ static pid_t gettid( void ) { return syscall( SYS_gettid ); } -#endif +#endif // ( __GLIBC__ <= 2 ) && ( __GLIBC_MINOR__ <= 30 ) + +// Glibc misses this macro in POSIX headers (bits/types/sigevent_t.h) +// but it does present in Linux headers (asm-generic/siginfo.h) and musl +#if !defined( sigev_notify_thread_id ) +#define sigev_notify_thread_id _sigev_un._tid +#endif // !defined( sigev_notify_thread_id ) +#endif // defined(__GLIBC__) static void *g_hsystemd; static int (*g_pfn_sd_notify)( int unset_environment, const char *state );