Android fanotify_init: 功能未实现

Android fanotify_init: Function not implemented

我正在尝试使用 fanotify on Android and like to archive that with an executable file (compiled with the ndk). I'm using fsmon(调用 fanotify 系统调用的小应用程序)来启动监视器。但是在执行文件时(在根设备上作为根)我收到以下错误:

generic_x86:/data/local/tmp # ./fsmon -B fanotify /storage/emulated/0/
fanotify_init: Function not implemented

fanotify 在内核版本 > 2.6.37 中可用(在 Android 5+ 中提供)。

我已经在 x86 模拟器 (Android 7) 和带有 CM13 的 Samsung I9300 armeabi-v7a (Android 6) 上进行了尝试(均已 root)。 x86 模拟器的内核版本:3.4.67+ 和三星设备的内核版本:3.0.101-CM-g9c98896

然后我查看了 /goldfish/fs/notify/fanotify/Kconfig 中的 x86 模拟器 goldfish 内核文件:

config FANOTIFY
    bool "Filesystem wide access notification"
    select FSNOTIFY
    select ANON_INODES
    default n
    ---help---
       Say Y here to enable fanotify suport.  fanotify is a file access
       notification system which differs from inotify in that it sends
       an open file descriptor to the userspace listener along with
       the event.

       If unsure, say Y.

config FANOTIFY_ACCESS_PERMISSIONS
    bool "fanotify permissions checking"
    depends on FANOTIFY
    depends on SECURITY
    default n
    ---help---
       Say Y here is you want fanotify listeners to be able to make permissions
       decisions concerning filesystem events.  This is used by some fanotify
       listeners which need to scan files before allowing the system access to
       use those files.  This is used by some anti-malware vendors and by some
       hierarchical storage managent systems.

       If unsure, say N.

所以,我将两者都设置为 Y,make clean 并重新编译内核 - 但问题与之前一样。我是否忽略了什么?

好吧,显然是使用大写 "Y" 而不是小写 "y" 的错误...