about summary refs log tree commit homepage
path: root/lib/PublicInbox/Syscall.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-10-17 09:30:53 +0000
committerEric Wong <e@80x24.org>2022-10-17 22:16:45 +0000
commit0881010d123914be5e47544229e2b03412a6a691 (patch)
tree283f5c806bfa9ac930b40d61d3aa5f7057093547 /lib/PublicInbox/Syscall.pm
parent7a13b24e3b7f31a647ea180d5b180d8f8eaa025a (diff)
downloadpublic-inbox-0881010d123914be5e47544229e2b03412a6a691.tar.gz
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/
Diffstat (limited to 'lib/PublicInbox/Syscall.pm')
-rw-r--r--lib/PublicInbox/Syscall.pm5
1 files changed, 4 insertions, 1 deletions
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