summaryrefslogtreecommitdiffhomepage
path: root/StatFS.hsc
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2010-05-17 12:09:47 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2010-05-17 12:09:47 +0200
commit5011034c3ceb3034d4fc7eecbf6d64774b380253 (patch)
tree25555848cdb0e6f1e8f8e92242f94d1d5ad71ef5 /StatFS.hsc
parenta6d4818f6ac8b64a0f1490422e2b37e525a06914 (diff)
downloadxmobar-5011034c3ceb3034d4fc7eecbf6d64774b380253.tar.gz
xmobar-5011034c3ceb3034d4fc7eecbf6d64774b380253.tar.bz2
make StatFS compile on FreeBSD.
Ignore-this: 9975e535184471c048871630237ff8b4f570c172 Courteously from Gabor PALI (pgj at FreeBSD.org) darcs-hash:20100517100947-d6583-a05e0a5138ab7a86f038e1d641f54ff18c5cf091.gz
Diffstat (limited to 'StatFS.hsc')
-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