提交 3ec82877 编写于 作者: N Natanael Copa 提交者: Rich Felker

fix sysconf for infinite rlimits

sysconf should return -1 for infinity, not LONG_MAX.
上级 13127680
......@@ -174,6 +174,8 @@ long sysconf(int name)
} else if (values[name] < -256) {
struct rlimit lim;
getrlimit(values[name]&16383, &lim);
if (lim.rlim_cur == RLIM_INFINITY)
return -1;
return lim.rlim_cur > LONG_MAX ? LONG_MAX : lim.rlim_cur;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册