{-# LINE 1 "libraries/libiserv/src/GHCi/Utils.hsc" #-}
{-# LANGUAGE CPP #-}
module GHCi.Utils
    ( getGhcHandle
    ) where

import Foreign.C
import GHC.IO.Handle (Handle())

{-# LINE 11 "libraries/libiserv/src/GHCi/Utils.hsc" #-}
import System.Posix

{-# LINE 13 "libraries/libiserv/src/GHCi/Utils.hsc" #-}



-- | Gets a GHC Handle File description from the given OS Handle or POSIX fd.
getGhcHandle :: CInt -> IO Handle

{-# LINE 24 "libraries/libiserv/src/GHCi/Utils.hsc" #-}
getGhcHandle :: CInt -> IO Handle
getGhcHandle CInt
fd     = Fd -> IO Handle
fdToHandle forall a b. (a -> b) -> a -> b
$ CInt -> Fd
Fd CInt
fd

{-# LINE 26 "libraries/libiserv/src/GHCi/Utils.hsc" #-}