$NetBSD: patch-ab,v 1.4 2005/11/11 16:04:29 joerg Exp $

--- lib/write.cpp.orig	2004-03-25 10:12:43.000000000 +0000
+++ lib/write.cpp
@@ -40,7 +40,7 @@ extern "C"
 #  include <sys/stat.h>
 #  include <sys/types.h>
 #  include <fcntl.h>
-#  if defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__)
+#  if defined(__APPLE__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
 #    include <sys/param.h>
 #    include <sys/mount.h>
 #  else
@@ -896,8 +896,17 @@ bool WriteThread::diskSpaceTest(const st
 #else
 //---------------------------------------------------------------------------
 
+#if defined(__NetBSD__) && (__NetBSD_Version__ >= 299000900) /* NetBSD 2.99.9 */
+#define HAVE_STATVFS 1
+#endif
+
 bool WriteThread::diskSpaceTest(const string &fileName, unsigned long fileSize)
 {
+#if defined(HAVE_STATVFS)
+#define statfs statvfs
+#define f_bsize f_frsize
+#endif
+
     struct statfs stat;
 
     string path = extractFilePath(fileName);
