X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/447f908aff7763f8f5d9b6aa13c2551ce17c9b86..ef3a5e0aae003c29941c7d41ed6becea4287752d:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 0581126a28..ffbde3589f 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -29,7 +29,7 @@ #include "wx/stream.h" #ifdef HAVE_STATFS -# ifdef __DARWIN__ +# ifdef __BSD__ # include # include # else @@ -37,6 +37,12 @@ # endif #endif // HAVE_STATFS +#ifdef HAVE_STATVFS + #include + + #define statfs statvfs +#endif // HAVE_STATVFS + #if wxUSE_GUI #include "wx/unix/execute.h" #endif @@ -1007,8 +1013,7 @@ long wxGetFreeMemory() 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 ) { @@ -1017,6 +1022,9 @@ bool wxGetDiskSpace(const wxString& path, wxLongLong *pTotal, wxLongLong *pFree) 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;