[add hGetBuf and hPutBuf to System.IO
John Meacham <john@repetae.net>**20080307045900] hunk ./lib/base/System/IO.hs 15
+    hPutBuf,
+    hGetBuf,
hunk ./lib/base/System/IO.hs 76
-	
+
hunk ./lib/base/System/IO.hs 81
-	
+
hunk ./lib/base/System/IO.hs 95
+
+
+
+hPutBuf :: Handle -> Ptr a -> Int -> IO ()
+hPutBuf h p c = do
+    let count = fromIntegral c
+    rc <- withHandle h $ fwrite p 1 count
+    if rc /= count then fail "hPutBuf: short write" else return ()
+
+hGetBuf :: Handle -> Ptr a -> Int -> IO Int
+hGetBuf h p c = do
+    let count = fromIntegral c
+    rc <- withHandle h $ fread p 1 count
+    return $ fromIntegral rc
+
+
+foreign import ccall "stdio.h fwrite_unlocked" fwrite  :: Ptr a -> CSize -> CSize -> Ptr Handle -> IO CSize
+foreign import ccall "stdio.h fread_unlocked" fread :: Ptr a -> CSize -> CSize -> Ptr Handle -> IO CSize
+