Android fanotify_init:功能未实现

时间:2017-03-31 14:20:38

标签: android linux android-ndk fanotify

我正在尝试在Android上使用fanotify,并希望将其存档为可执行文件(使用ndk编译)。我正在使用fsmon(调用fanotify systemcall的小应用程序)来启动监视器。但是在执行文件时(在root用户的root设备上)我收到以下错误:

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)和三星I9300 armeabi-v7a(Android 6)上使用CM13(均为root)尝试过。 x86模拟器的内核版本:3.4.67+和三星设备:3.0.101-CM-g9c98896

然后我查看了/goldfish/fs/notify/fanotify/Kconfig中的x86-emulator金鱼内核文件:

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并重新编译内核 - 但是像之前一样的问题..我是否忽略了某些内容?

1 个答案:

答案 0 :(得分:0)

显然使用大写的“Y”而不是小写的“y”是错误的......