{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE CPP, NoImplicitPrelude #-}
module Foreign.C.Error (
Errno(..),
eOK, e2BIG, eACCES, eADDRINUSE, eADDRNOTAVAIL, eADV, eAFNOSUPPORT, eAGAIN,
eALREADY, eBADF, eBADMSG, eBADRPC, eBUSY, eCHILD, eCOMM, eCONNABORTED,
eCONNREFUSED, eCONNRESET, eDEADLK, eDESTADDRREQ, eDIRTY, eDOM, eDQUOT,
eEXIST, eFAULT, eFBIG, eFTYPE, eHOSTDOWN, eHOSTUNREACH, eIDRM, eILSEQ,
eINPROGRESS, eINTR, eINVAL, eIO, eISCONN, eISDIR, eLOOP, eMFILE, eMLINK,
eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,
eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,
eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS,
eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,
eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,
ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,
eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN,
eSOCKTNOSUPPORT, eSPIPE, eSRCH, eSRMNT, eSTALE, eTIME, eTIMEDOUT,
eTOOMANYREFS, eTXTBSY, eUSERS, eWOULDBLOCK, eXDEV,
isValidErrno,
getErrno,
resetErrno,
errnoToIOError,
throwErrno,
throwErrnoIf,
throwErrnoIf_,
throwErrnoIfRetry,
throwErrnoIfRetry_,
throwErrnoIfMinus1,
throwErrnoIfMinus1_,
throwErrnoIfMinus1Retry,
throwErrnoIfMinus1Retry_,
throwErrnoIfNull,
throwErrnoIfNullRetry,
throwErrnoIfRetryMayBlock,
throwErrnoIfRetryMayBlock_,
throwErrnoIfMinus1RetryMayBlock,
throwErrnoIfMinus1RetryMayBlock_,
throwErrnoIfNullRetryMayBlock,
throwErrnoPath,
throwErrnoPathIf,
throwErrnoPathIf_,
throwErrnoPathIfNull,
throwErrnoPathIfMinus1,
throwErrnoPathIfMinus1_,
) where
#include "HsBaseConfig.h"
import Foreign.Ptr
import Foreign.C.Types
import Foreign.C.String
import Data.Functor ( void )
import Data.Maybe
import GHC.IO
import GHC.IO.Exception
import GHC.IO.Handle.Types
import GHC.Num
import GHC.Base
newtype Errno = Errno CInt
instance Eq Errno where
errno1 :: Errno
errno1@(Errno CInt
no1) == :: Errno -> Errno -> Bool
== errno2 :: Errno
errno2@(Errno CInt
no2)
| Errno -> Bool
isValidErrno Errno
errno1 Bool -> Bool -> Bool
&& Errno -> Bool
isValidErrno Errno
errno2 = CInt
no1 CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type Eq CInt
== CInt
no2
| Bool
otherwise = Bool
False
eOK, e2BIG, eACCES, eADDRINUSE, eADDRNOTAVAIL, eADV, eAFNOSUPPORT, eAGAIN,
eALREADY, eBADF, eBADMSG, eBADRPC, eBUSY, eCHILD, eCOMM, eCONNABORTED,
eCONNREFUSED, eCONNRESET, eDEADLK, eDESTADDRREQ, eDIRTY, eDOM, eDQUOT,
eEXIST, eFAULT, eFBIG, eFTYPE, eHOSTDOWN, eHOSTUNREACH, eIDRM, eILSEQ,
eINPROGRESS, eINTR, eINVAL, eIO, eISCONN, eISDIR, eLOOP, eMFILE, eMLINK,
eMSGSIZE, eMULTIHOP, eNAMETOOLONG, eNETDOWN, eNETRESET, eNETUNREACH,
eNFILE, eNOBUFS, eNODATA, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOLINK,
eNOMEM, eNOMSG, eNONET, eNOPROTOOPT, eNOSPC, eNOSR, eNOSTR, eNOSYS,
eNOTBLK, eNOTCONN, eNOTDIR, eNOTEMPTY, eNOTSOCK, eNOTSUP, eNOTTY, eNXIO,
eOPNOTSUPP, ePERM, ePFNOSUPPORT, ePIPE, ePROCLIM, ePROCUNAVAIL,
ePROGMISMATCH, ePROGUNAVAIL, ePROTO, ePROTONOSUPPORT, ePROTOTYPE,
eRANGE, eREMCHG, eREMOTE, eROFS, eRPCMISMATCH, eRREMOTE, eSHUTDOWN,
eSOCKTNOSUPPORT, eSPIPE, eSRCH, eSRMNT, eSTALE, eTIME, eTIMEDOUT,
eTOOMANYREFS, eTXTBSY, eUSERS, eWOULDBLOCK, eXDEV :: Errno
eOK :: Errno
eOK = CInt -> Errno
Errno CInt
0
e2BIG :: Errno
e2BIG = CInt -> Errno
Errno (CONST_E2BIG)
eACCES :: Errno
eACCES = CInt -> Errno
Errno (CONST_EACCES)
eADDRINUSE :: Errno
eADDRINUSE = CInt -> Errno
Errno (CONST_EADDRINUSE)
eADDRNOTAVAIL :: Errno
eADDRNOTAVAIL = CInt -> Errno
Errno (CONST_EADDRNOTAVAIL)
eADV :: Errno
eADV = CInt -> Errno
Errno (CONST_EADV)
eAFNOSUPPORT :: Errno
eAFNOSUPPORT = CInt -> Errno
Errno (CONST_EAFNOSUPPORT)
eAGAIN :: Errno
eAGAIN = CInt -> Errno
Errno (CONST_EAGAIN)
eALREADY :: Errno
eALREADY = CInt -> Errno
Errno (CONST_EALREADY)
eBADF :: Errno
eBADF = CInt -> Errno
Errno (CONST_EBADF)
eBADMSG :: Errno
eBADMSG = CInt -> Errno
Errno (CONST_EBADMSG)
eBADRPC :: Errno
eBADRPC = CInt -> Errno
Errno (CONST_EBADRPC)
eBUSY :: Errno
eBUSY = CInt -> Errno
Errno (CONST_EBUSY)
eCHILD :: Errno
eCHILD = CInt -> Errno
Errno (CONST_ECHILD)
eCOMM :: Errno
eCOMM = CInt -> Errno
Errno (CONST_ECOMM)
eCONNABORTED :: Errno
eCONNABORTED = CInt -> Errno
Errno (CONST_ECONNABORTED)
eCONNREFUSED :: Errno
eCONNREFUSED = CInt -> Errno
Errno (CONST_ECONNREFUSED)
eCONNRESET :: Errno
eCONNRESET = CInt -> Errno
Errno (CONST_ECONNRESET)
eDEADLK :: Errno
eDEADLK = CInt -> Errno
Errno (CONST_EDEADLK)
eDESTADDRREQ :: Errno
eDESTADDRREQ = CInt -> Errno
Errno (CONST_EDESTADDRREQ)
eDIRTY :: Errno
eDIRTY = CInt -> Errno
Errno (CONST_EDIRTY)
eDOM :: Errno
eDOM = CInt -> Errno
Errno (CONST_EDOM)
eDQUOT :: Errno
eDQUOT = CInt -> Errno
Errno (CONST_EDQUOT)
eEXIST :: Errno
eEXIST = CInt -> Errno
Errno (CONST_EEXIST)
eFAULT :: Errno
eFAULT = CInt -> Errno
Errno (CONST_EFAULT)
eFBIG :: Errno
eFBIG = CInt -> Errno
Errno (CONST_EFBIG)
eFTYPE :: Errno
eFTYPE = CInt -> Errno
Errno (CONST_EFTYPE)
eHOSTDOWN :: Errno
eHOSTDOWN = CInt -> Errno
Errno (CONST_EHOSTDOWN)
eHOSTUNREACH :: Errno
eHOSTUNREACH = CInt -> Errno
Errno (CONST_EHOSTUNREACH)
eIDRM :: Errno
eIDRM = CInt -> Errno
Errno (CONST_EIDRM)
eILSEQ :: Errno
eILSEQ = CInt -> Errno
Errno (CONST_EILSEQ)
eINPROGRESS :: Errno
eINPROGRESS = CInt -> Errno
Errno (CONST_EINPROGRESS)
eINTR :: Errno
eINTR = CInt -> Errno
Errno (CONST_EINTR)
eINVAL :: Errno
eINVAL = CInt -> Errno
Errno (CONST_EINVAL)
eIO :: Errno
eIO = CInt -> Errno
Errno (CONST_EIO)
eISCONN :: Errno
eISCONN = CInt -> Errno
Errno (CONST_EISCONN)
eISDIR :: Errno
eISDIR = CInt -> Errno
Errno (CONST_EISDIR)
eLOOP :: Errno
eLOOP = CInt -> Errno
Errno (CONST_ELOOP)
eMFILE :: Errno
eMFILE = CInt -> Errno
Errno (CONST_EMFILE)
eMLINK :: Errno
eMLINK = CInt -> Errno
Errno (CONST_EMLINK)
eMSGSIZE :: Errno
eMSGSIZE = CInt -> Errno
Errno (CONST_EMSGSIZE)
eMULTIHOP :: Errno
eMULTIHOP = CInt -> Errno
Errno (CONST_EMULTIHOP)
eNAMETOOLONG :: Errno
eNAMETOOLONG = CInt -> Errno
Errno (CONST_ENAMETOOLONG)
eNETDOWN :: Errno
eNETDOWN = CInt -> Errno
Errno (CONST_ENETDOWN)
eNETRESET :: Errno
eNETRESET = CInt -> Errno
Errno (CONST_ENETRESET)
eNETUNREACH :: Errno
eNETUNREACH = CInt -> Errno
Errno (CONST_ENETUNREACH)
eNFILE :: Errno
eNFILE = CInt -> Errno
Errno (CONST_ENFILE)
eNOBUFS :: Errno
eNOBUFS = CInt -> Errno
Errno (CONST_ENOBUFS)
eNODATA :: Errno
eNODATA = CInt -> Errno
Errno (CONST_ENODATA)
eNODEV :: Errno
eNODEV = CInt -> Errno
Errno (CONST_ENODEV)
eNOENT :: Errno
eNOENT = CInt -> Errno
Errno (CONST_ENOENT)
eNOEXEC :: Errno
eNOEXEC = CInt -> Errno
Errno (CONST_ENOEXEC)
eNOLCK :: Errno
eNOLCK = CInt -> Errno
Errno (CONST_ENOLCK)
eNOLINK :: Errno
eNOLINK = CInt -> Errno
Errno (CONST_ENOLINK)
eNOMEM :: Errno
eNOMEM = CInt -> Errno
Errno (CONST_ENOMEM)
eNOMSG :: Errno
eNOMSG = CInt -> Errno
Errno (CONST_ENOMSG)
eNONET :: Errno
eNONET = CInt -> Errno
Errno (CONST_ENONET)
eNOPROTOOPT :: Errno
eNOPROTOOPT = CInt -> Errno
Errno (CONST_ENOPROTOOPT)
eNOSPC :: Errno
eNOSPC = CInt -> Errno
Errno (CONST_ENOSPC)
eNOSR :: Errno
eNOSR = CInt -> Errno
Errno (CONST_ENOSR)
eNOSTR :: Errno
eNOSTR = CInt -> Errno
Errno (CONST_ENOSTR)
eNOSYS :: Errno
eNOSYS = CInt -> Errno
Errno (CONST_ENOSYS)
eNOTBLK :: Errno
eNOTBLK = CInt -> Errno
Errno (CONST_ENOTBLK)
eNOTCONN :: Errno
eNOTCONN = CInt -> Errno
Errno (CONST_ENOTCONN)
eNOTDIR :: Errno
eNOTDIR = CInt -> Errno
Errno (CONST_ENOTDIR)
eNOTEMPTY :: Errno
eNOTEMPTY = CInt -> Errno
Errno (CONST_ENOTEMPTY)
eNOTSOCK :: Errno
eNOTSOCK = CInt -> Errno
Errno (CONST_ENOTSOCK)
eNOTSUP :: Errno
eNOTSUP = CInt -> Errno
Errno (CONST_ENOTSUP)
eNOTTY :: Errno
eNOTTY = CInt -> Errno
Errno (CONST_ENOTTY)
eNXIO :: Errno
eNXIO = CInt -> Errno
Errno (CONST_ENXIO)
eOPNOTSUPP :: Errno
eOPNOTSUPP = CInt -> Errno
Errno (CONST_EOPNOTSUPP)
ePERM :: Errno
ePERM = CInt -> Errno
Errno (CONST_EPERM)
ePFNOSUPPORT :: Errno
ePFNOSUPPORT = CInt -> Errno
Errno (CONST_EPFNOSUPPORT)
ePIPE :: Errno
ePIPE = CInt -> Errno
Errno (CONST_EPIPE)
ePROCLIM :: Errno
ePROCLIM = CInt -> Errno
Errno (CONST_EPROCLIM)
ePROCUNAVAIL :: Errno
ePROCUNAVAIL = CInt -> Errno
Errno (CONST_EPROCUNAVAIL)
ePROGMISMATCH :: Errno
ePROGMISMATCH = CInt -> Errno
Errno (CONST_EPROGMISMATCH)
ePROGUNAVAIL :: Errno
ePROGUNAVAIL = CInt -> Errno
Errno (CONST_EPROGUNAVAIL)
ePROTO :: Errno
ePROTO = CInt -> Errno
Errno (CONST_EPROTO)
ePROTONOSUPPORT :: Errno
ePROTONOSUPPORT = CInt -> Errno
Errno (CONST_EPROTONOSUPPORT)
ePROTOTYPE :: Errno
ePROTOTYPE = CInt -> Errno
Errno (CONST_EPROTOTYPE)
eRANGE :: Errno
eRANGE = CInt -> Errno
Errno (CONST_ERANGE)
eREMCHG :: Errno
eREMCHG = CInt -> Errno
Errno (CONST_EREMCHG)
eREMOTE :: Errno
eREMOTE = CInt -> Errno
Errno (CONST_EREMOTE)
eROFS :: Errno
eROFS = CInt -> Errno
Errno (CONST_EROFS)
eRPCMISMATCH :: Errno
eRPCMISMATCH = CInt -> Errno
Errno (CONST_ERPCMISMATCH)
eRREMOTE :: Errno
eRREMOTE = CInt -> Errno
Errno (CONST_ERREMOTE)
eSHUTDOWN :: Errno
eSHUTDOWN = CInt -> Errno
Errno (CONST_ESHUTDOWN)
eSOCKTNOSUPPORT :: Errno
eSOCKTNOSUPPORT = CInt -> Errno
Errno (CONST_ESOCKTNOSUPPORT)
eSPIPE :: Errno
eSPIPE = CInt -> Errno
Errno (CONST_ESPIPE)
eSRCH :: Errno
eSRCH = CInt -> Errno
Errno (CONST_ESRCH)
eSRMNT :: Errno
eSRMNT = CInt -> Errno
Errno (CONST_ESRMNT)
eSTALE :: Errno
eSTALE = CInt -> Errno
Errno (CONST_ESTALE)
eTIME :: Errno
eTIME = CInt -> Errno
Errno (CONST_ETIME)
eTIMEDOUT :: Errno
eTIMEDOUT = CInt -> Errno
Errno (CONST_ETIMEDOUT)
eTOOMANYREFS :: Errno
eTOOMANYREFS = CInt -> Errno
Errno (CONST_ETOOMANYREFS)
eTXTBSY :: Errno
eTXTBSY = CInt -> Errno
Errno (CONST_ETXTBSY)
eUSERS :: Errno
eUSERS = CInt -> Errno
Errno (CONST_EUSERS)
eWOULDBLOCK :: Errno
eWOULDBLOCK = CInt -> Errno
Errno (CONST_EWOULDBLOCK)
eXDEV :: Errno
eXDEV = CInt -> Errno
Errno (CONST_EXDEV)
isValidErrno :: Errno -> Bool
isValidErrno :: Errno -> Bool
isValidErrno (Errno CInt
errno) = CInt
errno CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type Eq CInt
/= -CInt
1
getErrno :: IO Errno
getErrno :: IO Errno
getErrno = do CInt
e <- IO CInt
get_errno; Errno -> IO Errno
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad IO
return (CInt -> Errno
Errno CInt
e)
foreign import ccall unsafe "HsBase.h __hscore_get_errno" get_errno :: IO CInt
resetErrno :: IO ()
resetErrno :: IO ()
resetErrno = CInt -> IO ()
set_errno CInt
0
foreign import ccall unsafe "HsBase.h __hscore_set_errno" set_errno :: CInt -> IO ()
throwErrno :: String
-> IO a
throwErrno :: String -> IO a
throwErrno String
loc =
do
Errno
errno <- IO Errno
getErrno
IOError -> IO a
forall a. IOError -> IO a
ioError (String -> Errno -> Maybe Handle -> Maybe String -> IOError
errnoToIOError String
loc Errno
errno Maybe Handle
forall a. Maybe a
Nothing Maybe String
forall a. Maybe a
Nothing)
throwErrnoIf :: (a -> Bool)
-> String
-> IO a
-> IO a
throwErrnoIf :: (a -> Bool) -> String -> IO a -> IO a
throwErrnoIf a -> Bool
pred String
loc IO a
f =
do
a
res <- IO a
f
if a -> Bool
pred a
res then String -> IO a
forall a. String -> IO a
throwErrno String
loc else a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad IO
return a
res
throwErrnoIf_ :: (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIf_ :: (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIf_ a -> Bool
pred String
loc IO a
f = IO a -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
External instance of the constraint type Functor IO
void (IO a -> IO ()) -> IO a -> IO ()
forall a b. (a -> b) -> a -> b
$ (a -> Bool) -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIf a -> Bool
pred String
loc IO a
f
throwErrnoIfRetry :: (a -> Bool) -> String -> IO a -> IO a
throwErrnoIfRetry :: (a -> Bool) -> String -> IO a -> IO a
throwErrnoIfRetry a -> Bool
pred String
loc IO a
f =
do
a
res <- IO a
f
if a -> Bool
pred a
res
then do
Errno
err <- IO Errno
getErrno
if Errno
err Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eINTR
then (a -> Bool) -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIfRetry a -> Bool
pred String
loc IO a
f
else String -> IO a
forall a. String -> IO a
throwErrno String
loc
else a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad IO
return a
res
throwErrnoIfRetryMayBlock
:: (a -> Bool)
-> String
-> IO a
-> IO b
-> IO a
throwErrnoIfRetryMayBlock :: (a -> Bool) -> String -> IO a -> IO b -> IO a
throwErrnoIfRetryMayBlock a -> Bool
pred String
loc IO a
f IO b
on_block =
do
a
res <- IO a
f
if a -> Bool
pred a
res
then do
Errno
err <- IO Errno
getErrno
if Errno
err Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eINTR
then (a -> Bool) -> String -> IO a -> IO b -> IO a
forall a b. (a -> Bool) -> String -> IO a -> IO b -> IO a
throwErrnoIfRetryMayBlock a -> Bool
pred String
loc IO a
f IO b
on_block
else if Errno
err Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eWOULDBLOCK Bool -> Bool -> Bool
|| Errno
err Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eAGAIN
then do b
_ <- IO b
on_block
(a -> Bool) -> String -> IO a -> IO b -> IO a
forall a b. (a -> Bool) -> String -> IO a -> IO b -> IO a
throwErrnoIfRetryMayBlock a -> Bool
pred String
loc IO a
f IO b
on_block
else String -> IO a
forall a. String -> IO a
throwErrno String
loc
else a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad IO
return a
res
throwErrnoIfRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIfRetry_ :: (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIfRetry_ a -> Bool
pred String
loc IO a
f = IO a -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
External instance of the constraint type Functor IO
void (IO a -> IO ()) -> IO a -> IO ()
forall a b. (a -> b) -> a -> b
$ (a -> Bool) -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIfRetry a -> Bool
pred String
loc IO a
f
throwErrnoIfRetryMayBlock_ :: (a -> Bool) -> String -> IO a -> IO b -> IO ()
throwErrnoIfRetryMayBlock_ :: (a -> Bool) -> String -> IO a -> IO b -> IO ()
throwErrnoIfRetryMayBlock_ a -> Bool
pred String
loc IO a
f IO b
on_block
= IO a -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
External instance of the constraint type Functor IO
void (IO a -> IO ()) -> IO a -> IO ()
forall a b. (a -> b) -> a -> b
$ (a -> Bool) -> String -> IO a -> IO b -> IO a
forall a b. (a -> Bool) -> String -> IO a -> IO b -> IO a
throwErrnoIfRetryMayBlock a -> Bool
pred String
loc IO a
f IO b
on_block
throwErrnoIfMinus1 :: (Eq a, Num a) => String -> IO a -> IO a
throwErrnoIfMinus1 :: String -> IO a -> IO a
throwErrnoIfMinus1 = (a -> Bool) -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIf (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoIfMinus1_ :: (Eq a, Num a) => String -> IO a -> IO ()
throwErrnoIfMinus1_ :: String -> IO a -> IO ()
throwErrnoIfMinus1_ = (a -> Bool) -> String -> IO a -> IO ()
forall a. (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIf_ (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoIfMinus1Retry :: (Eq a, Num a) => String -> IO a -> IO a
throwErrnoIfMinus1Retry :: String -> IO a -> IO a
throwErrnoIfMinus1Retry = (a -> Bool) -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIfRetry (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoIfMinus1Retry_ :: (Eq a, Num a) => String -> IO a -> IO ()
throwErrnoIfMinus1Retry_ :: String -> IO a -> IO ()
throwErrnoIfMinus1Retry_ = (a -> Bool) -> String -> IO a -> IO ()
forall a. (a -> Bool) -> String -> IO a -> IO ()
throwErrnoIfRetry_ (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoIfMinus1RetryMayBlock :: (Eq a, Num a)
=> String -> IO a -> IO b -> IO a
throwErrnoIfMinus1RetryMayBlock :: String -> IO a -> IO b -> IO a
throwErrnoIfMinus1RetryMayBlock = (a -> Bool) -> String -> IO a -> IO b -> IO a
forall a b. (a -> Bool) -> String -> IO a -> IO b -> IO a
throwErrnoIfRetryMayBlock (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoIfMinus1RetryMayBlock_ :: (Eq a, Num a)
=> String -> IO a -> IO b -> IO ()
throwErrnoIfMinus1RetryMayBlock_ :: String -> IO a -> IO b -> IO ()
throwErrnoIfMinus1RetryMayBlock_ = (a -> Bool) -> String -> IO a -> IO b -> IO ()
forall a b. (a -> Bool) -> String -> IO a -> IO b -> IO ()
throwErrnoIfRetryMayBlock_ (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoIfNull :: String -> IO (Ptr a) -> IO (Ptr a)
throwErrnoIfNull :: String -> IO (Ptr a) -> IO (Ptr a)
throwErrnoIfNull = (Ptr a -> Bool) -> String -> IO (Ptr a) -> IO (Ptr a)
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIf (Ptr a -> Ptr a -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type forall a. Eq (Ptr a)
== Ptr a
forall a. Ptr a
nullPtr)
throwErrnoIfNullRetry :: String -> IO (Ptr a) -> IO (Ptr a)
throwErrnoIfNullRetry :: String -> IO (Ptr a) -> IO (Ptr a)
throwErrnoIfNullRetry = (Ptr a -> Bool) -> String -> IO (Ptr a) -> IO (Ptr a)
forall a. (a -> Bool) -> String -> IO a -> IO a
throwErrnoIfRetry (Ptr a -> Ptr a -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type forall a. Eq (Ptr a)
== Ptr a
forall a. Ptr a
nullPtr)
throwErrnoIfNullRetryMayBlock :: String -> IO (Ptr a) -> IO b -> IO (Ptr a)
throwErrnoIfNullRetryMayBlock :: String -> IO (Ptr a) -> IO b -> IO (Ptr a)
throwErrnoIfNullRetryMayBlock = (Ptr a -> Bool) -> String -> IO (Ptr a) -> IO b -> IO (Ptr a)
forall a b. (a -> Bool) -> String -> IO a -> IO b -> IO a
throwErrnoIfRetryMayBlock (Ptr a -> Ptr a -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type forall a. Eq (Ptr a)
== Ptr a
forall a. Ptr a
nullPtr)
throwErrnoPath :: String -> FilePath -> IO a
throwErrnoPath :: String -> String -> IO a
throwErrnoPath String
loc String
path =
do
Errno
errno <- IO Errno
getErrno
IOError -> IO a
forall a. IOError -> IO a
ioError (String -> Errno -> Maybe Handle -> Maybe String -> IOError
errnoToIOError String
loc Errno
errno Maybe Handle
forall a. Maybe a
Nothing (String -> Maybe String
forall a. a -> Maybe a
Just String
path))
throwErrnoPathIf :: (a -> Bool) -> String -> FilePath -> IO a -> IO a
throwErrnoPathIf :: (a -> Bool) -> String -> String -> IO a -> IO a
throwErrnoPathIf a -> Bool
pred String
loc String
path IO a
f =
do
a
res <- IO a
f
if a -> Bool
pred a
res then String -> String -> IO a
forall a. String -> String -> IO a
throwErrnoPath String
loc String
path else a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad IO
return a
res
throwErrnoPathIf_ :: (a -> Bool) -> String -> FilePath -> IO a -> IO ()
throwErrnoPathIf_ :: (a -> Bool) -> String -> String -> IO a -> IO ()
throwErrnoPathIf_ a -> Bool
pred String
loc String
path IO a
f = IO a -> IO ()
forall (f :: * -> *) a. Functor f => f a -> f ()
External instance of the constraint type Functor IO
void (IO a -> IO ()) -> IO a -> IO ()
forall a b. (a -> b) -> a -> b
$ (a -> Bool) -> String -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> String -> IO a -> IO a
throwErrnoPathIf a -> Bool
pred String
loc String
path IO a
f
throwErrnoPathIfNull :: String -> FilePath -> IO (Ptr a) -> IO (Ptr a)
throwErrnoPathIfNull :: String -> String -> IO (Ptr a) -> IO (Ptr a)
throwErrnoPathIfNull = (Ptr a -> Bool) -> String -> String -> IO (Ptr a) -> IO (Ptr a)
forall a. (a -> Bool) -> String -> String -> IO a -> IO a
throwErrnoPathIf (Ptr a -> Ptr a -> Bool
forall a. Eq a => a -> a -> Bool
External instance of the constraint type forall a. Eq (Ptr a)
== Ptr a
forall a. Ptr a
nullPtr)
throwErrnoPathIfMinus1 :: (Eq a, Num a) => String -> FilePath -> IO a -> IO a
throwErrnoPathIfMinus1 :: String -> String -> IO a -> IO a
throwErrnoPathIfMinus1 = (a -> Bool) -> String -> String -> IO a -> IO a
forall a. (a -> Bool) -> String -> String -> IO a -> IO a
throwErrnoPathIf (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
throwErrnoPathIfMinus1_ :: (Eq a, Num a) => String -> FilePath -> IO a -> IO ()
throwErrnoPathIfMinus1_ :: String -> String -> IO a -> IO ()
throwErrnoPathIfMinus1_ = (a -> Bool) -> String -> String -> IO a -> IO ()
forall a. (a -> Bool) -> String -> String -> IO a -> IO ()
throwErrnoPathIf_ (a -> a -> Bool
forall a. Eq a => a -> a -> Bool
Evidence bound by a type signature of the constraint type Eq a
== -a
1)
errnoToIOError :: String
-> Errno
-> Maybe Handle
-> Maybe String
-> IOError
errnoToIOError :: String -> Errno -> Maybe Handle -> Maybe String -> IOError
errnoToIOError String
loc Errno
errno Maybe Handle
maybeHdl Maybe String
maybeName = IO IOError -> IOError
forall a. IO a -> a
unsafePerformIO (IO IOError -> IOError) -> IO IOError -> IOError
forall a b. (a -> b) -> a -> b
$ do
String
str <- Errno -> IO (Ptr CChar)
strerror Errno
errno IO (Ptr CChar) -> (Ptr CChar -> IO String) -> IO String
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
External instance of the constraint type Monad IO
>>= Ptr CChar -> IO String
peekCString
IOError -> IO IOError
forall (m :: * -> *) a. Monad m => a -> m a
External instance of the constraint type Monad IO
return (Maybe Handle
-> IOErrorType
-> String
-> String
-> Maybe CInt
-> Maybe String
-> IOError
IOError Maybe Handle
maybeHdl IOErrorType
errType String
loc String
str (CInt -> Maybe CInt
forall a. a -> Maybe a
Just CInt
errno') Maybe String
maybeName)
where
Errno CInt
errno' = Errno
errno
errType :: IOErrorType
errType
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eOK = IOErrorType
OtherError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
e2BIG = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eACCES = IOErrorType
PermissionDenied
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eADDRINUSE = IOErrorType
ResourceBusy
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eADDRNOTAVAIL = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eADV = IOErrorType
OtherError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eAFNOSUPPORT = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eAGAIN = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eALREADY = IOErrorType
AlreadyExists
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eBADF = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eBADMSG = IOErrorType
InappropriateType
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eBADRPC = IOErrorType
OtherError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eBUSY = IOErrorType
ResourceBusy
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eCHILD = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eCOMM = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eCONNABORTED = IOErrorType
OtherError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eCONNREFUSED = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eCONNRESET = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eDEADLK = IOErrorType
ResourceBusy
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eDESTADDRREQ = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eDIRTY = IOErrorType
UnsatisfiedConstraints
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eDOM = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eDQUOT = IOErrorType
PermissionDenied
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eEXIST = IOErrorType
AlreadyExists
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eFAULT = IOErrorType
OtherError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eFBIG = IOErrorType
PermissionDenied
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eFTYPE = IOErrorType
InappropriateType
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eHOSTDOWN = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eHOSTUNREACH = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eIDRM = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eILSEQ = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eINPROGRESS = IOErrorType
AlreadyExists
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eINTR = IOErrorType
Interrupted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eINVAL = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eIO = IOErrorType
HardwareFault
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eISCONN = IOErrorType
AlreadyExists
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eISDIR = IOErrorType
InappropriateType
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eLOOP = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eMFILE = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eMLINK = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eMSGSIZE = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eMULTIHOP = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNAMETOOLONG = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNETDOWN = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNETRESET = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNETUNREACH = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNFILE = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOBUFS = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNODATA = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNODEV = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOENT = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOEXEC = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOLCK = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOLINK = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOMEM = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOMSG = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNONET = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOPROTOOPT = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOSPC = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOSR = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOSTR = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOSYS = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOTBLK = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOTCONN = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOTDIR = IOErrorType
InappropriateType
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOTEMPTY = IOErrorType
UnsatisfiedConstraints
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOTSOCK = IOErrorType
InvalidArgument
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNOTTY = IOErrorType
IllegalOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eNXIO = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eOPNOTSUPP = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePERM = IOErrorType
PermissionDenied
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePFNOSUPPORT = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePIPE = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROCLIM = IOErrorType
PermissionDenied
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROCUNAVAIL = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROGMISMATCH = IOErrorType
ProtocolError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROGUNAVAIL = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROTO = IOErrorType
ProtocolError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROTONOSUPPORT = IOErrorType
ProtocolError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
ePROTOTYPE = IOErrorType
ProtocolError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eRANGE = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eREMCHG = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eREMOTE = IOErrorType
IllegalOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eROFS = IOErrorType
PermissionDenied
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eRPCMISMATCH = IOErrorType
ProtocolError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eRREMOTE = IOErrorType
IllegalOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eSHUTDOWN = IOErrorType
IllegalOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eSOCKTNOSUPPORT = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eSPIPE = IOErrorType
UnsupportedOperation
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eSRCH = IOErrorType
NoSuchThing
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eSRMNT = IOErrorType
UnsatisfiedConstraints
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eSTALE = IOErrorType
ResourceVanished
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eTIME = IOErrorType
TimeExpired
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eTIMEDOUT = IOErrorType
TimeExpired
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eTOOMANYREFS = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eTXTBSY = IOErrorType
ResourceBusy
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eUSERS = IOErrorType
ResourceExhausted
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eWOULDBLOCK = IOErrorType
OtherError
| Errno
errno Errno -> Errno -> Bool
forall a. Eq a => a -> a -> Bool
Instance of class: Eq of the constraint type Eq Errno
== Errno
eXDEV = IOErrorType
UnsupportedOperation
| Bool
otherwise = IOErrorType
OtherError
foreign import ccall unsafe "string.h" strerror :: Errno -> IO (Ptr CChar)