_EDC_POPEN

Sets the behavior of the popen() function. When the value of _EDC_POPEN is set to FORK, popen() uses fork() to create the child process. When the value of _EDC_POPEN is set to SPAWN, popen() uses spawn() to create the child process. If the value of _EDC_POPEN is not set, the default behavior is for popen() to use fork() to create the child process.

The _EDC_POPEN environment variable can be set with the function
setenv("_EDC_POPEN","SPAWN", 1);