$NetBSD: patch-ca,v 1.2 2005/03/03 12:01:30 garbled Exp $ --- romio/adio/common/ad_fstype.c.orig 2003-09-04 13:24:44.000000000 -0700 +++ romio/adio/common/ad_fstype.c 2004-10-15 09:54:55.000000000 -0700 @@ -11,7 +11,15 @@ */ #include "adio.h" -#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY)) +#ifdef __NetBSD__ +#include +#if __NetBSD_Version__ >= 200040000 +#define NETBSD_STATVFS +#define f_basetype f_fstypename +#endif +#endif + +#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY) || defined(NETBSD_STATVFS)) #include #endif #ifdef LINUX @@ -159,10 +167,10 @@ char *dir; int err; #endif -#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY)) +#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY) || defined(NETBSD_STATVFS)) struct statvfs vfsbuf; #endif -#if (defined(LINUX) || defined(FREEBSD) || defined(tflops)) +#if (defined(LINUX) || defined(FREEBSD) || defined(tflops)) && !defined(NETBSD_STATVFS) struct statfs fsbuf; #endif #ifdef PARAGON @@ -174,7 +182,7 @@ *error_code = MPI_SUCCESS; -#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY)) +#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY) || defined(NETBSD_STATVFS)) do { err = statvfs(filename, &vfsbuf); } while (err && (errno == ESTALE)); @@ -226,7 +234,7 @@ #endif else *fstype = ADIO_UFS; } -#elif (defined(FREEBSD) && defined(HAVE_MOUNT_NFS)) +#elif (defined(FREEBSD) && defined(HAVE_MOUNT_NFS)) && !defined(NETBSD_STATVFS) do { err = statfs(filename, &fsbuf); } while (err && (errno == ESTALE));