|
Foreign.C.Error | Portability | portable | Stability | provisional | Maintainer | ffi@haskell.org |
|
|
|
|
|
Description |
C-specific Marshalling support: Handling of C "errno" error codes.
|
|
Synopsis |
|
|
|
|
Haskell representations of errno values
|
|
|
Haskell representation for errno values.
The implementation is deliberately exposed, to allow users to add
their own definitions of Errno values.
| Constructors | | Instances | |
|
|
Common errno symbols
|
|
Different operating systems and/or C libraries often support
different values of errno. This module defines the common values,
but due to the open definition of Errno users may add definitions
which are not predefined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Errno functions
|
|
|
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.
|
|
|
Get the current value of errno in the current thread.
|
|
|
Reset the current thread's errno value to eOK.
|
|
|
:: String | the location where the error occurred
| -> Errno | the error number
| -> Maybe Handle | optional handle associated with the error
| -> Maybe String | optional filename associated with the error
| -> IOError | | Construct a Haskell 98 I/O error based on the given Errno value.
The optional information can be used to improve the accuracy of
error messages.
|
|
|
|
|
|
Guards for IO operations that may fail
|
|
|
:: | | => a -> Bool | textual description of the location
| -> String | the IO operation to be executed
| -> IO a | | -> IO a | | Throw an IOError corresponding to the current value of getErrno
if the result value of the IO action meets the given predicate.
|
|
|
|
as throwErrnoIf, but discards the result of the IO action after
error handling.
|
|
|
as throwErrnoIf, but retry the IO action when it yields the
error code eINTR - this amounts to the standard retry loop for
interrupted POSIX system calls.
|
|
|
as throwErrnoIfRetry, but discards the result.
|
|
|
Throw an IOError corresponding to the current value of getErrno
if the IO action returns a result of -1.
|
|
|
as throwErrnoIfMinus1, but discards the result.
|
|
|
Throw an IOError corresponding to the current value of getErrno
if the IO action returns a result of -1, but retries in case of
an interrupted operation.
|
|
|
as throwErrnoIfMinus1, but discards the result.
|
|
|
Throw an IOError corresponding to the current value of getErrno
if the IO action returns nullPtr.
|
|
|
Throw an IOError corresponding to the current value of getErrno
if the IO action returns nullPtr,
but retry in case of an interrupted operation.
|
|
throwErrnoIfRetryMayBlock | Source |
|
:: | | => a -> Bool | textual description of the location
| -> String | the IO operation to be executed
| -> IO a | action to execute before retrying if
an immediate retry would block
| -> IO b | | -> IO a | | as throwErrnoIfRetry, but additionlly if the operation
yields the error code eAGAIN or eWOULDBLOCK, an alternative
action is executed before retrying.
|
|
|
|
as throwErrnoIfRetryMayBlock, but discards the result.
|
|
|
as throwErrnoIfMinus1Retry, but checks for operations that would block.
|
|
|
as throwErrnoIfMinus1RetryMayBlock, but discards the result.
|
|
|
as throwErrnoIfNullRetry, but checks for operations that would block.
|
|
|
as throwErrno, but exceptions include the given path when appropriate.
|
|
|
as throwErrnoIf, but exceptions include the given path when
appropriate.
|
|
|
as throwErrnoIf_, but exceptions include the given path when
appropriate.
|
|
|
as throwErrnoIfNull, but exceptions include the given path when
appropriate.
|
|
|
as throwErrnoIfMinus1, but exceptions include the given path when
appropriate.
|
|
|
as throwErrnoIfMinus1_, but exceptions include the given path when
appropriate.
|
|
Produced by Haddock version 2.6.0 |