This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
posix_spawn and vfork
- From: Florian Weimer <fweimer at redhat dot com>
- To: libc-alpha at sourceware dot org
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Date: Thu, 02 May 2019 14:18:43 +0200
- Subject: posix_spawn and vfork
Why do we use clone instead of vfork in posix_spawn?
I think we could use vfork and a call to a separate function for the
subprocess code, as a compiler barrier, and therefore avoiding stack
clobbering issues.
As a result, we can reuse the existing stack and would not have to
allocate a new one.
If this reasoning is incorrect, I'll gladly write up the explanation as
a new comment for sysdeps/unix/sysv/linux/spawni.c.
Thanks,
Florian