- 论坛徽章:
- 1
|
本帖最后由 moxies 于 2012-12-17 23:51 编辑
http://en.wikipedia.org/wiki/Fork-exec 看这个文章,同时还说了点别的,摘录如下:
When the child process calls exec(), all data in the original program is lost, and replaced with a running copy of the new program. This is known as overlaying. Although all data are replaced, the file descriptors that were open in the parent are closed only if the program has explicitly marked them close-on-exec. This allows for the common practice of the parent creating a pipe prior to calling fork() and using it to communicate with the executed program.
http://www.chinaunix.net/old_jh/23/62446.html 咱cu上也有过分析。没看过的同学。都来看看。{:3_189:}
|
|