Movatterモバイル変換


[0]ホーム

URL:


base-4.12.0.0: Basic libraries

Copyright(c) The FFI task force 2001
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerffi@haskell.org
Stabilityprovisional
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

Foreign.C.Error

Contents

Description

C-specific Marshalling support: Handling of C "errno" error codes.

Synopsis

Haskell representations oferrno values

newtypeErrnoSource#

Haskell representation forerrno values. The implementation is deliberately exposed, to allow users to add their own definitions ofErrno values.

Constructors

ErrnoCInt 
Instances
EqErrnoSource#

Since: 2.1

Instance details

Defined inForeign.C.Error

Commonerrno symbols

Different operating systems and/or C libraries often support different values oferrno. This module defines the common values, but due to the open definition ofErrno users may add definitions which are not predefined.

eOK ::ErrnoSource#

e2BIG ::ErrnoSource#

eACCES ::ErrnoSource#

eADDRINUSE ::ErrnoSource#

eADDRNOTAVAIL ::ErrnoSource#

eADV ::ErrnoSource#

eAFNOSUPPORT ::ErrnoSource#

eAGAIN ::ErrnoSource#

eALREADY ::ErrnoSource#

eBADF ::ErrnoSource#

eBADMSG ::ErrnoSource#

eBADRPC ::ErrnoSource#

eBUSY ::ErrnoSource#

eCHILD ::ErrnoSource#

eCOMM ::ErrnoSource#

eCONNABORTED ::ErrnoSource#

eCONNREFUSED ::ErrnoSource#

eCONNRESET ::ErrnoSource#

eDEADLK ::ErrnoSource#

eDESTADDRREQ ::ErrnoSource#

eDIRTY ::ErrnoSource#

eDOM ::ErrnoSource#

eDQUOT ::ErrnoSource#

eEXIST ::ErrnoSource#

eFAULT ::ErrnoSource#

eFBIG ::ErrnoSource#

eFTYPE ::ErrnoSource#

eHOSTDOWN ::ErrnoSource#

eHOSTUNREACH ::ErrnoSource#

eIDRM ::ErrnoSource#

eILSEQ ::ErrnoSource#

eINPROGRESS ::ErrnoSource#

eINTR ::ErrnoSource#

eINVAL ::ErrnoSource#

eIO ::ErrnoSource#

eISCONN ::ErrnoSource#

eISDIR ::ErrnoSource#

eLOOP ::ErrnoSource#

eMFILE ::ErrnoSource#

eMLINK ::ErrnoSource#

eMSGSIZE ::ErrnoSource#

eMULTIHOP ::ErrnoSource#

eNAMETOOLONG ::ErrnoSource#

eNETDOWN ::ErrnoSource#

eNETRESET ::ErrnoSource#

eNETUNREACH ::ErrnoSource#

eNFILE ::ErrnoSource#

eNOBUFS ::ErrnoSource#

eNODATA ::ErrnoSource#

eNODEV ::ErrnoSource#

eNOENT ::ErrnoSource#

eNOEXEC ::ErrnoSource#

eNOLCK ::ErrnoSource#

eNOLINK ::ErrnoSource#

eNOMEM ::ErrnoSource#

eNOMSG ::ErrnoSource#

eNONET ::ErrnoSource#

eNOPROTOOPT ::ErrnoSource#

eNOSPC ::ErrnoSource#

eNOSR ::ErrnoSource#

eNOSTR ::ErrnoSource#

eNOSYS ::ErrnoSource#

eNOTBLK ::ErrnoSource#

eNOTCONN ::ErrnoSource#

eNOTDIR ::ErrnoSource#

eNOTEMPTY ::ErrnoSource#

eNOTSOCK ::ErrnoSource#

eNOTSUP ::ErrnoSource#

Since: 4.7.0.0

eNOTTY ::ErrnoSource#

eNXIO ::ErrnoSource#

eOPNOTSUPP ::ErrnoSource#

ePERM ::ErrnoSource#

ePFNOSUPPORT ::ErrnoSource#

ePIPE ::ErrnoSource#

ePROCLIM ::ErrnoSource#

ePROCUNAVAIL ::ErrnoSource#

ePROGMISMATCH ::ErrnoSource#

ePROGUNAVAIL ::ErrnoSource#

ePROTO ::ErrnoSource#

ePROTONOSUPPORT ::ErrnoSource#

ePROTOTYPE ::ErrnoSource#

eRANGE ::ErrnoSource#

eREMCHG ::ErrnoSource#

eREMOTE ::ErrnoSource#

eROFS ::ErrnoSource#

eRPCMISMATCH ::ErrnoSource#

eRREMOTE ::ErrnoSource#

eSHUTDOWN ::ErrnoSource#

eSOCKTNOSUPPORT ::ErrnoSource#

eSPIPE ::ErrnoSource#

eSRCH ::ErrnoSource#

eSRMNT ::ErrnoSource#

eSTALE ::ErrnoSource#

eTIME ::ErrnoSource#

eTIMEDOUT ::ErrnoSource#

eTOOMANYREFS ::ErrnoSource#

eTXTBSY ::ErrnoSource#

eUSERS ::ErrnoSource#

eWOULDBLOCK ::ErrnoSource#

eXDEV ::ErrnoSource#

Errno functions

isValidErrno ::Errno ->BoolSource#

YieldTrue if the givenErrno value is valid on the system. This implies that theEq instance ofErrno is also system dependent as it is only defined for valid values ofErrno.

getErrno ::IOErrnoSource#

Get the current value oferrno in the current thread.

resetErrno ::IO ()Source#

Reset the current thread'serrno value toeOK.

errnoToIOErrorSource#

Arguments

::String

the location where the error occurred

->Errno

the error number

->MaybeHandle

optional handle associated with the error

->MaybeString

optional filename associated with the error

->IOError 

Construct anIOException based on the givenErrno value. The optional information can be used to improve the accuracy of error messages.

throwErrnoSource#

Arguments

::String

textual description of the error location

->IO a 

Throw anIOException corresponding to the current value ofgetErrno.

Guards for IO operations that may fail

throwErrnoIfSource#

Arguments

:: (a ->Bool)

predicate to apply to the result value of theIO operation

->String

textual description of the location

->IO a

theIO operation to be executed

->IO a 

Throw anIOException corresponding to the current value ofgetErrno if the result value of theIO action meets the given predicate.

throwErrnoIf_ :: (a ->Bool) ->String ->IO a ->IO ()Source#

asthrowErrnoIf, but discards the result of theIO action after error handling.

throwErrnoIfRetry :: (a ->Bool) ->String ->IO a ->IO aSource#

asthrowErrnoIf, but retry theIO action when it yields the error codeeINTR - this amounts to the standard retry loop for interrupted POSIX system calls.

throwErrnoIfRetry_ :: (a ->Bool) ->String ->IO a ->IO ()Source#

asthrowErrnoIfRetry, but discards the result.

throwErrnoIfMinus1 :: (Eq a,Num a) =>String ->IO a ->IO aSource#

Throw anIOException corresponding to the current value ofgetErrno if theIO action returns a result of-1.

throwErrnoIfMinus1_ :: (Eq a,Num a) =>String ->IO a ->IO ()Source#

asthrowErrnoIfMinus1, but discards the result.

throwErrnoIfMinus1Retry :: (Eq a,Num a) =>String ->IO a ->IO aSource#

Throw anIOException corresponding to the current value ofgetErrno if theIO action returns a result of-1, but retries in case of an interrupted operation.

throwErrnoIfMinus1Retry_ :: (Eq a,Num a) =>String ->IO a ->IO ()Source#

asthrowErrnoIfMinus1, but discards the result.

throwErrnoIfNull ::String ->IO (Ptr a) ->IO (Ptr a)Source#

Throw anIOException corresponding to the current value ofgetErrno if theIO action returnsnullPtr.

throwErrnoIfNullRetry ::String ->IO (Ptr a) ->IO (Ptr a)Source#

Throw anIOException corresponding to the current value ofgetErrno if theIO action returnsnullPtr, but retry in case of an interrupted operation.

throwErrnoIfRetryMayBlockSource#

Arguments

:: (a ->Bool)

predicate to apply to the result value of theIO operation

->String

textual description of the location

->IO a

theIO operation to be executed

->IO b

action to execute before retrying if an immediate retry would block

->IO a 

asthrowErrnoIfRetry, but additionally if the operation yields the error codeeAGAIN oreWOULDBLOCK, an alternative action is executed before retrying.

throwErrnoIfRetryMayBlock_ :: (a ->Bool) ->String ->IO a ->IO b ->IO ()Source#

asthrowErrnoIfRetryMayBlock, but discards the result.

throwErrnoIfMinus1RetryMayBlock :: (Eq a,Num a) =>String ->IO a ->IO b ->IO aSource#

asthrowErrnoIfMinus1Retry, but checks for operations that would block.

throwErrnoIfMinus1RetryMayBlock_ :: (Eq a,Num a) =>String ->IO a ->IO b ->IO ()Source#

asthrowErrnoIfMinus1RetryMayBlock, but discards the result.

throwErrnoIfNullRetryMayBlock ::String ->IO (Ptr a) ->IO b ->IO (Ptr a)Source#

asthrowErrnoIfNullRetry, but checks for operations that would block.

throwErrnoPath ::String ->FilePath ->IO aSource#

asthrowErrno, but exceptions include the given path when appropriate.

throwErrnoPathIf :: (a ->Bool) ->String ->FilePath ->IO a ->IO aSource#

asthrowErrnoIf, but exceptions include the given path when appropriate.

throwErrnoPathIf_ :: (a ->Bool) ->String ->FilePath ->IO a ->IO ()Source#

asthrowErrnoIf_, but exceptions include the given path when appropriate.

throwErrnoPathIfNull ::String ->FilePath ->IO (Ptr a) ->IO (Ptr a)Source#

asthrowErrnoIfNull, but exceptions include the given path when appropriate.

throwErrnoPathIfMinus1 :: (Eq a,Num a) =>String ->FilePath ->IO a ->IO aSource#

asthrowErrnoIfMinus1, but exceptions include the given path when appropriate.

throwErrnoPathIfMinus1_ :: (Eq a,Num a) =>String ->FilePath ->IO a ->IO ()Source#

asthrowErrnoIfMinus1_, but exceptions include the given path when appropriate.

Produced byHaddock version 2.20.0


[8]ページ先頭

©2009-2025 Movatter.jp