HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerebase-1.21.2Haskell2010

Rebase.Foreign.C.Error

  • 1 type
  • 126 values
  • Packagerebase-1.21.2
  • Exports127
  • LanguageHaskell2010
  • LicenceMIT
  • SourceError.hs
valueerrnoToIOError
  1. :: String

    the location where the error occurred

  2. -> Errno

    the error number

  3. -> Maybe Handle

    optional handle associated with the error

  4. -> Maybe String

    optional filename associated with the error

  5. -> IOError
#

Construct an IOError based on the given Errno value. The optional information can be used to improve the accuracy of error messages.

valuegetErrno :: IO Errno
#

Get the current value of errno in the current thread.

On GHC, the runtime will ensure that any Haskell thread will only see "its own" errno, by saving and restoring the value when Haskell threads are scheduled across OS threads.

valueisValidErrno :: Errno -> Bool
#

Yield True if the given Errno value is valid on the system. This implies that the Eq instance of Errno is also system dependent as it is only defined for valid values of Errno.

valuethrowErrnoIf
  1. :: (a -> Bool)

    predicate to apply to the result value of the IO operation

  2. -> String

    textual description of the location

  3. -> IO a

    the IO operation to be executed

  4. -> IO a
#

Throw an IOError corresponding to the current value of getErrno if the result value of the IO action meets the given predicate.

valuethrowErrnoIfRetryMayBlock
  1. :: (a -> Bool)

    predicate to apply to the result value of the IO operation

  2. -> String

    textual description of the location

  3. -> IO a

    the IO operation to be executed

  4. -> IO b

    action to execute before retrying if an immediate retry would block

  5. -> IO a
#

as throwErrnoIfRetry, but additionally if the operation yields the error code eAGAIN or eWOULDBLOCK, an alternative action is executed before retrying.

newtypenewtype Errno
#

Haskell representation for errno values. The implementation is deliberately exposed, to allow users to add their own definitions of Errno values.

Constructors

Instances1Eq
  • Eq ErrnoDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Error