* [PATCH 0/3] support sendmsg+recvmsg in pure Perl under Linux
@ 2022-03-23 8:54 5% Eric Wong
2022-03-23 8:54 7% ` [PATCH 2/3] recv_cmd: do not undef recvmsg buffer arg on errors Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-03-23 8:54 UTC (permalink / raw)
To: meta
Most C compilers are bandwidth and storage hogs; while binary
distribution makes it harder for ordinary users to exercise
software freedom. So no great options here, but relying on
the stable Linux ABI is probably the easiest for the majority
of our users (currently on x86-64 and x86 Linux).
Eric Wong (3):
syscall: drop unused EEXIST import
recv_cmd: do not undef recvmsg buffer arg on errors
syscall: implement sendmsg+recvmsg in pure Perl
devel/syscall-list | 2 +
lib/PublicInbox/CmdIPC4.pm | 4 +-
lib/PublicInbox/Syscall.pm | 97 +++++++++++++++++++++++++++++++++++++-
script/lei | 6 ++-
t/cmd_ipc.t | 13 ++++-
5 files changed, 117 insertions(+), 5 deletions(-)
^ permalink raw reply [relevance 5%]
* [PATCH 2/3] recv_cmd: do not undef recvmsg buffer arg on errors
2022-03-23 8:54 5% [PATCH 0/3] support sendmsg+recvmsg in pure Perl under Linux Eric Wong
@ 2022-03-23 8:54 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-03-23 8:54 UTC (permalink / raw)
To: meta
It's a waste of ops and cycles, and inconsistent with perl
sysread() behavior which doesn't touch the supplied buffer on
errors.
---
lib/PublicInbox/CmdIPC4.pm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/PublicInbox/CmdIPC4.pm b/lib/PublicInbox/CmdIPC4.pm
index c3a7f56e..76938b6d 100644
--- a/lib/PublicInbox/CmdIPC4.pm
+++ b/lib/PublicInbox/CmdIPC4.pm
@@ -1,4 +1,4 @@
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# callers should use PublicInbox::CmdIPC4->can('send_cmd4') (or recv_cmd4)
@@ -32,7 +32,7 @@ no warnings 'once';
*recv_cmd4 = sub ($$$) {
my ($s, undef, $len) = @_; # $_[1] = destination buffer
my $mh = Socket::MsgHdr->new(buflen => $len, controllen => 256);
- my $r = Socket::MsgHdr::recvmsg($s, $mh, 0) // return ($_[1] = undef);
+ my $r = Socket::MsgHdr::recvmsg($s, $mh, 0) // return (undef);
$_[1] = $mh->buf;
return () if $r == 0;
my (undef, undef, $data) = $mh->cmsghdr;
^ permalink raw reply related [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-03-23 8:54 5% [PATCH 0/3] support sendmsg+recvmsg in pure Perl under Linux Eric Wong
2022-03-23 8:54 7% ` [PATCH 2/3] recv_cmd: do not undef recvmsg buffer arg on errors Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).