| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
GHC.Internal.System.IO.OS
Description
This module bridges between Haskell handles and underlying operating-system features.
Synopsis
- withFileDescriptorReadingBiased :: Handle -> (CInt -> IO r) -> IO r
- withFileDescriptorWritingBiased :: Handle -> (CInt -> IO r) -> IO r
- withWindowsHandleReadingBiased :: Handle -> (Ptr () -> IO r) -> IO r
- withWindowsHandleWritingBiased :: Handle -> (Ptr () -> IO r) -> IO r
- withFileDescriptorReadingBiasedRaw :: Handle -> (CInt -> IO r) -> IO r
- withFileDescriptorWritingBiasedRaw :: Handle -> (CInt -> IO r) -> IO r
- withWindowsHandleReadingBiasedRaw :: Handle -> (Ptr () -> IO r) -> IO r
- withWindowsHandleWritingBiasedRaw :: Handle -> (Ptr () -> IO r) -> IO r
Obtaining file descriptors and Windows handles
withFileDescriptorReadingBiased :: Handle -> (CInt -> IO r) -> IO r Source #
Executes a user-provided action on the POSIX file descriptor that underlies a handle or specifically on the POSIX file descriptor for reading if the handle uses different file descriptors for reading and writing. The Haskell-managed buffers related to the file descriptor are flushed before the user-provided action is run. While this action is executed, further operations on the handle are blocked to a degree that interference with this action is prevented.
If the handle does not use POSIX file descriptors, an exception is thrown.
See below for caveats regarding this operation.
withFileDescriptorWritingBiased :: Handle -> (CInt -> IO r) -> IO r Source #
Executes a user-provided action on the POSIX file descriptor that underlies a handle or specifically on the POSIX file descriptor for writing if the handle uses different file descriptors for reading and writing. The Haskell-managed buffers related to the file descriptor are flushed before the user-provided action is run. While this action is executed, further operations on the handle are blocked to a degree that interference with this action is prevented.
If the handle does not use POSIX file descriptors, an exception is thrown.
See below for caveats regarding this operation.
withWindowsHandleReadingBiased :: Handle -> (Ptr () -> IO r) -> IO r Source #
Executes a user-provided action on the Windows handle that underlies a Haskell handle or specifically on the Windows handle for reading if the Haskell handle uses different Windows handles for reading and writing. The Haskell-managed buffers related to the Windows handle are flushed before the user-provided action is run. While this action is executed, further operations on the Haskell handle are blocked to a degree that interference with this action is prevented.
If the Haskell handle does not use Windows handles, an exception is thrown.
See below for caveats regarding this operation.
withWindowsHandleWritingBiased :: Handle -> (Ptr () -> IO r) -> IO r Source #
Executes a user-provided action on the Windows handle that underlies a Haskell handle or specifically on the Windows handle for writing if the Haskell handle uses different Windows handles for reading and writing. The Haskell-managed buffers related to the Windows handle are flushed before the user-provided action is run. While this action is executed, further operations on the Haskell handle are blocked to a degree that interference with this action is prevented.
If the Haskell handle does not use Windows handles, an exception is thrown.
See below for caveats regarding this operation.
withFileDescriptorReadingBiasedRaw :: Handle -> (CInt -> IO r) -> IO r Source #
Like withFileDescriptorReadingBiased except that Haskell-managed buffers
are not flushed.
withFileDescriptorWritingBiasedRaw :: Handle -> (CInt -> IO r) -> IO r Source #
Like withFileDescriptorWritingBiased except that Haskell-managed buffers
are not flushed.
withWindowsHandleReadingBiasedRaw :: Handle -> (Ptr () -> IO r) -> IO r Source #
Like withWindowsHandleReadingBiased except that Haskell-managed buffers
are not flushed.
withWindowsHandleWritingBiasedRaw :: Handle -> (Ptr () -> IO r) -> IO r Source #
Like withWindowsHandleWritingBiased except that Haskell-managed buffers
are not flushed.