{-# 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 fd     = fdToHandle $ Fd fd

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