From cf977e706b07e80f394570a393eb2169b9b9a1a7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 28 Dec 2023 04:23:00 +0000 Subject: pure Perl inotify support This is a step towards improving the out-of-the-box experience in achieving notifications without XS, extra downloads, and .so loading + runtime mmap overhead. This also fixes loongarch support of all Linux syscalls due to a bad regexp :x All the reachable Linux architectures listed at should be supported. At the moment, there appears to be no reachable sparc* Linux machines available to cfarm users. Fixes: b0e5093aa3572a86 (syscall: add support for riscv64, 2022-08-11) --- lib/PublicInbox/InboxIdle.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/InboxIdle.pm') diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm index 4231c0a0..3c4d4a68 100644 --- a/lib/PublicInbox/InboxIdle.pm +++ b/lib/PublicInbox/InboxIdle.pm @@ -11,7 +11,7 @@ use PublicInbox::Syscall qw(EPOLLIN); my $IN_MODIFY = 0x02; # match Linux inotify my $ino_cls; if ($^O eq 'linux' && eval { require PublicInbox::Inotify }) { - $IN_MODIFY = Linux::Inotify2::IN_MODIFY(); + $IN_MODIFY = PublicInbox::Inotify::IN_MODIFY(); $ino_cls = 'PublicInbox::Inotify'; } elsif (eval { require PublicInbox::KQNotify }) { $IN_MODIFY = PublicInbox::KQNotify::NOTE_WRITE(); @@ -34,7 +34,7 @@ sub in2_arm ($$) { # PublicInbox::Config::each_inbox callback $ibx->{unlock_subs} = $old_ibx->{unlock_subs}; %{$ibx->{unlock_subs}} = (%$u, %{$ibx->{unlock_subs}}) if $u; - # Linux::Inotify2::Watch::name matches if watches are the + # *::Inotify*::Watch::name matches if watches are the # same, no point in replacing a watch of the same name if ($cur->[1]->name eq $lock) { $self->{on_unlock}->{$lock} = $ibx; @@ -87,7 +87,7 @@ sub new { sub event_step { my ($self) = @_; eval { - my @events = $self->{inot}->read; # Linux::Inotify2::read + my @events = $self->{inot}->read; # PublicInbox::Inotify3::read my $on_unlock = $self->{on_unlock}; for my $ev (@events) { my $fn = $ev->fullname // next; # cancelled -- cgit v1.2.3-24-ge0c7