Wait for and/or kill process grandchildren produced by fork

后端 未结 3 1553
被撕碎了的回忆
被撕碎了的回忆 2020-12-20 05:33

I fork() into process X and Y, afterwards Y forks() again into itself and process Z multiple times.

Now process Y is some kind of \"listene

3条回答
  •  鱼传尺愫
    2020-12-20 06:08

    This is not supported. If your sole intent is to prevent the 'Z' processes (i.e., the grandchildren) from turning into zombies, you can use setsid(). If you actually need their exit status, however, you really need to reap them from the 'Y' processes.

提交回复
热议问题