提交 39758662 编写于 作者: O Olivier Brunel 提交者: Rich Felker

getdtablesize: fix returning hard instead of soft rlimit

This makes the result consistent with sysconf(_SC_OPEN_MAX).
上级 c1f4ed15
......@@ -7,5 +7,5 @@ int getdtablesize(void)
{
struct rlimit rl;
getrlimit(RLIMIT_NOFILE, &rl);
return rl.rlim_max < INT_MAX ? rl.rlim_max : INT_MAX;
return rl.rlim_cur < INT_MAX ? rl.rlim_cur : INT_MAX;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册