diff --git a/libraries/ghc-internal/src/GHC/Internal/Conc/Bound.hs b/libraries/ghc-internal/src/GHC/Internal/Conc/Bound.hs index 8bde7c574527827870f2a65038663e65c7a58abe..c4acb7d3429f31bf3c01df0b88d30c45a7b1bf4a 100644 --- a/libraries/ghc-internal/src/GHC/Internal/Conc/Bound.hs +++ b/libraries/ghc-internal/src/GHC/Internal/Conc/Bound.hs @@ -112,13 +112,21 @@ forkOS_entry stableAction = do action <- deRefStablePtr stableAction action -foreign import ccall forkOS_createThread - :: StablePtr (IO ()) -> IO CInt + failNonThreaded :: IO a failNonThreaded = fail $ "RTS doesn't support multiple OS threads " ++"(use ghc -threaded when linking)" +#if defined(wasm32_HOST_ARCH) + +forkOS _ = failNonThreaded + +#else + +foreign import ccall forkOS_createThread + :: StablePtr (IO ()) -> IO CInt + forkOS action0 | rtsSupportsBoundThreads = do mv <- newEmptyMVar @@ -141,6 +149,7 @@ forkOS action0 freeStablePtr entry return tid | otherwise = failNonThreaded +#endif -- | Like 'forkIOWithUnmask', but the child thread is a bound thread, -- as with 'forkOS'. diff --git a/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs b/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs index 5d9f3fa518aa8b912dfdf294df640fb69b7730c5..e83e39a470b4f8e0899f25311b2b17e1fea4c97f 100644 --- a/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs +++ b/libraries/ghc-internal/src/GHC/Internal/System/Posix/Internals.hs @@ -732,8 +732,13 @@ foreign import capi unsafe "HsBase.h read" foreign import capi safe "HsBase.h read" c_safe_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize +#if !defined(HAVE_UMASK) +c_umask :: CMode -> IO CMode +c_umask _ = ioError (ioeSetLocation unsupportedOperation "umask") +#else foreign import ccall unsafe "HsBase.h umask" c_umask :: CMode -> IO CMode +#endif -- See Note [Windows types] foreign import capi unsafe "HsBase.h write"