$OpenBSD: patch-libktorrent_util_fileops_cpp,v 1.3 2008/02/05 19:17:15 naddy Exp $
--- libktorrent/util/fileops.cpp.orig	Sun Jan 27 07:06:02 2008
+++ libktorrent/util/fileops.cpp	Sat Feb  2 13:27:40 2008
@@ -61,10 +61,13 @@ typedef	int64_t		__s64;
 #define O_LARGEFILE 0
 #endif
 
-				 
+#if HAVE_STATVFS
 #include <sys/statvfs.h>
+#else
+#include <sys/param.h>
+#include <sys/mount.h>
+#endif
 
-
 namespace bt
 {
 	void MakeDir(const QString & dir,bool nothrow)
@@ -445,7 +448,19 @@ namespace bt
 			return false;
 		}
 #else
-		return false;
+		struct statfs stfs;
+		if (statfs(path.local8Bit(), &stfs) == 0)
+		{
+			bytes_free = ((Uint64)stfs.f_bavail) * ((Uint64)stfs.f_bsize);
+			return true;
+		}
+		else
+		{
+			Out(SYS_GEN|LOG_DEBUG) << "Error : statfs for " << path << " failed :  "
+						<< QString(strerror(errno)) << endl;
+
+			return false;
+		}
 #endif
 	}
 }
