Question about libjava/childproc.c

Alan Bateman Alan.Bateman at
Sun Sep 9 08:04:44 UTC 2018

On 09/09/2018 01:34, Martin Buchholz wrote:
> :
> See discussion in src/java.base/unix/native/libjava/ProcessImpl_md.c
>     Later Oracle introduced something very similar with the jspawnhelper.
>     But I see that jspawnhelper is not used at all for the vfork() case,
>     just for posix_spawn(), yes?
> Implemented by other folks.  I was mostly happy with vfork.  I forget 
> the motivation to introduce jspawnhelper, but I'm sure it's in the 
> fossil record somewhere!
jpsawnhelper is to deal with chdir and threading issues that arise when 
using posix_spawn. The move to posix_spawn was motivated by eager 
allocation of swap when using fork. It was originally done for Solaris, 
then macOS, and I see the AIX implementation is declared to use 
posix_spawn too. Linux is using vfork and seems to be stable. Martin 
will probably remember a brief foray into clone(CLONE_VM) at one point 
but that didn't work out.


More information about the core-libs-dev mailing list