[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds pro
From: |
Ludovic Courtès |
Subject: |
bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly |
Date: |
Sun, 25 Dec 2022 17:58:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi Josselin,
Josselin Poiret <dev@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’.
- bug#52835: [PATCH v6 0/3] Move spawning procedures to posix_spawn., (continued)
- bug#52835: [PATCH v6 0/3] Move spawning procedures to posix_spawn., Josselin Poiret, 2022/12/22
- bug#52835: [PATCH v6 1/3] Add spawn*., Josselin Poiret, 2022/12/22
- bug#52835: [PATCH v6 3/3] Move popen and posix procedures to spawn*., Josselin Poiret, 2022/12/22
- bug#52835: [PATCH v6 2/3] Make system* and piped-process internally use spawn., Josselin Poiret, 2022/12/22
- bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly, Ludovic Courtès, 2022/12/23
- bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly, Josselin Poiret, 2022/12/23
- bug#52835: [PATCH v7 1/2] Add spawn* and spawn., Josselin Poiret, 2022/12/23
- bug#52835: [PATCH v7 2/2] Make system* and piped-process internally use spawn., Josselin Poiret, 2022/12/23
- bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly, Ludovic Courtès, 2022/12/25
- bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly, Ludovic Courtès, 2022/12/25
- bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly,
Ludovic Courtès <=