Subject: Re: bug#52835: [PATCH 0/2] Fix spawning a child not setting standard fds properly

From: Ludovic Courtès <[email-masked]>
Date: Thu, 12 Jan 2023 23:02:15 +0100

Hi Josselin, and a happy new year full of good hacks!  :-)

Josselin Poiret <[email-masked]> skribis:

> 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".

That’s OK.

> 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.

It looks good to me.

A few suggestions of mine got lost, so I pushed a new ‘wip-posix-spawn’
with additional commits taking those into account and adding tests.  The
changes in this v8.1 are:

  - make 'arguments' positional rather than keyword
  - rename keyword arguments to avoid abbreviations
  - add example in the manual
  - mark 'scm_spawn_process' as SCM_INTERNAL
  - add tests

Because this is now a core binding and no longer in (ice-9 spawn), I
hope ‘spawn’ is not clashing with someone else’s library, though the
worst that could happen is a run-time warning “module X overrides core
binding 'spawn'”.

I’m very pleased with the branch and could finally merge if you agree!
(I’ll put myself as co-author and take the blame for half of the bugs.
:-))

Ah yes, one thing that came to mind: we could change #:input #f to mean
“close file descriptor 0”, and so on.  Let’s first merge this, though.

Thoughts?

Ludo’.