summaryrefslogtreecommitdiff
path: root/libraries/base/System
diff options
context:
space:
mode:
authorkrasimir <unknown>2005-01-05 21:30:07 +0000
committerkrasimir <unknown>2005-01-05 21:30:07 +0000
commitf61189b61a43a1768616af87dc0fa99554173bbe (patch)
tree4e69eba93c01c6cebcc0dc64fa04a8daa7f53f47 /libraries/base/System
parent2bbab799b3a1e00a6bab3077756e27af4ade6219 (diff)
downloadhaskell-f61189b61a43a1768616af87dc0fa99554173bbe.tar.gz
[project @ 2005-01-05 21:30:05 by krasimir]
Added implementation for hSetFileSize. The configure script checks for _chsize (usially Windows) and ftruncate (Linux) C functions and the package uses one of them to implement hSetFileSize.
Diffstat (limited to 'libraries/base/System')
-rw-r--r--libraries/base/System/IO.hs5
-rw-r--r--libraries/base/System/Posix/Internals.hs3
2 files changed, 7 insertions, 1 deletions
diff --git a/libraries/base/System/IO.hs b/libraries/base/System/IO.hs
index f94dca660d..b47bb42666 100644
--- a/libraries/base/System/IO.hs
+++ b/libraries/base/System/IO.hs
@@ -57,9 +57,12 @@ module System.IO (
-- * Operations on handles
- -- ** Determining the size of a file
+ -- ** Determining and changing the size of a file
hFileSize, -- :: Handle -> IO Integer
+#ifdef __GLASGOW_HASKELL__
+ hSetFileSize, -- :: Handle -> Integer -> IO ()
+#endif
-- ** Detecting the end of input
diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs
index a2821e03ae..e127520e1a 100644
--- a/libraries/base/System/Posix/Internals.hs
+++ b/libraries/base/System/Posix/Internals.hs
@@ -376,6 +376,9 @@ foreign import ccall unsafe "HsBase.h umask"
foreign import ccall unsafe "HsBase.h write"
c_write :: CInt -> Ptr CChar -> CSize -> IO CSsize
+foreign import ccall unsafe "HsBase.h __hscore_ftruncate"
+ c_ftruncate :: CInt -> COff -> IO CInt
+
foreign import ccall unsafe "HsBase.h unlink"
c_unlink :: CString -> IO CInt