getdtablesize: fix returning hard instead of soft rlimit
This makes the result consistent with sysconf(_SC_OPEN_MAX).
This commit is contained in:
1 parent
c1f4ed1501
commit
397586625e
1 file changed
+1
-1
@@ -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;
|
||||
}
|
||||
Reference in new issue
Block a user