免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: socay2
打印 上一主题 下一主题

[C] exec 后,地址空间的疑惑 [复制链接]

论坛徽章:
1
程序设计版块每日发帖之星
日期:2015-10-21 06:20:00
1 [报告]
发表于 2012-12-17 16:54 |显示全部楼层
@folklore 解答的信息量太少。

怎么能把fork的100m 变成1k ? 拷贝页表是怎么搞定的?

牛儿们,再不来,我就开始吹啦。

论坛徽章:
1
程序设计版块每日发帖之星
日期:2015-10-21 06:20:00
2 [报告]
发表于 2012-12-17 23:41 |显示全部楼层
本帖最后由 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:}

论坛徽章:
1
程序设计版块每日发帖之星
日期:2015-10-21 06:20:00
3 [报告]
发表于 2012-12-18 08:55 |显示全部楼层
@socay2擦,真刻苦。

你看的那段,好像有个前提就是fork 后 exec 。。。 对也不对?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP