… | |
… | |
9 | AC_CHECK_FUNC(clock_gettime, [], [ |
9 | AC_CHECK_FUNC(clock_gettime, [], [ |
10 | dnl on linux, try syscall wrapper first |
10 | dnl on linux, try syscall wrapper first |
11 | if test $(uname) = Linux; then |
11 | if test $(uname) = Linux; then |
12 | AC_MSG_CHECKING(for clock_gettime syscall) |
12 | AC_MSG_CHECKING(for clock_gettime syscall) |
13 | AC_LINK_IFELSE([AC_LANG_PROGRAM( |
13 | AC_LINK_IFELSE([AC_LANG_PROGRAM( |
|
|
14 | [#include <unistd.h> |
14 | [#include <syscall.h> |
15 | #include <sys/syscall.h> |
15 | #include <time.h>], |
16 | #include <time.h>], |
16 | [struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)])], |
17 | [struct timespec ts; int status = syscall (SYS_clock_gettime, CLOCK_REALTIME, &ts)])], |
17 | [ac_have_clock_syscall=1 |
18 | [ac_have_clock_syscall=1 |
18 | AC_DEFINE(HAVE_CLOCK_SYSCALL, 1, "use syscall interface for clock_gettime") |
19 | AC_DEFINE(HAVE_CLOCK_SYSCALL, 1, "use syscall interface for clock_gettime") |
19 | AC_MSG_RESULT(yes)], |
20 | AC_MSG_RESULT(yes)], |