What is the difference between using _exit() & exit() in a conventional Linux fork-exec?

前端 未结 4 1744
梦谈多话
梦谈多话 2020-11-29 21:54

I\'ve been trying to figure out how the fork-exec mechanism is used inside Linux. Everything was going on according to the plan until some web pages started to confuse me.<

4条回答
  •  佛祖请我去吃肉
    2020-11-29 22:35

    In the child branch of a fork(), it is normally incorrect to use exit(), because that can lead to stdio buffers being flushed twice, and temporary files being unexpectedly removed.

    Excerpted from: http://www.unixguide.net/unix/programming/1.1.3.shtml

提交回复
热议问题