From acefd91b302dc1bffded901c3ecd0db8f9916e9b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 23 Mar 2022 08:54:35 +0000 Subject: syscall: implement sendmsg+recvmsg in pure Perl Socket::MsgHdr is only packaged for Debian and derivatives at the moment, and Inline::C pulling in gcc/clang is a huge amount of disk space and bandwidth for some users. This enables disk space and/or bandwidth-limited users to use lei. Only Linux guarantees a stable ABI and syscall numbers, but that's the majority of our userbase. FreeBSD users will still have to use Inline::C (or get Socket::MsgHdr packaged). x86, x32, and x86-64 are all currently supported, more to be added. --- script/lei | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'script') diff --git a/script/lei b/script/lei index 5cad19d7..adef9944 100755 --- a/script/lei +++ b/script/lei @@ -1,5 +1,5 @@ #!perl -w -# Copyright (C) 2020-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ use strict; use v5.10.1; @@ -9,6 +9,10 @@ my $narg = 5; my $sock; my $recv_cmd = PublicInbox::CmdIPC4->can('recv_cmd4'); my $send_cmd = PublicInbox::CmdIPC4->can('send_cmd4') // do { + require PublicInbox::Syscall; + $recv_cmd = PublicInbox::Syscall->can('recv_cmd4'); + PublicInbox::Syscall->can('send_cmd4'); +} // do { my $inline_dir = $ENV{PERL_INLINE_DIRECTORY} //= ( $ENV{XDG_CACHE_HOME} // ( ($ENV{HOME} // '/nonexistent').'/.cache' ) -- cgit v1.2.3-24-ge0c7