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.
This commit is contained in:
parent
17db081ac5
commit
b9c4c006bd
1 changed files with 5 additions and 1 deletions
|
@ -53,7 +53,7 @@ import Foreign.C.String
|
||||||
import Data.ByteString (useAsCString)
|
import Data.ByteString (useAsCString)
|
||||||
import Data.ByteString.Char8 (pack)
|
import Data.ByteString.Char8 (pack)
|
||||||
|
|
||||||
#if defined (__FreeBSD__)
|
#if defined (__FreeBSD__) || defined (__APPLE__)
|
||||||
# include <sys/param.h>
|
# include <sys/param.h>
|
||||||
# include <sys/mount.h>
|
# include <sys/mount.h>
|
||||||
#else
|
#else
|
||||||
|
@ -84,10 +84,14 @@ data CStatfs
|
||||||
#ifdef UNKNOWN
|
#ifdef UNKNOWN
|
||||||
#warning free space checking code not available for this OS
|
#warning free space checking code not available for this OS
|
||||||
#else
|
#else
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
foreign import ccall unsafe "sys/mount.h statfs64"
|
||||||
|
#else
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__)
|
||||||
foreign import ccall unsafe "sys/mount.h statfs"
|
foreign import ccall unsafe "sys/mount.h statfs"
|
||||||
#else
|
#else
|
||||||
foreign import ccall unsafe "sys/vfs.h statfs64"
|
foreign import ccall unsafe "sys/vfs.h statfs64"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
c_statfs :: CString -> Ptr CStatfs -> IO CInt
|
c_statfs :: CString -> Ptr CStatfs -> IO CInt
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue