From 5011034c3ceb3034d4fc7eecbf6d64774b380253 Mon Sep 17 00:00:00 2001
From: Andrea Rossato <andrea.rossato@ing.unitn.it>
Date: Mon, 17 May 2010 12:09:47 +0200
Subject: make StatFS compile on FreeBSD.

Ignore-this: 9975e535184471c048871630237ff8b4f570c172
Courteously from  Gabor PALI (pgj at FreeBSD.org)

darcs-hash:20100517100947-d6583-a05e0a5138ab7a86f038e1d641f54ff18c5cf091.gz
---
 StatFS.hsc | 9 +++++++++
 1 file changed, 9 insertions(+)

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
-- 
cgit v1.2.3