diff options
author | Ian Lynagh <igloo@earth.li> | 2009-02-08 19:14:31 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2009-02-08 19:14:31 +0000 |
commit | 4fc80ef6710401b4b249c2bf298986623bdbd503 (patch) | |
tree | f422124a2291215b261da346f8acfcde9bd53565 /configure.ac | |
parent | a7d8074da3f326da718d1057d1b3337210ba34a8 (diff) | |
download | haskell-4fc80ef6710401b4b249c2bf298986623bdbd503.tar.gz |
Handle the case where setitimer(ITIMER_VIRTUAL) is not always available
Patch from sthibaul. Fixes trac #2883.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 8c984def52..d298af87a4 100644 --- a/configure.ac +++ b/configure.ac @@ -1108,6 +1108,19 @@ fi dnl ** check for more functions dnl ** The following have been verified to be used in ghc/, but might be used somewhere else, too. AC_CHECK_FUNCS([getclock getrusage gettimeofday setitimer siginterrupt sysconf times ctime_r]) + +AC_TRY_RUN([ +#include <sys/types.h> +#include <sys/time.h> +int main(void) { + struct itimerval tval; + tval.it_value.tv_sec = 1; + tval.it_value.tv_usec = 0; + tval.it_interval = tval.it_value; + return setitimer(ITIMER_VIRTUAL, &tval, (void*)0) != 0; +} +],[AC_DEFINE([HAVE_SETITIMER_VIRTUAL], [1], [Define to 1 if setitimer accepts ITIMER_VIRTUAL, 0 else.])]) + dnl ** On OS X 10.4 (at least), time.h doesn't declare ctime_r if dnl ** _POSIX_C_SOURCE is defined AC_CHECK_DECLS([ctime_r], , , |