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
|
$NetBSD: patch-as,v 1.1.1.1 2007/02/27 11:55:57 hira Exp $
--- ../sal/osl/unx/file.cxx.orig 2007-02-17 23:02:10.000000000 +0900
+++ ../sal/osl/unx/file.cxx 2007-02-17 23:04:04.000000000 +0900
@@ -1424,7 +1424,7 @@
#ifdef HAVE_STATFS_H
-#if defined(FREEBSD) || defined(NETBSD) || defined(MACOSX)
+#if defined(FREEBSD) || defined(MACOSX)
# define __OSL_STATFS_STRUCT struct statfs
# define __OSL_STATFS(dir, sfs) statfs((dir), (sfs))
# define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_bsize))
@@ -1438,6 +1438,32 @@
# define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (1)
#endif /* FREEBSD || NETBSD */
+#if defined(NETBSD)
+
+#include <sys/param.h>
+
+/* statvfs() replaced statfs() in 2.99.9 */
+# if __NetBSD_Version__ >= 299000900
+ /* 2.0D or later */
+# define __OSL_STATFS_STRUCT struct statvfs
+# define __OSL_STATFS(dir, sfs) statvfs((dir), (sfs))
+# define __OSL_STATFS_ISREMOTE(a) (((a).f_flag & ST_LOCAL) == 0)
+
+# else
+ /* version before 2.0D */
+# define __OSL_STATFS_STRUCT struct statfs
+# define __OSL_STATFS(dir, sfs) statfs((dir), (sfs))
+# define __OSL_STATFS_ISREMOTE(a) (((a).f_type & MNT_LOCAL) == 0)
+
+# endif /* >2.0D */
+
+# define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_bsize))
+# define __OSL_STATFS_TYPENAME(a) ((a).f_fstypename)
+
+# define __OSL_STATFS_IS_CASE_SENSITIVE_FS(a) (strcmp((a).f_fstypename, "msdos") != 0 && strcmp((a).f_fstypename, "ntfs") != 0 && strcmp((a).f_fstypename, "smbfs") != 0)
+# define __OSL_STATFS_IS_CASE_PRESERVING_FS(a) (strcmp((a).f_fstypename, "msdos") != 0)
+#endif
+
#if defined(LINUX)
# define __OSL_NFS_SUPER_MAGIC 0x6969
# define __OSL_SMB_SUPER_MAGIC 0x517B
|