ghc-internal-9.1500.0: Basic libraries
Safe HaskellSafe
LanguageHaskell2010

GHC.Internal.System.IO.OS

Description

This module bridges between Haskell handles and underlying operating-system features.

Synopsis

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.

Caveats

This subsection is just a dummy, whose purpose is to serve as the target of the hyperlinks above. The real documentation of the caveats is in the Caveats subsection in the base module System.IO.OS, which re-exports the above operations.