aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--System/Posix/Files.hsc4
-rw-r--r--System/Posix/Files/ByteString.hsc4
-rw-r--r--changelog.md2
-rw-r--r--configure.ac3
4 files changed, 11 insertions, 2 deletions
diff --git a/System/Posix/Files.hsc b/System/Posix/Files.hsc
index c8b5ddf..1822294 100644
--- a/System/Posix/Files.hsc
+++ b/System/Posix/Files.hsc
@@ -1,6 +1,8 @@
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
+{-# LANGUAGE CApiFFI #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Files
@@ -420,7 +422,7 @@ setFileSize file off =
withFilePath file $ \s ->
throwErrnoPathIfMinus1_ "setFileSize" file (c_truncate s off)
-foreign import ccall unsafe "truncate"
+foreign import capi unsafe "HsUnix.h truncate"
c_truncate :: CString -> COff -> IO CInt
-- -----------------------------------------------------------------------------
diff --git a/System/Posix/Files/ByteString.hsc b/System/Posix/Files/ByteString.hsc
index 80f0bea..cb68668 100644
--- a/System/Posix/Files/ByteString.hsc
+++ b/System/Posix/Files/ByteString.hsc
@@ -1,6 +1,8 @@
#ifdef __GLASGOW_HASKELL__
{-# LANGUAGE Trustworthy #-}
#endif
+{-# LANGUAGE CApiFFI #-}
+
-----------------------------------------------------------------------------
-- |
-- Module : System.Posix.Files.ByteString
@@ -420,7 +422,7 @@ setFileSize file off =
withFilePath file $ \s ->
throwErrnoPathIfMinus1_ "setFileSize" file (c_truncate s off)
-foreign import ccall unsafe "truncate"
+foreign import capi unsafe "HsUnix.h truncate"
c_truncate :: CString -> COff -> IO CInt
-- -----------------------------------------------------------------------------
diff --git a/changelog.md b/changelog.md
index c481922..66caaeb 100644
--- a/changelog.md
+++ b/changelog.md
@@ -12,6 +12,8 @@
convention
* Fix potential type-mismatch in `telldir`/`seekdir` FFI imports
+ * Use CAPI FFI import for `truncate` to make sure the LFS-version is used.
+
## 2.7.0.1 *Mar 2014*
* Bundled with GHC 7.8.1
diff --git a/configure.ac b/configure.ac
index 41274dc..c10bf89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,9 @@ AC_C_CONST
dnl ** Enable large file support. NB. do this before testing the type of
dnl off_t, because it will affect the result of that test.
+dnl
+dnl WARNING: It's essential this check agrees with HsBaseConfig.h as otherwise
+dnl the definitions of COff/coff_t don't line up
AC_SYS_LARGEFILE
AC_CHECK_HEADERS([dirent.h fcntl.h grp.h limits.h pwd.h signal.h string.h])