{-# LANGUAGE CPP #-}#ifdef __GLASGOW_HASKELL__{-# LANGUAGE Trustworthy #-}#endifmoduleSystem.Posix.Process.Internals(pPrPr_disableITimers,c_execvpe,decipherWaitStatus,ProcessStatus(..))whereimportForeignimportForeign.CimportSystem.ExitimportSystem.IO.ErrorimportGHC.Conc(Signal)-- | The exit status of a processdataProcessStatus=ExitedExitCode-- ^ the process exited by calling-- @exit()@ or returning from @main@|TerminatedSignalBool-- ^ the process was terminated by a-- signal, the @Bool@ is @True@ if a core-- dump was produced---- /Since: 2.7.0.0/|StoppedSignal-- ^ the process was stopped by a signalderiving(Eq,Ord,Show)-- this function disables the itimer, which would otherwise cause confusing-- signals to be sent to the new process.foreignimportccallunsafe"pPrPr_disableITimers"pPrPr_disableITimers::IO()foreignimportccallunsafe"__hsunix_execvpe"c_execvpe::CString->PtrCString->PtrCString->IOCIntdecipherWaitStatus::CInt->IOProcessStatusdecipherWaitStatuswstat=ifc_WIFEXITEDwstat/=0thendoletexitstatus=c_WEXITSTATUSwstatifexitstatus==0thenreturn(ExitedExitSuccess)elsereturn(Exited(ExitFailure(fromIntegralexitstatus)))elsedoifc_WIFSIGNALEDwstat/=0thendolettermsig=c_WTERMSIGwstatletcoredumped=c_WCOREDUMPwstat/=0return(Terminatedtermsigcoredumped)elsedoifc_WIFSTOPPEDwstat/=0thendoletstopsig=c_WSTOPSIGwstatreturn(Stoppedstopsig)elsedoioError(mkIOErrorillegalOperationErrorType"waitStatus"NothingNothing)foreignimportccallunsafe"__hsunix_wifexited"c_WIFEXITED::CInt->CIntforeignimportccallunsafe"__hsunix_wexitstatus"c_WEXITSTATUS::CInt->CIntforeignimportccallunsafe"__hsunix_wifsignaled"c_WIFSIGNALED::CInt->CIntforeignimportccallunsafe"__hsunix_wtermsig"c_WTERMSIG::CInt->CIntforeignimportccallunsafe"__hsunix_wifstopped"c_WIFSTOPPED::CInt->CIntforeignimportccallunsafe"__hsunix_wstopsig"c_WSTOPSIG::CInt->CIntforeignimportccallunsafe"__hsunix_wcoredump"c_WCOREDUMP::CInt->CInt