aboutsummaryrefslogtreecommitdiffhomepage
path: root/cbits/ghcrts.c
diff options
context:
space:
mode:
authorGravatar Herbert Valerio Riedel <hvr@gnu.org>2014-12-06 15:39:12 +0100
committerGravatar Herbert Valerio Riedel <hvr@gnu.org>2014-12-06 15:47:36 +0100
commitf24ba78f68b2cbc4f4afadc8dd60fc2935357255 (patch)
treef0f82b0a48222905cf12da233c5b5b3eb2392cac /cbits/ghcrts.c
parent123fcba7125c3b94ad35c3d7dfe31c715a79a470 (diff)
Refactor local `execvpe(3)` implementation
The previous code was prone to conflicts with when the platform happens to expose a `execvpe(3)` implementation in its libc. This commit renames the internal implementation to `__hsunix_execvpe` as well as adding an autoconf-detection for the presence of `execvpe(3)`, in which case `__hsunix_execvpe()` forwards the call to `execvpe(3)`. Moreover, the code has been cleaned up to remove likely bitrotted CPP conditionals. This should fix #22 (This also partially addresses #11 on platforms which have a libc-provided `execvpe(3)`)
Diffstat (limited to 'cbits/ghcrts.c')
-rw-r--r--cbits/ghcrts.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/cbits/ghcrts.c b/cbits/ghcrts.c
new file mode 100644
index 0000000..1e0dc1c
--- /dev/null
+++ b/cbits/ghcrts.c
@@ -0,0 +1,14 @@
+#include "execvpe.h"
+
+#ifdef __GLASGOW_HASKELL__
+// for 'void StopTimer(void)' prototype
+# include "Rts.h"
+#endif
+
+/* Copied verbatim from ghc/lib/std/cbits/system.c. */
+void pPrPr_disableITimers (void)
+{
+#ifdef __GLASGOW_HASKELL__
+ stopTimer();
+#endif
+}