diff -u openbsd-compat/bsd-statvfs.c openbsd-compat/bsd-statvfs.c --- openbsd-compat/bsd-statvfs.c 2017-10-02 20:34:26.000000000 +0000 +++ openbsd-compat/bsd-statvfs.c 2018-01-04 23:28:17.000000000 +0000 @@ -25,6 +25,8 @@ #include +#if ((!defined(HAVE_STATVFS) && defined(HAVE_STATFS)) || \ + (!defined(HAVE_FSTATVFS) && defined(HAVE_FSTATFS))) static void copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from) { @@ -40,6 +42,7 @@ to->f_flag = from->f_flags; to->f_namemax = MNAMELEN; } +#endif # ifndef HAVE_STATVFS int statvfs(const char *path, struct statvfs *buf) diff -u openbsd-compat/bsd-statvfs.h openbsd-compat/bsd-statvfs.h --- openbsd-compat/bsd-statvfs.h 2017-10-02 20:34:26.000000000 +0000 +++ openbsd-compat/bsd-statvfs.h 2018-01-05 11:28:03.000000000 +0000 @@ -42,6 +42,8 @@ #endif /* as defined in IEEE Std 1003.1, 2004 Edition */ +#if ((!defined(HAVE_STATVFS) && defined(HAVE_STATFS)) || \ + (!defined(HAVE_FSTATVFS) && defined(HAVE_FSTATFS))) struct statvfs { unsigned long f_bsize; /* File system block size. */ unsigned long f_frsize; /* Fundamental file system block size. */ @@ -59,6 +61,7 @@ unsigned long f_namemax;/* Maximum filename length. */ }; #endif +#endif #ifndef HAVE_STATVFS int statvfs(const char *, struct statvfs *);