c - posix_spawn Linux: How to make children processes not enter zombie state when terminating -


I have a process that raises the other process with posix_spawn (). When children are in the process of self-termination, they enter zombie state, as is the default expected behavior. I want to finish them altogether but I can not get it through the use of Pausx_spontra_setfag (). Maybe I'm not using the correct flag Who knows how to do this?

Initially, I would like to have a complete separation of children and procedures for separation from the original process.

By default, either exit () or _exit To change the status of the calling process to call () , you can use the sigaction () to change its parent if they are still alive:

  #include & lt; Signal.h & gt; Struct sigaction arg = {.sa_handler = SIG_IGN, .sa_flags = SA_NOCLDWAIT // Never wait for the end of hair process}; Signation (SIGLLD, and AGR, Faucet);  

After writing the above code in the maternal process, it will never wait for a child, and after the child is finished, they will go to the terminated state instead of zombie.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -