$NetBSD: patch-ac,v 1.1.1.1 2007/03/01 00:34:14 xtraeme Exp $ --- encfs/encfs.cpp.orig 2007-03-01 01:05:53.000000000 +0100 +++ encfs/encfs.cpp 2007-03-01 01:10:17.000000000 +0100 @@ -23,7 +23,11 @@ #include #include #include +#ifndef __NetBSD__ #include +#else +#include +#endif #include @@ -497,7 +501,11 @@ return res; } +#ifndef __NetBSD__ int encfs_statfs(const char *path, struct statfs *st) +#else +int encfs_statfs(const char *path, struct statvfs *st) +#endif { int res = -EIO; try @@ -507,11 +515,19 @@ string cyName = FSRoot->rootDirectory(); rLog(Info, "doing statfs of %s", cyName.c_str()); +#ifndef __NetBSD__ res = statfs( cyName.c_str(), st ); +#else + res = statvfs(cyName.c_str(), st); +#endif if(!res) { +#ifndef __NetBSD__ // adjust maximum name length.. st->f_namelen = 6 * (st->f_namelen - 2) / 8; // approx.. +#else + st->f_namemax = 6 * (st->f_namemax - 2) / 8; +#endif } if(res == -1) res = -errno;