From 72774b031084e5260cf0c0df5239ed63d136ba6c Mon Sep 17 00:00:00 2001 From: Herbert Valerio Riedel <hvr@gnu.org> Date: Sun, 31 Jan 2016 10:51:58 +0100 Subject: [PATCH] Use more direct CApiFFI for pPrPr_disableITimers --- System/Posix/Process/Internals.hs | 3 +-- cbits/ghcrts.c | 15 --------------- include/execvpe.h | 3 --- unix.cabal | 1 - 4 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 cbits/ghcrts.c diff --git a/System/Posix/Process/Internals.hs b/System/Posix/Process/Internals.hs index fd0e68d..0bd99ae 100644 --- a/System/Posix/Process/Internals.hs +++ b/System/Posix/Process/Internals.hs @@ -1,5 +1,4 @@ {-# LANGUAGE CApiFFI #-} -{-# LANGUAGE CPP #-} {-# LANGUAGE Trustworthy #-} module System.Posix.Process.Internals ( @@ -26,7 +25,7 @@ data ProcessStatus -- this function disables the itimer, which would otherwise cause confusing -- signals to be sent to the new process. -foreign import ccall unsafe "pPrPr_disableITimers" +foreign import capi unsafe "Rts.h stopTimer" pPrPr_disableITimers :: IO () foreign import ccall unsafe "__hsunix_execvpe" diff --git a/cbits/ghcrts.c b/cbits/ghcrts.c deleted file mode 100644 index 9003675..0000000 --- a/cbits/ghcrts.c +++ /dev/null @@ -1,15 +0,0 @@ -#ifdef __GLASGOW_HASKELL__ -// for 'void StopTimer(void)' prototype -# include "Rts.h" -#endif - -#define HSUNIX_EXECVPE_H_NO_COMPAT -#include "execvpe.h" - -/* Copied verbatim from ghc/lib/std/cbits/system.c. */ -void pPrPr_disableITimers (void) -{ -#ifdef __GLASGOW_HASKELL__ - stopTimer(); -#endif -} diff --git a/include/execvpe.h b/include/execvpe.h index 63cd042..8db9495 100644 --- a/include/execvpe.h +++ b/include/execvpe.h @@ -22,7 +22,4 @@ execvpe(const char *name, char *const argv[], char *const envp[]); #endif #endif -// implemented in cbits/ghcrts.c -extern void pPrPr_disableITimers (void); - #endif diff --git a/unix.cabal b/unix.cabal index 5f61736..2027559 100644 --- a/unix.cabal +++ b/unix.cabal @@ -133,4 +133,3 @@ library cbits/HsUnix.c cbits/dirUtils.c cbits/execvpe.c - cbits/ghcrts.c -- GitLab