diff options
author | ross <unknown> | 2003-05-27 10:18:16 +0000 |
---|---|---|
committer | ross <unknown> | 2003-05-27 10:18:16 +0000 |
commit | 7b2889a06ae08b46417e714a5b050a6618a8f198 (patch) | |
tree | 88ec1e11d5d3eeab57c765fcab00fa9d9dc24cb6 /System/Posix/IO.hsc | |
parent | dfbaa4e61b528509e5d3b0f8a26dd390313c2c78 (diff) |
[project @ 2003-05-27 10:18:16 by ross]
Hugs only: make fdToHandle available
Diffstat (limited to 'System/Posix/IO.hsc')
-rw-r--r-- | System/Posix/IO.hsc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/System/Posix/IO.hsc b/System/Posix/IO.hsc index 1307a57..c350f8a 100644 --- a/System/Posix/IO.hsc +++ b/System/Posix/IO.hsc @@ -53,8 +53,9 @@ module System.Posix.IO ( #ifdef __GLASGOW_HASKELL__ -- ** Converting file descriptors to\/from Handles - handleToFd, fdToHandle, + handleToFd, #endif + fdToHandle, ) where @@ -75,6 +76,7 @@ import qualified GHC.Handle #ifdef __HUGS__ import Hugs.Prelude (IOException(..), IOErrorType(..)) +import qualified Hugs.IO (openFd) #endif #include "HsUnix.h" @@ -191,6 +193,13 @@ fdToHandle :: Fd -> IO Handle fdToHandle fd = GHC.Handle.fdToHandle (fromIntegral fd) #endif +#ifdef __HUGS__ +fdToHandle :: Fd -> IO Handle +fdToHandle fd = do + mode <- fdGetMode (fromIntegral fd) + Hugs.IO.openFd (fromIntegral fd) False mode True +#endif + -- ----------------------------------------------------------------------------- -- Fd options |