summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/bsd-statvfs.c8
-rw-r--r--openbsd-compat/bsd-statvfs.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-statvfs.c b/openbsd-compat/bsd-statvfs.c
index 458dbe89c..e3bd87d98 100644
--- a/openbsd-compat/bsd-statvfs.c
+++ b/openbsd-compat/bsd-statvfs.c
@@ -25,6 +25,10 @@
25 25
26#include <errno.h> 26#include <errno.h>
27 27
28#ifndef MNAMELEN
29# define MNAMELEN 32
30#endif
31
28static void 32static void
29copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from) 33copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
30{ 34{
@@ -37,7 +41,11 @@ copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
37 to->f_ffree = from->f_ffree; 41 to->f_ffree = from->f_ffree;
38 to->f_favail = from->f_ffree; /* no exact equivalent */ 42 to->f_favail = from->f_ffree; /* no exact equivalent */
39 to->f_fsid = 0; /* XXX fix me */ 43 to->f_fsid = 0; /* XXX fix me */
44#ifdef HAVE_STRUCT_STATFS_F_FLAGS
40 to->f_flag = from->f_flags; 45 to->f_flag = from->f_flags;
46#else
47 to->f_flag = 0;
48#endif
41 to->f_namemax = MNAMELEN; 49 to->f_namemax = MNAMELEN;
42} 50}
43 51
diff --git a/openbsd-compat/bsd-statvfs.h b/openbsd-compat/bsd-statvfs.h
index 815ec03b2..e2a4c15f7 100644
--- a/openbsd-compat/bsd-statvfs.h
+++ b/openbsd-compat/bsd-statvfs.h
@@ -26,6 +26,9 @@
26#ifdef HAVE_SYS_STATFS_H 26#ifdef HAVE_SYS_STATFS_H
27#include <sys/statfs.h> 27#include <sys/statfs.h>
28#endif 28#endif
29#ifdef HAVE_SYS_VFS_H
30#include <sys/vfs.h>
31#endif
29 32
30#ifndef HAVE_FSBLKCNT_T 33#ifndef HAVE_FSBLKCNT_T
31typedef unsigned long fsblkcnt_t; 34typedef unsigned long fsblkcnt_t;