summaryrefslogtreecommitdiff
path: root/libraries/base/GHC/Event/Control.hs
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/base/GHC/Event/Control.hs')
-rw-r--r--libraries/base/GHC/Event/Control.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/libraries/base/GHC/Event/Control.hs b/libraries/base/GHC/Event/Control.hs
index 9054da4f22..d80e054182 100644
--- a/libraries/base/GHC/Event/Control.hs
+++ b/libraries/base/GHC/Event/Control.hs
@@ -26,6 +26,7 @@ module GHC.Event.Control
, setNonBlockingFD
) where
+#include <ghcplatform.h>
#include "EventConfig.h"
import GHC.Base
@@ -145,6 +146,10 @@ io_MANAGER_WAKEUP, io_MANAGER_DIE :: Word8
io_MANAGER_WAKEUP = 0xff
io_MANAGER_DIE = 0xfe
+#if !defined(HAVE_SIGNAL_H)
+readControlMessage :: Control -> Fd -> IO ControlMessage
+readControlMessage _ _ = errorWithoutStackTrace "readControlMessage"
+#else
foreign import ccall "__hscore_sizeof_siginfo_t"
sizeof_siginfo_t :: CSize
@@ -180,6 +185,7 @@ readControlMessage ctrl fd
#else
4096
#endif
+#endif
sendWakeup :: Control -> IO ()
#if defined(HAVE_EVENTFD)
@@ -229,5 +235,10 @@ foreign import ccall unsafe "sys/eventfd.h eventfd_write"
c_eventfd_write :: CInt -> CULLong -> IO CInt
#endif
+#if defined(wasm32_HOST_ARCH)
+c_setIOManagerWakeupFd :: CInt -> IO ()
+c_setIOManagerWakeupFd _ = pure ()
+#else
foreign import ccall unsafe "setIOManagerWakeupFd"
c_setIOManagerWakeupFd :: CInt -> IO ()
+#endif