diff options
author | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2010-05-17 12:09:47 +0200 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@ing.unitn.it> | 2010-05-17 12:09:47 +0200 |
commit | 5011034c3ceb3034d4fc7eecbf6d64774b380253 (patch) | |
tree | 25555848cdb0e6f1e8f8e92242f94d1d5ad71ef5 /StatFS.hsc | |
parent | a6d4818f6ac8b64a0f1490422e2b37e525a06914 (diff) | |
download | xmobar-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.hsc | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 |