aboutsummaryrefslogtreecommitdiffhomepage
path: root/System/Posix/IO.hsc
diff options
context:
space:
mode:
authorGravatar ross <unknown>2003-05-27 10:18:16 +0000
committerGravatar ross <unknown>2003-05-27 10:18:16 +0000
commit7b2889a06ae08b46417e714a5b050a6618a8f198 (patch)
tree88ec1e11d5d3eeab57c765fcab00fa9d9dc24cb6 /System/Posix/IO.hsc
parentdfbaa4e61b528509e5d3b0f8a26dd390313c2c78 (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.hsc11
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