From ef0f848a67fdd0a0dab135acbd1cd7fa0179a95c Mon Sep 17 00:00:00 2001 From: Shreenidhi Shedi Date: Mon, 9 Aug 2021 10:25:35 +0530 Subject: [PATCH] fix(install): improve gettid definition Signed-off-by: Shreenidhi Shedi --- src/install/util.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/install/util.c b/src/install/util.c index bd17fe7f5..5721de89e 100644 --- a/src/install/util.c +++ b/src/install/util.c @@ -24,14 +24,17 @@ #include #include #include -#include #include "util.h" -static inline pid_t gettid(void) -{ - return (pid_t) syscall(SYS_gettid); -} +#if __GLIBC_PREREQ(2, 30) == 0 +#include +#ifndef SYS_gettid +#error "SYS_gettid unavailable on this system" +#endif + +#define gettid() ((pid_t) syscall(SYS_gettid)) +#endif /*__GLIBC_PREREQ */ size_t page_size(void) { -- 2.47.3