Re: posix_spawn (was: Bugs with execline/s6 documentation and skalibs functions using posix_spawn())

From: Casper Ti. Vector <caspervector_at_gmail.com>
Date: Thu, 29 Jun 2023 17:58:03 +0800

On Thu, Jun 29, 2023 at 08:21:19AM +0000, Laurent Bercot wrote:
> POSIX doesn't mandate any path other than /dev/null and /dev/console
> and I'd rather not try executing them, who knows what weird permissions
> they may have on obscure OSes.

Actually I mean a *directory* that is guaranteed to exist (and meanwhile
unexecutable): so /dev here.

> I agree it's a lot of work for not much, but as you said, the
> behaviour is arguably conformant, and your experience proves that old
> glibcs are still around, so I'd rather make posix_spawn usable where
> it exists instead of placing the burden of --with-sysdep-posixspawn=no
> on users who have a bad version.

Well I was intending to suggest that we simpliy avoided posix_spawn*()
where it disagreed with posix_spawn(3p); that is to say simply replacing
all previous `#ifdef HASPOSIXSPAWN' conditions with `#if (defined
HASPOSIXSPAWN) && (!defined SKALIBS_HASPOSIXSPAWNEARLYRETURN)'. After
all it seems to me child_spawn*() is not used that prevalently, so the
performance penalty is really minor; of course, feel free to correct me.

And I probably also need to bring the incorrectness of posix_spawn(3)
to the attention of its (Linux manpages) maintainers.

-- 
My current OpenPGP key:
RSA4096/0x227E8CAAB7AA186C (expires: 2024.09.30)
7077 7781 B859 5166 AE07 0286 227E 8CAA B7AA 186C
Received on Thu Jun 29 2023 - 11:58:03 CEST

This archive was generated by hypermail 2.4.0 : Thu Jun 29 2023 - 11:58:45 CEST