#include "wx/stream.h"
#ifdef HAVE_STATFS
-# ifdef __DARWIN__
+# ifdef __BSD__
# include <sys/param.h>
# include <sys/mount.h>
# else
# endif
#endif // HAVE_STATFS
+#ifdef HAVE_STATVFS
+ #include <sys/statvfs.h>
+
+ #define statfs statvfs
+#endif // HAVE_STATVFS
+
#if wxUSE_GUI
#include "wx/unix/execute.h"
#endif
bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree)
{
-#ifdef HAVE_STATFS
-
+#if defined(HAVE_STATFS) || defined(HAVE_STATVFS)
struct statfs fs;
if ( statfs(path, &fs) != 0 )
{
return FALSE;
}
+ // under Solaris we might have to use fs.f_frsize instead as I think it
+ // may be a multiple of the block size in general (TODO)
+
if ( pTotal )
{
*pTotal = wxLongLong(fs.f_blocks) * fs.f_bsize;