[Bug c++/85226] system() gives pid 0 and doesn't launch the command

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Apr 5 11:43:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85226

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
system is not part of GCC anyway, so this is the wrong place to report problems
with it, but the answer is simple: system doesn't return a PID. It runs the
command, waits for it to finish (so the child PID is no longer valid anyway)
and then returns the "wait status" from the child as if by waitpid.


More information about the Gcc-bugs mailing list