summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--StatFS.hsc9
1 files changed, 9 insertions, 0 deletions
diff --git a/StatFS.hsc b/StatFS.hsc
index 215be81..21ee731 100644
--- a/StatFS.hsc
+++ b/StatFS.hsc
@@ -23,7 +23,12 @@ import Foreign.C.String
import Data.ByteString (useAsCString)
import Data.ByteString.Char8 (pack)
+#if defined (__FreeBSD__)
+# include <sys/param.h>
+# include <sys/mount.h>
+#else
#include <sys/vfs.h>
+#endif
data FileSystemStats = FileSystemStats {
fsStatBlockSize :: Integer
@@ -42,7 +47,11 @@ data FileSystemStats = FileSystemStats {
data CStatfs
+#if defined(__FreeBSD__)
+foreign import ccall unsafe "sys/mount.h statfs"
+#else
foreign import ccall unsafe "sys/vfs.h statfs64"
+#endif
c_statfs :: CString -> Ptr CStatfs -> IO CInt
toI :: CLong -> Integer