in reply to How does system(1,"foo") work on Windows?

So -- how does system(1,"foo") work on Windows?

It just calls CreateProcess with the CREATE_NEW_PROCESS_GROUP flag bit set. See Win32::Process for the details.

It's a bit more complicated as it has to arrange for wait and waitpid to work.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
  • Comment on Re: How does system(1,"foo") work on Windows?

Replies are listed 'Best First'.
Re^2: How does system(1,"foo") work on Windows?
by toughy (Acolyte) on Nov 02, 2018 at 19:24 UTC

    Do you know why CREATE_NEW_PROCESS_GROUP flag is used ? It is a problem because child processes no longer respond to Ctrl+C, while the main script does. Then the main script exits on keyboard interrupt, but child processes linger in the background where no onne can see them.