$NetBSD: patch-main.c,v 1.1 2019/03/05 11:24:01 ryoon Exp $ * Fix build on NetBSD --- main.c.orig 2016-11-18 15:38:37.000000000 +0000 +++ main.c @@ -429,17 +429,31 @@ static bool register_roots(array* new_ro #if defined(__BSD__) static array* unwatchable_mounts() { +#if defined(__NetBSD__) + int fsCount = getvfsstat(NULL, 0, MNT_WAIT); +#else int fsCount = getfsstat(NULL, 0, MNT_WAIT); +#endif if (fsCount > 0) { +#if defined(__NetBSD__) + struct statvfs fs[fsCount]; + fsCount = getvfsstat(fs, (int)(sizeof(struct statvfs) * fsCount), MNT_NOWAIT); +#else struct statfs fs[fsCount]; fsCount = getfsstat(fs, (int)(sizeof(struct statfs) * fsCount), MNT_NOWAIT); +#endif if (fsCount > 0) { array* mounts = array_create(fsCount); CHECK_NULL(mounts, NULL); for (int i=0; i