From b2e028fe24259a3c87c3a8361edd3bc4cd87a42a Mon Sep 17 00:00:00 2001
From: Ismael Luceno <ismael@iodev.co.uk>
Date: Tue, 29 Mar 2022 18:26:14 +0200
Subject: [PATCH] Wrap __GLIBC_PREREQ usage with __GLIBC__

Fixes build against musl 1.2.2+; earlier versions don't implement it but
there's no way to know it's presence other than an autoconf-style test.

Signed-off-by: Ismael Luceno <ismael@iodev.co.uk>
---
 src/install/util.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/install/util.c b/src/install/util.c
index 5721de89ea68..57d0624f129d 100644
--- a/src/install/util.c
+++ b/src/install/util.c
@@ -27,6 +27,7 @@
 
 #include "util.h"
 
+#ifdef __GLIBC__
 #if __GLIBC_PREREQ(2, 30) == 0
 #include <sys/syscall.h>
 #ifndef SYS_gettid
@@ -35,6 +36,7 @@
 
 #define gettid()    ((pid_t) syscall(SYS_gettid))
 #endif /*__GLIBC_PREREQ */
+#endif /* __GLIBC__ */
 
 size_t page_size(void)
 {
-- 
2.35.1

