Re: [PATCH] libstddjb: add pathexec_run_or_die

From: Laurent Bercot <ska-skaware_at_skarnet.org>
Date: Thu, 18 May 2017 11:55:37 +0000

> pathexec_run(a, b, c);
> strerr_dieexec(111, a);
>
>is a reasonably common pattern in execline programs, and since
>strerr_dieexec expands to a 11 argument function call (of
>strerr_diesys), this ends up generating a lot of code. Provide a
>helper to do these two calls.

  That's actually a pretty good idea, I hadn't thought about the amount
of generated code when a function takes a lot of arguments. Do you have
measurements of the gains that the helper provides, for static execline
binaries for instance?


>src/libstddjb/pathexec_run_or_die.c | 10 ++++++++++

  I don't like the "or die" terminology much - it makes me think of Perl.
:)
A common C convention for "if foobar() fails then die" is "xfoobar".
Unless someone has a better idea, I'll add such a helper as
xpathexec_run
(and probably xpathexec0_run too).

  Thanks for the suggestion,

--
  Laurent
Received on Thu May 18 2017 - 11:55:37 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC