$NetBSD: patch-as,v 1.1.1.1 2007/10/17 21:35:53 agc Exp $

--- lib/wiper/wiperPosix.c	2007/09/29 12:46:28	1.1
+++ lib/wiper/wiperPosix.c	2007/09/29 12:48:36
@@ -23,7 +23,7 @@
  *
  */
 
-#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__)
+#if !defined(__linux__) && !defined(sun) && !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__NetBSD__)
 #error This file should not be compiled on this platform.
 #endif
 
@@ -31,12 +31,12 @@
 #include <sys/stat.h>
 #if defined(__linux__) || defined(sun)
 # include <sys/vfs.h>
-#elif defined(__FreeBSD__) || defined(__APPLE__)
+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
 # include <sys/param.h>
 # include <sys/ucred.h>
 # include <sys/mount.h>
 # include <fstab.h>
-# if BSD_VERSION >= 50
+# if defined(__FreeBSD__) && BSD_VERSION >= 50
 #  include <libgen.h>
 # endif /* BSD_VERSION < 50 */
 #endif
@@ -65,7 +65,7 @@
 
 #if defined(sun) || defined(__linux__)
 # define PROCFS "proc"
-#elif defined(__FreeBSD__) || defined(__APPLE__)
+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__)
 # define PROCFS "procfs"
 #endif
 
@@ -195,7 +195,7 @@
    return TRUE;
 }
 
-#elif defined(__FreeBSD__) || defined(__APPLE__) /* } FreeBSD { */
+#elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__NetBSD__) /* } FreeBSD { */
 
 static INLINE Bool
 WiperIsDiskDevice(MNTINFO *mnt,         // IN: file system being considered
@@ -209,7 +209,7 @@
     * function, as a whole, does not even apply to OS X, so this caveat is
     * only minor.
     */
-#if BSD_VERSION < 50
+#if defined(__NetBSD__) || BSD_VERSION < 50
    /*
     * Before FreeBSD 5, device nodes had static major/minor numbers.
     * (FreeBSD 5 included devfs which got rid of this concept.)  So
@@ -509,14 +509,14 @@
                               uint64 *free,       // OUT
                               uint64 *total)      // OUT
 {
-#ifdef sun
+#if defined(sun) || defined(__NetBSD__)
    struct statvfs statfsbuf;
 #else
    struct statfs statfsbuf;
 #endif
    ASSERT(p);
 
-#ifdef sun
+#if defined(sun) || defined(__NetBSD__)
    if (statvfs(p->mountPoint, &statfsbuf) < 0) {
 #else
    if (statfs(p->mountPoint, &statfsbuf) < 0) {
