Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
4fc80ef6
Commit
4fc80ef6
authored
Feb 08, 2009
by
Ian Lynagh
Browse files
Handle the case where setitimer(ITIMER_VIRTUAL) is not always available
Patch from sthibaul. Fixes trac #2883.
parent
a7d8074d
Changes
2
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
4fc80ef6
...
...
@@ -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], , ,
...
...
rts/posix/Itimer.c
View file @
4fc80ef6
...
...
@@ -80,9 +80,10 @@
#elif defined(HAVE_SETITIMER)
# ifdef
THREADED_RTS
# if
def
ined(
THREADED_RTS
) || !defined(HAVE_SETITIMER_VIRTUAL)
// Oh dear, we have to use SIGALRM if there's no timer_create and
// we're using the THREADED_RTS. This leads to problems, see bug #850.
// We also use it if we don't have a virtual timer (trac #2883).
# define ITIMER_SIGNAL SIGALRM
# define ITIMER_FLAVOUR ITIMER_REAL
# else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment