summaryrefslogtreecommitdiff
path: root/rts/posix/Itimer.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2013-01-23 10:22:47 +0000
committerSimon Marlow <marlowsd@gmail.com>2013-01-23 10:22:47 +0000
commitbb39e04d1ce6157268adfd9a3a8ec17d557deca8 (patch)
treeabca6db096a09d157cadf2f8283ff048613589b7 /rts/posix/Itimer.c
parent48b958948cc36b3cad95e8661a642b21f120b468 (diff)
downloadhaskell-bb39e04d1ce6157268adfd9a3a8ec17d557deca8.tar.gz
Solaris: do not use timer_create
Submitted by: Karel Gardas <karel.gardas@centrum.cz>
Diffstat (limited to 'rts/posix/Itimer.c')
-rw-r--r--rts/posix/Itimer.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/rts/posix/Itimer.c b/rts/posix/Itimer.c
index 80b3b56945..b99ff8970b 100644
--- a/rts/posix/Itimer.c
+++ b/rts/posix/Itimer.c
@@ -73,6 +73,24 @@
* etc.).
*/
+#if defined(solaris2_HOST_OS)
+/* USE_TIMER_CREATE is usually disabled for Solaris. In fact it is
+ supported well on this OS, but requires additional privilege. When
+ user does not have it, then the testing configure program fails
+ which results in USE_TIMER_CREATE not defined.
+ On the other hand when we cross-compile, then we optimistically
+ assume usage of timer_create function. The problem is that if we
+ cross compile for example from i386-solaris2 to x86_64-solaris2,
+ then the build fails with error like this:
+
+ghc-stage2: timer_create: Not owner
+
+ which happens on first ghc-stage2 invocation. So to support
+ cross-compilation to Solaris we manually undefine USE_TIMER_CREATE
+ here */
+#undef USE_TIMER_CREATE
+#endif /* solaris2_HOST_OS */
+
#if defined(USE_TIMER_CREATE)
# define ITIMER_SIGNAL SIGVTALRM
#elif defined(HAVE_SETITIMER)