]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix(install): improve gettid definition
authorShreenidhi Shedi <sshedi@vmware.com>
Mon, 9 Aug 2021 04:55:35 +0000 (10:25 +0530)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 9 Aug 2021 17:11:22 +0000 (17:11 +0000)
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
src/install/util.c

index bd17fe7f5de27561feb6f41e027640ae6bfc5ce4..5721de89ea68444f4e48b69443e0dcd7519cc055 100644 (file)
 #include <errno.h>
 #include <fcntl.h>
 #include <sys/types.h>
-#include <sys/syscall.h>
 
 #include "util.h"
 
-static inline pid_t gettid(void)
-{
-        return (pid_t) syscall(SYS_gettid);
-}
+#if __GLIBC_PREREQ(2, 30) == 0
+#include <sys/syscall.h>
+#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)
 {