From: sof Date: Mon, 26 Nov 2001 19:43:23 +0000 (+0000) Subject: [project @ 2001-11-26 19:43:23 by sof] X-Git-Tag: Approximately_9120_patches~517 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=254849fcd88bbb7b553141556400194c1bd9f24f;p=ghc-hetmet.git [project @ 2001-11-26 19:43:23 by sof] win32 only - provide closeFd, which closes a file descriptor, be it of file or socket ilk. --- diff --git a/ghc/lib/std/PrelPosix.hsc b/ghc/lib/std/PrelPosix.hsc index 5d85f61..35dacc6 100644 --- a/ghc/lib/std/PrelPosix.hsc +++ b/ghc/lib/std/PrelPosix.hsc @@ -269,6 +269,16 @@ foreign import "isatty" unsafe foreign import "close" unsafe c_close :: CInt -> IO CInt +#ifdef mingw32_TARGET_OS +closeFd :: Bool -> CInt -> IO CInt +closeFd isStream fd + | isStream = c_closesocket fd + | otherwise = c_close fd + +foreign import "closesocket" unsafe + c_closesocket :: CInt -> IO CInt +#endif + foreign import "lseek" unsafe c_lseek :: CInt -> COff -> CInt -> IO COff