WinAPI spawn() not used by Cygwin posix_spawn()? Re: [PATCH] Cygwin: Add spawn family of functions to docs
Corinna Vinschen
corinna-cygwin@cygwin.com
Mon Feb 17 10:08:16 GMT 2025
On Feb 16 23:33, Lionel Cons via Cygwin wrote:
> On Sun, 16 Feb 2025 at 22:47, Mark Geisert <mark@maxrnd.com> wrote:
> >
> > In the doc tree, change the title of section "Other UNIX system
> > interfaces..." to "Other system interfaces...". Add the spawn family of
> > functions noting their origin as Windows.
>
> re spawn() family: Cygwin posix_spawn() seems to rely on the rather
> inefficient vfork(), while Opengroup intended it to be an API to
> Windows spawn().
>
> Is there a technical limitation why Cygwin posix_spawn() cannot use
> WinAPI spawn() directly?
The requirements of posix_spawn and their helper functions are so
that we can't easily fulfill them without doing the fork/exec
twist.
See https://man7.org/linux/man-pages/man3/posix_spawn.3.html.
Windows CreateProcess() is not quite the same as Linux clone().
However, if you think you can come up with a version only running the
spawnve function and thus speed up Cygwin, feel free to send patches.
Corinna
More information about the Cygwin-patches
mailing list