diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2014-08-07 12:33:51 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2014-10-18 16:54:28 +0200 |
commit | bc4bd179bda49b615a1c40df7402ddf80bf775b2 (patch) | |
tree | 8be7d1d1c4e1af4924a4e15532230c7315f9f320 /System | |
parent | 43343c151f9824a44bd6e353610fdeb23f910c72 (diff) |
Use CAPI FFI imports for `truncate`
This makes sure we pick up the LFS version of `truncate` in case `off_t`
is affected by CPP defines such as `_FILE_OFFSET_BITS`.
Diffstat (limited to 'System')
-rw-r--r-- | System/Posix/Files.hsc | 4 | ||||
-rw-r--r-- | System/Posix/Files/ByteString.hsc | 4 |
2 files changed, 6 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 -- ----------------------------------------------------------------------------- |