[PATCH] selftests: ptp: fix build with musl libc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Hauke Mehrtens <hauke.mehrtens@xxxxxxxxx>

musl libc does not define __GLIBC_PREREQ, but it supports clock_adjtime().
Add it only if __GLIBC_PREREQ is supported.

Signed-off-by: Hauke Mehrtens <hauke.mehrtens@xxxxxxxxx>
---
 tools/testing/selftests/ptp/testptp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/ptp/testptp.c b/tools/testing/selftests/ptp/testptp.c
index 5d2eae1..7f23a7e 100644
--- a/tools/testing/selftests/ptp/testptp.c
+++ b/tools/testing/selftests/ptp/testptp.c
@@ -49,6 +49,7 @@
 #endif
 
 /* clock_adjtime is not available in GLIBC < 2.14 */
+#ifdef __GLIBC_PREREQ
 #if !__GLIBC_PREREQ(2, 14)
 #include <sys/syscall.h>
 static int clock_adjtime(clockid_t id, struct timex *tx)
@@ -56,6 +57,7 @@ static int clock_adjtime(clockid_t id, struct timex *tx)
 	return syscall(__NR_clock_adjtime, id, tx);
 }
 #endif
+#endif
 
 static clockid_t get_clockid(int fd)
 {
-- 
2.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kselftest" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux