From 7f3e27157d1f812f3c98179458242f3d7c97bee8 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Mon, 22 Jun 2009 09:26:56 +0000 Subject: Tidy up use of read/write/recv/send; avoid unnecessary wrappers --- libraries/base/System/Posix/Internals.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libraries/base/System/Posix') diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs index ac80574440..8916059e93 100644 --- a/libraries/base/System/Posix/Internals.hs +++ b/libraries/base/System/Posix/Internals.hs @@ -400,7 +400,10 @@ foreign import ccall unsafe "HsBase.h __hscore_mkdir" mkdir :: CString -> CInt -> IO CInt foreign import ccall unsafe "HsBase.h read" - c_read :: CInt -> Ptr CChar -> CSize -> IO CSsize + c_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize + +foreign import ccall safe "read" + c_safe_read :: CInt -> Ptr Word8 -> CSize -> IO CSsize foreign import ccall unsafe "HsBase.h rewinddir" c_rewinddir :: Ptr CDir -> IO () @@ -412,7 +415,10 @@ foreign import ccall unsafe "HsBase.h umask" c_umask :: CMode -> IO CMode foreign import ccall unsafe "HsBase.h write" - c_write :: CInt -> Ptr CChar -> CSize -> IO CSsize + c_write :: CInt -> Ptr Word8 -> CSize -> IO CSsize + +foreign import ccall safe "write" + c_safe_write :: CInt -> Ptr Word8 -> CSize -> IO CSsize foreign import ccall unsafe "HsBase.h __hscore_ftruncate" c_ftruncate :: CInt -> COff -> IO CInt -- cgit v1.2.1