Subject: bug#63826: Posix Spawn on MinGW

From: Mike Gran <[email-masked]>
Date: Thu, 1 Jun 2023 07:27:26 -0700

The recent addition of the posix_spawn gnulib module raises the
possibility of getting this functionality to work on MinGW, since the
gnulib module provides portability to MinGW and friends.

The first step is to remove the HAVE_FORK ifdefs where unnecessary in
posix.c, since piped_process() does not use fork.  This will allow the
functions to be exported.

Guile's homegrown waitpid in posix-w32.c is apparently not compatible
with gnulib's posix_spawn since they use different stores for PIDs and
process handles. The gnulib waitpid will need to be imported and
Guile's custom waitpid removed.

Also, various hardcodings of "/bin/sh" and "/dev/null" will need
workarounds.

If it could be made to work, it would still not function identically
to how it functions on GNU/Linux because of the different shell, but
we already accepted such divergence previously when 'system*' used the
start_child from Guile's posix-w32.c

-Mike Gran