0

我正在尝试在 Android 上使用fanotify,并希望将其存档为可执行文件(使用 ndk 编译)。我正在使用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(均已植根)的三星 I9300 armeabi-v7a(Android 6)上尝试过它。x86 模拟器的内核版本:3.4.67+和三星设备的内核版本:3.0.101-CM-g9c98896

然后我查看了 x86-emulator goldfish 内核文件/goldfish/fs/notify/fanotify/Kconfig

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然后重新编译内核 - 但和以前一样的问题......我忽略了什么吗?

4

1 回答 1

0

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

于 2017-04-01T10:23:35.957 回答