355c9b
diff -ru ncdu-1.18.orig/src/dir.h ncdu-1.18/src/dir.h
355c9b
--- ncdu-1.18.orig/src/dir.h	2022-04-28 11:16:45.000000000 +0200
355c9b
+++ ncdu-1.18/src/dir.h	2022-12-23 15:57:39.201824078 +0100
355c9b
@@ -113,7 +113,7 @@
355c9b
 extern int dir_import_active;
355c9b
 int dir_import_init(const char *fn);
355c9b
 
355c9b
-#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS
355c9b
+#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS || __midipix__
355c9b
 extern int exclude_kernfs;
355c9b
 #endif
355c9b
 
355c9b
diff -ru ncdu-1.18.orig/src/dir_scan.c ncdu-1.18/src/dir_scan.c
355c9b
--- ncdu-1.18.orig/src/dir_scan.c	2022-04-28 11:16:57.000000000 +0200
355c9b
+++ ncdu-1.18/src/dir_scan.c	2022-12-23 15:57:10.769823906 +0100
355c9b
@@ -38,10 +38,12 @@
355c9b
 #include <sys/attr.h>
355c9b
 #endif
355c9b
 
355c9b
-#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS
355c9b
+#if HAVE_SYS_STATFS_H && HAVE_STATFS
355c9b
 #include <sys/statfs.h>
355c9b
+#if HAVE_LINUX_MAGIC_H
355c9b
 #include <linux/magic.h>
355c9b
 #endif
355c9b
+#endif
355c9b
 
355c9b
 
355c9b
 /* set S_BLKSIZE if not defined already in sys/stat.h */
355c9b
@@ -60,7 +62,7 @@
355c9b
 static unsigned int buf_nlink;
355c9b
 
355c9b
 
355c9b
-#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS
355c9b
+#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS || __midipix__
355c9b
 int exclude_kernfs; /* Exclude Linux pseudo filesystems */
355c9b
 
355c9b
 static int is_kernfs(unsigned long type) {
355c9b
diff -ru ncdu-1.18.orig/src/main.c ncdu-1.18/src/main.c
355c9b
--- ncdu-1.18.orig/src/main.c	2022-11-30 11:30:55.000000000 +0100
355c9b
+++ ncdu-1.18/src/main.c	2022-12-23 15:58:20.801824331 +0100
355c9b
@@ -291,7 +291,7 @@
355c9b
   printf("  -X, --exclude-from FILE    Exclude files that match any pattern in FILE\n");
355c9b
   printf("  -L, --follow-symlinks      Follow symbolic links (excluding directories)\n");
355c9b
   printf("  --exclude-caches           Exclude directories containing CACHEDIR.TAG\n");
355c9b
-#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS
355c9b
+#if HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS || __midipix__
355c9b
   printf("  --exclude-kernfs           Exclude Linux pseudo filesystems (procfs,sysfs,cgroup,...)\n");
355c9b
 #endif
355c9b
 #if HAVE_SYS_ATTR_H && HAVE_GETATTRLIST && HAVE_DECL_ATTR_CMNEXT_NOFIRMLINKPATH
355c9b
@@ -395,9 +395,11 @@
355c9b
     else if(!arg_option()) die("Unknown option '%s'.\n", argparser_state.last);
355c9b
   }
355c9b
 
355c9b
+#ifndef __midipix__
355c9b
 #if !(HAVE_LINUX_MAGIC_H && HAVE_SYS_STATFS_H && HAVE_STATFS)
355c9b
   if(exclude_kernfs) die("The --exclude-kernfs flag is currently only supported on Linux.\n");
355c9b
 #endif
355c9b
+#endif
355c9b
 
355c9b
   if(export) {
355c9b
     if(dir_export_init(export)) die("Can't open %s: %s\n", export, strerror(errno));