From 62068fafcb40c2f91d31cf3fa5e775ecc52a6ba8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 7 Aug 2020 10:15:04 +0000 Subject: syscall: support sparc64 (and maybe other big-endian systems) Thanks to the GCC compile farm project, we can wire up syscalls for sparc64 and set system-specific SFD_* constants properly. I've FINALLY figured out how to use POSIX::SigSet to generate a usable buffer for the syscall perlfunc. This is required for endian-neutral behavior and relevant to sparc64, at least. There's no need for signalfd-related stuff to be constants, either. signalfd initialization is never a hot path and a stub subroutine for constants uses several KB of memory in the interpreter. We'll drop the needless SEEK_CUR import while we're importing O_NONBLOCK, too. --- t/sigfd.t | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 't') diff --git a/t/sigfd.t b/t/sigfd.t index 07120b64..8daf3137 100644 --- a/t/sigfd.t +++ b/t/sigfd.t @@ -4,7 +4,7 @@ use Test::More; use IO::Handle; use POSIX qw(:signal_h); use Errno qw(ENOSYS); -use PublicInbox::Syscall qw(SFD_NONBLOCK); +use PublicInbox::Syscall qw($SFD_NONBLOCK); require_ok 'PublicInbox::Sigfd'; SKIP: { @@ -42,8 +42,8 @@ SKIP: { } $sigfd = undef; - my $nbsig = PublicInbox::Sigfd->new($sig, SFD_NONBLOCK); - ok($nbsig, 'Sigfd->new SFD_NONBLOCK works'); + my $nbsig = PublicInbox::Sigfd->new($sig, $SFD_NONBLOCK); + ok($nbsig, 'Sigfd->new $SFD_NONBLOCK works'); is($nbsig->wait_once, undef, 'nonblocking ->wait_once'); ok($! == Errno::EAGAIN, 'got EAGAIN'); kill('HUP', $$) or die "kill $!"; -- cgit v1.2.3-24-ge0c7