@@ -419,6 +419,22 @@ fi
print_config "nolibc support" "$liburing_nolibc";
#############################################################################
+####################################################
+# Most Android devices don't have sys/fanotify.h
+has_fanotify="no"
+cat > $TMPC << EOF
+#include <sys/fanotify.h>
+int main(void)
+{
+ return 0;
+}
+EOF
+if compile_prog "" "" "fanotify"; then
+ has_fanotify="yes"
+fi
+print_config "has_fanotify" "$has_fanotify"
+####################################################
+
if test "$liburing_nolibc" = "yes"; then
output_sym "CONFIG_NOLIBC"
fi
@@ -452,6 +468,9 @@ fi
if test "$nvme_uring_cmd" = "yes"; then
output_sym "CONFIG_HAVE_NVME_URING"
fi
+if test "$has_fanotify" = "yes"; then
+ output_sym "CONFIG_HAVE_FANOTIFY"
+fi
echo "CC=$cc" >> $config_host_mak
print_config "CC" "$cc"
@@ -2,6 +2,10 @@
/*
* Description: test fsnotify access off O_DIRECT read
*/
+
+#include "helpers.h"
+
+#ifdef CONFIG_HAVE_FANOTIFY
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
@@ -11,7 +15,6 @@
#include <sys/wait.h>
#include "liburing.h"
-#include "helpers.h"
int main(int argc, char *argv[])
{
@@ -99,3 +102,11 @@ out:
unlink(fname);
return err;
}
+
+#else /* #ifdef CONFIG_HAVE_FANOTIFY */
+
+int main(void)
+{
+ return T_EXIT_SKIP;
+}
+#endif /* #ifdef CONFIG_HAVE_FANOTIFY */