summaryrefslogtreecommitdiff
path: root/parallel/mpi-ch/patches/patch-ca
blob: f7a1e89dd2c917993a40066c861f9eda8a44d69c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$NetBSD: patch-ca,v 1.1 2004/06/24 17:32:14 drochner Exp $

--- romio/adio/common/ad_fstype.c.orig	2002-12-04 00:38:23.000000000 +0100
+++ romio/adio/common/ad_fstype.c
@@ -12,7 +12,15 @@
 
 #include "adio.h"
 
-#if (defined(HPUX) || defined(SPPUX) || defined(IRIX) || defined(SOLARIS) || defined(AIX) || defined(DEC) || defined(CRAY))
+#ifdef __NetBSD__
+#include <sys/param.h>
+#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 <sys/statvfs.h>
 #endif
 #ifdef LINUX
@@ -143,10 +151,10 @@ static void ADIO_FileSysType_fncall(char
     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
@@ -158,7 +166,7 @@ static void ADIO_FileSysType_fncall(char
 
     *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));
@@ -207,7 +215,7 @@ static void ADIO_FileSysType_fncall(char
 # 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));