diff --git a/System/IO.hs b/System/IO.hs
index c8b0f925ad5ace0059bd657dffbfcfeddfb2281f..a5b9d7d2e3fae659e773eb9c8b0f41ea4b1c3669 100644
--- a/System/IO.hs
+++ b/System/IO.hs
@@ -155,7 +155,7 @@ module System.IO (
     hGetBufNonBlocking,	       -- :: Handle -> Ptr a -> Int -> IO Int
 #endif
 
-    -- * Temporary files (not portable: GHC only)
+    -- * Temporary files
 
     openTempFile,
     openBinaryTempFile,
@@ -464,6 +464,9 @@ openTempFile' loc tmp_dir template binary = do
       where
         filename        = prefix ++ show x ++ suffix
         filepath        = tmp_dir ++ [pathSeparator] ++ filename
+#if __HUGS__
+        fdToHandle fd   = openFd (fromIntegral fd) False ReadWriteMode binary
+#endif
 
 -- XXX Should use filepath library
 pathSeparator :: Char