summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-03-23 12:53:57 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-03-23 12:53:57 -0400
commitb9c4c006bdc8f0317d0598f05b45e4fdc1102a6c (patch)
treecf5ae6983b51edf821d0cccf578525c9847821aa
parent17db081ac57e91d4d2bf92c31b0d50154dc0dc63 (diff)
use statfs64 on apple, while retaining statfs on freebsd
http://git-annex.branchable.com/bugs/Makefile_is_missing_dependancies/#comment-3196b43b7d745ab206435d0a69686815 indicates statfs64 works on apple. Probably on freebsd too, but I have not tested it and so will stick with the old code there.
-rw-r--r--StatFS.hsc6
1 files changed, 5 insertions, 1 deletions
diff --git a/StatFS.hsc b/StatFS.hsc
index 8b453dc19..dd0c90beb 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 <sys/param.h>
# include <sys/mount.h>
#else
@@ -84,11 +84,15 @@ 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