Recursive Fibonacci using Fork (in C)

本秂侑毒 提交于 2019-12-04 05:40:28

1) Call waitpid twice.

2) The waitpid call will put it in status.

3) Two things: First, to terminate a forked process, use _exit, not exit. The exit function can mess up file descriptors that the parent is still using. It doesn't matter in your case, but why learn bad habits? Second, you don't need the else if (pid2 > 0) clause. That's all that's left.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!