blob: dd29797a66731f4ff488e4aa9e41965d57731ac6 [file] [log] [blame]
Andrew Geissler7e0e3c02022-02-25 20:34:39 +00001From 93e7e25a10c890b8c8cd06cbfd78175c30999d31 Mon Sep 17 00:00:00 2001
Andrew Geissler82c905d2020-04-13 13:39:40 -05002From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 9 Mar 2020 09:44:33 -0700
4Subject: [PATCH] configure: Check for clock_gettime seprately from
5 __NR_clock_gettime
6
7This helps prioritize using clock_gettime API from libc over syscall
8since direct use of __NR_clock_gettime is not time64-safe
9
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
Andrew Geissler82c905d2020-04-13 13:39:40 -050012
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000013---
14 configure.ac | 4 ++++
15 1 file changed, 4 insertions(+)
16
17diff --git a/configure.ac b/configure.ac
18index 3d218ea..aa7dd1c 100644
Andrew Geissler82c905d2020-04-13 13:39:40 -050019--- a/configure.ac
20+++ b/configure.ac
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000021@@ -127,6 +127,10 @@ case $host in
Andrew Geissler82c905d2020-04-13 13:39:40 -050022 esac
23
24 AC_CHECK_HEADERS(syscall.h sys/syscall.h mach/mach_time.h)
25+
26+AC_MSG_CHECKING([for clock_gettime])
27+AC_SEARCH_LIBS([clock_gettime], [rt], [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [use clock_gettime])],)
28+
29 AC_MSG_CHECKING([for __NR_clock_gettime syscall])
30 AC_COMPILE_IFELSE(
31 [AC_LANG_PROGRAM(