From 0881010d123914be5e47544229e2b03412a6a691 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 17 Oct 2022 09:30:53 +0000 Subject: sigfd: set SIGWINCH for MIPS and PA-RISC on Linux SIGWINCH is actually different for these architectures on Linux according to the signal(7) man page. Note: AFAICS there's no parisc machine in the GCC Farm[1], so it remains untested. I've only tested mips64 for mips, but I expect them to both work. OpenBSD (on gcc231) octeon defines SIGWINCH as the common `28', so it appears Linux is the only one with arch-dependent signal numbers (ditto with syscalls). [1] https://cfarm.tetaneutral.net/machines/list/ --- lib/PublicInbox/Syscall.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Syscall.pm') diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm index 291e0489..ee4c6107 100644 --- a/lib/PublicInbox/Syscall.pm +++ b/lib/PublicInbox/Syscall.pm @@ -21,13 +21,14 @@ use parent qw(Exporter); use POSIX qw(ENOENT ENOSYS EINVAL O_NONBLOCK); use Socket qw(SOL_SOCKET SCM_RIGHTS); use Config; +our %SIGNUM = (WINCH => 28); # most Linux, {Free,Net,Open}BSD, *Darwin # $VERSION = '0.25'; # Sys::Syscall version our @EXPORT_OK = qw(epoll_ctl epoll_create epoll_wait EPOLLIN EPOLLOUT EPOLLET EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD EPOLLONESHOT EPOLLEXCLUSIVE - signalfd rename_noreplace); + signalfd rename_noreplace %SIGNUM); our %EXPORT_TAGS = (epoll => [qw(epoll_ctl epoll_create epoll_wait EPOLLIN EPOLLOUT EPOLL_CTL_ADD EPOLL_CTL_DEL EPOLL_CTL_MOD @@ -159,6 +160,7 @@ if ($^O eq "linux") { $SYS_epoll_wait = 226; $u64_mod_8 = 1; $SYS_signalfd4 = 309; + $SIGNUM{WINCH} = 23; } elsif ($machine =~ m/^ppc64/) { $SYS_epoll_create = 236; $SYS_epoll_ctl = 237; @@ -252,6 +254,7 @@ if ($^O eq "linux") { $SYS_recvmsg = 4177; $FS_IOC_GETFLAGS = 0x40046601; $FS_IOC_SETFLAGS = 0x80046602; + $SIGNUM{WINCH} = 20; } else { # as a last resort, try using the *.ph files which may not # exist or may be wrong -- cgit v1.2.3-24-ge0c7