$NetBSD$

--- mfs.c.orig	1994-06-22 14:24:51.000000000 +0000
+++ mfs.c
@@ -319,17 +319,24 @@ TODO:
 #include <errno.h>
 #include <sys/param.h>
 #include <stdlib.h>
+#if !__STDC__
 #include <malloc.h>
+#endif
 
-#ifdef SOLARIS
+#if defined(SOLARIS) || (defined(__NetBSD__) && __NetBSD_Version__ >= 299000900)
 #include <fcntl.h>
 #include <sys/statvfs.h>
 #endif
 
 #if defined(SGI) || defined(RS6000)
-#include <sys/statfs.h>
+# include <sys/statfs.h>
 #else
-#include <sys/vfs.h>
+# include <sys/param.h>
+# if BSD >= 199103
+#  include <sys/mount.h>
+# else
+#  include <sys/vfs.h>
+# endif /* new BSD */
 #endif
 
 
@@ -768,7 +775,7 @@ get_unix_attr(int mode, int attr)
 int
 get_disk_space(char *cwd, int *free, int *total)
 {
-#ifdef SOLARIS
+#if defined(SOLARIS) || (defined(__NetBSD__) && __NetBSD_Version__ >= 299000900)
     struct statvfs fsbuf;
     if (statvfs(cwd, &fsbuf) >= 0)
 #else
@@ -1182,8 +1189,6 @@ _get_dir(char *name, char *mname, char *
   (void) find_file(name, &sbuf);
 
   if ((cur_dir = opendir(name)) == NULL) {
-    extern int errno;
-
     Debug0((dbg_fd, "get_dir(): couldn't open '%s' errno = %s\n", name, strerror(errno)));
     return (NULL);
   }
