From: Olivier Brunel Date: Sat, 13 Aug 2016 18:31:49 +0000 (+0200) Subject: getdtablesize: fix returning hard instead of soft rlimit X-Git-Tag: v1.1.16~73 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=397586625e71d166f493f16bfe04f3005ae464c3;p=oweals%2Fmusl.git getdtablesize: fix returning hard instead of soft rlimit This makes the result consistent with sysconf(_SC_OPEN_MAX). --- diff --git a/src/legacy/getdtablesize.c b/src/legacy/getdtablesize.c index 682da6d0..b30c1933 100644 --- a/src/legacy/getdtablesize.c +++ b/src/legacy/getdtablesize.c @@ -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; }