免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2311 | 回复: 2

[C] 关于setrlimit的问题~ [复制链接]

论坛徽章:
0
发表于 2013-04-24 16:19 |显示全部楼层
在程序中先用了getrlimit,然后用 setrlimit 设置,然后再用 getrlimit 查看设置成功。为什么再运行一个这个程序的实例,执行第一个getrlimit后,发现前面那个实例的设置在这个实例无效?

论坛徽章:
1
申猴
日期:2013-09-09 10:22:56
发表于 2013-04-25 11:32 |显示全部楼层
man setrlimit


NOTES
       A child process created via fork(2) inherits its parent's resource limits.  Resource limits are preserved across execve(2).

       One can set the resource limits of the shell using the built-in ulimit command (limit in csh(1)).  The shell's resource limits are inherited
       by the processes that it creates to execute commands.

also see http://bbs.chinaunix.net/thread-4078132-1-2.html

论坛徽章:
1
白羊座
日期:2013-09-18 22:02:26
发表于 2013-04-25 12:21 |显示全部楼层
子进程可以继承。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP