Musl libc does not define the glibc specific macro __GLIBC_PREREQ(), but it has the clock_adjtime() function. Assume that a libc implementation which does not define __GLIBC_PREREQ at all still implements clock_adjtime().
This fixes a build problem with musl libc because the __GLIBC_PREREQ() macro is missing.
Fixes: 42e1358e103d ("ptp: In the testptp utility, use clock_adjtime from glibc when available") Signed-off-by: Hauke Mehrtens hauke@hauke-m.de --- 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 f7911aaeb007..ecffe2c78543 100644 --- a/tools/testing/selftests/ptp/testptp.c +++ b/tools/testing/selftests/ptp/testptp.c @@ -38,6 +38,7 @@ #define NSEC_PER_SEC 1000000000LL
/* 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) @@ -45,6 +46,7 @@ static int clock_adjtime(clockid_t id, struct timex *tx) return syscall(__NR_clock_adjtime, id, tx); } #endif +#endif /* __GLIBC_PREREQ */
static void show_flag_test(int rq_index, unsigned int flags, int err) {