GNU bug report logs -
#52835
[PATCH 0/2] Fix spawning a child not setting standard fds properly
Previous Next
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
View this message in rfc822 format
Hi Josselin,
Josselin Poiret <dev <at> jpoiret.xyz> skribis:
> I've added a convenience module (ice-9 spawn) with a `spawn` procedure
> in it, which takes an optional argument list which defaults to just the
> executable, and optional environment variables as well as in, out and
> err ports. I also think everything in (ice-9 popen) should be migrated
> on the next major release, as well as being re-implemented in terms of
> `spawn` purely, so that the change is immediately noticeable.
OK.
> We're reaching the bike-shedding time now, but IMHO having such a
> `spawn*` exposed to the user seems fine, it's a pretty simple "raw"
> interface with fdes, and there is a convenience `spawn` function that is
> nicer for users.
‘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.
> 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.
Some cosmetic suggestions follow…
Thanks,
Ludo’.
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.