无法在freeBSD上安装Linux :: Inotify2

时间:2019-10-15 10:38:36

标签: linux perl freebsd cpan inotify

我正在尝试在freeBSD上安装Inotify2,但是测试步骤会引发错误。

cpan install Linux::Inotify2

它引发以下错误:

root@freebsd12sabin:~/.cpan/build/Linux-Inotify2-2.1-6 # make test
"/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- Inotify2.bs blib/arch/auto/Linux/Inotify2/Inotify2.bs 644
PERL_DL_NONLAZY=1 "/usr/local/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_load.t ..... Can't load '/root/.cpan/build/Linux-Inotify2-2.1-6/blib/arch/auto/Linux/Inotify2/Inotify2.so' for module Linux::Inotify2: /root/.cpan/build/Linux-Inotify2-2.1-6/blib/arch/auto/Linux/Inotify2/Inotify2.so: Undefined symbol "inotify_init" at /usr/local/lib/perl5/5.30/mach/DynaLoader.pm line 193.
 at /root/.cpan/build/Linux-Inotify2-2.1-6/blib/lib/Linux/Inotify2.pm line 97.
BEGIN failed--compilation aborted at /root/.cpan/build/Linux-Inotify2-2.1-6/blib/lib/Linux/Inotify2.pm line 97.

反正我可以继续吗?

3 个答案:

答案 0 :(得分:2)

您需要使用在OS上可用的替代方法。

答案 1 :(得分:1)

实际上,有devel/libinotify库,它通过kevent API在FreeBSD上实现了inotify接口。因此,可能有可能构建此扩展。

如果您进入Undefined symbol "inotify_init"阶段,剩下的唯一事情就是安装libinotify软件包,然后添加适当的-l标志以构建命令行。我不熟悉Perl构建系统,所以我不建议如何做。

答案 2 :(得分:0)

Inotify是Linux特定的API。您不能在FreeBSD(或任何其他不使用Linux内核的操作系统)上使用它,因为该内核不提供这些syscall。