From c17c44d9e0ef28f0f0521656f335f836ad8b7754 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Jan 2021 12:15:02 +0000 Subject: cmd_ipc: send FDs with buffer payload For another step in in syscall reduction, we'll support transferring 3 FDs and a buffer with a single sendmsg/recvmsg syscall using Socket::MsgHdr if available. Beyond script/lei itself, this will be used for internal IPC between search backends (perhaps with SOCK_SEQPACKET). There's a chance this could make it to the public-facing daemons, too. This adds an optional dependency on the Socket::MsgHdr package, available as libsocket-msghdr-perl on Debian-based distros (but not CentOS 7.x and FreeBSD 11.x, at least). Our Inline::C version in PublicInbox::Spawn remains the last choice for script/lei due to the high startup time, and IO::FDPass remains supported for non-Debian distros. Since the socket name prefix changes from 3 to 4, we'll also take this opportunity to make the argv+env buffer transfer less error-prone by relying on argc instead of designated delimiters. --- MANIFEST | 3 +++ 1 file changed, 3 insertions(+) (limited to 'MANIFEST') diff --git a/MANIFEST b/MANIFEST index 609160dd..62c14cd2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -109,6 +109,8 @@ lib/PublicInbox/Admin.pm lib/PublicInbox/AdminEdit.pm lib/PublicInbox/AltId.pm lib/PublicInbox/Cgit.pm +lib/PublicInbox/CmdIPC1.pm +lib/PublicInbox/CmdIPC4.pm lib/PublicInbox/CompressNoop.pm lib/PublicInbox/Config.pm lib/PublicInbox/ConfigIter.pm @@ -275,6 +277,7 @@ t/altid.t t/altid_v2.t t/cgi.t t/check-www-inbox.perl +t/cmd_ipc.t t/config.t t/config_limiter.t t/content_hash.t -- cgit v1.2.3-24-ge0c7