diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-02 11:40:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-02 11:40:40 +0100 |
commit | f2ce76a8c0290af35e434e38cfe889ed0fec4c6a (patch) | |
tree | 5f8578842b58e81a7ced9adbf27259d344adbd88 /src/configure.ac | |
parent | 95afae6d1760b2efcc4968dbd3784799d24e9fdf (diff) |
patch 9.0.0023: on Solaris timer_create() exists but does not workv9.0.0023
Problem: On Solaris timer_create() exists but does not work.
Solution: Adjust the configure check to run the test program.
(closes #10647)
Diffstat (limited to 'src/configure.ac')
-rw-r--r-- | src/configure.ac | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/configure.ac b/src/configure.ac index 98e1e2ed04..58d5d8e185 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -3805,10 +3805,12 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM( AC_MSG_RESULT(no)) dnl Check for timer_create. It probably requires the 'rt' library. +dnl Run the program to find out if timer_create(CLOCK_MONOTONIC) actually +dnl works, on Solaris timer_create() exists but fails at runtime. AC_MSG_CHECKING([for timer_create]) save_LIBS="$LIBS" LIBS="$LIBS -lrt" -AC_LINK_IFELSE([AC_LANG_PROGRAM([ +AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include<signal.h> #include<time.h> static void set_flag(union sigval sv) {} @@ -3819,11 +3821,12 @@ static void set_flag(union sigval sv) {} action.sigev_notify = SIGEV_THREAD; action.sigev_notify_function = set_flag; - timer_create(CLOCK_REALTIME, &action, &timer_id); + if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0) + exit(1); // cannot create a monotonic timer ])], AC_MSG_RESULT(yes; with -lrt); AC_DEFINE(HAVE_TIMER_CREATE), LIBS="$save_LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([ + AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include<signal.h> #include<time.h> static void set_flag(union sigval sv) {} @@ -3834,7 +3837,8 @@ static void set_flag(union sigval sv) {} action.sigev_notify = SIGEV_THREAD; action.sigev_notify_function = set_flag; - timer_create(CLOCK_REALTIME, &action, &timer_id); + if (timer_create(CLOCK_MONOTONIC, &action, &timer_id) < 0) + exit(1); // cannot create a monotonic timer ])], AC_MSG_RESULT(yes); AC_DEFINE(HAVE_TIMER_CREATE), AC_MSG_RESULT(no))) |