diff --git a/StatFS.hsc b/StatFS.hsc index 8b453dc199..dd0c90bebd 100644 --- a/StatFS.hsc +++ b/StatFS.hsc @@ -53,7 +53,7 @@ import Foreign.C.String import Data.ByteString (useAsCString) import Data.ByteString.Char8 (pack) -#if defined (__FreeBSD__) +#if defined (__FreeBSD__) || defined (__APPLE__) # include # include #else @@ -84,10 +84,14 @@ data CStatfs #ifdef UNKNOWN #warning free space checking code not available for this OS #else +#if defined(__APPLE__) +foreign import ccall unsafe "sys/mount.h statfs64" +#else #if defined(__FreeBSD__) foreign import ccall unsafe "sys/mount.h statfs" #else foreign import ccall unsafe "sys/vfs.h statfs64" +#endif #endif c_statfs :: CString -> Ptr CStatfs -> IO CInt #endif