GNU bug report logs - #52835
[PATCH 0/2] Fix spawning a child not setting standard fds properly

Previous Next

Package: guile;

Reported by: Josselin Poiret <dev <at> jpoiret.xyz>

Date: Mon, 27 Dec 2021 21:27:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #98 received at 52835 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 52835 <at> debbugs.gnu.org, Timothy Sample <samplet <at> ngyro.com>
Subject: Re: bug#52835: [PATCH 0/2] Fix spawning a child not setting
 standard fds properly
Date: Sat, 07 Jan 2023 17:07:01 +0100
Hi Ludo,

Happy new year!

Ludovic Courtès <ludo <at> gnu.org> writes:

> ‘spawn*’ is expressive enough, but a procedure with 6 positional
> arguments cannot be exposed as-is IMO.
>
> One tiny thing that’s missing is a boolean to choose between
> ‘posix_spawn’ and ‘posix_spawnp’.
>
> So we need either ‘spawn’ defined in Scheme as you did, or directly use
> ‘scm_c_bind_keyword_arguments’ right in ‘scm_spawn_process’ (info
> "(guile) Keyword Procedures"), to avoid ending up with two procedures.
> I’m fine either way.

I've done the above by using the C functions to bind keyword arguments,
and added the #:use-path? keyword argument.  One annoying thing though
is that since it uses keyword arguments, the first line of the
documentation generated by SCM_DEFINE only mentions "spawn program
. keyword_args".

>> Do we need to add a documentation page as well?
>
> Yes, please.  :-)  I realize I’m asking a lot of things, so let me know
> if you’d like to share the workload somehow.
>
> Doc could go in the “Processes” section, or possibly in a new section
> we’d add right after it, “Spawning Programs”.  We should probably add a
> “@quotation Note” in the doc of ‘primitive-fork’ that briefly explains
> why people should probably use ‘spawn’ rather than fork + exec.

I've opted to put it right below primitive-fork, and slightly rewrite
the part about pipes in primitive-fork's description to also mention
spawn.  Let me know if the documentation is not descriptive enough.

WDYT?
-- 
Josselin Poiret




This bug report was last modified 2 years and 127 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.