ProcessStatus(..),
addSignal,
+#ifndef cygwin32_TARGET_OS
awaitSignal,
+#endif
backgroundRead,
backgroundWrite,
blockSignals,
getEnvironment :: IO [(String, String)]
getEnvironment = do
- env <- unvectorize ``environ'' 0
+ --WAS: env <- unvectorize ``environ'' 0
+ -- does not work too well, since the lit-lit
+ -- is turned into an Addr that is only evaluated
+ -- once (environ is changed to point the most
+ -- current env. block after the addition of new entries).
+ envp <- _casm_ `` %r=environ; ''
+ env <- unvectorize (envp::Addr) 0
return (map (split "") env)
where
split :: String -> String -> (String, String)
then freeze bytes
else syserr "getPendingSignals"
+#ifndef cygwin32_TARGET_OS
awaitSignal :: Maybe SignalSet -> IO ()
awaitSignal maybe_sigset = do
pause maybe_sigset
if err == interruptedOperation
then return ()
else syserr "awaitSignal"
--- where
pause :: Maybe SignalSet -> IO ()
pause maybe_sigset =
case maybe_sigset of
Nothing -> _casm_ ``(void) pause();''
Just sigset -> _casm_ ``(void) sigsuspend((sigset_t *)%0);'' sigset
+#endif
scheduleAlarm :: Int -> IO Int
scheduleAlarm (I# secs#) =