diff options
author | Olivier Brunel <jjk@jjacky.com> | 2016-08-13 20:31:49 +0200 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2016-08-30 16:15:22 -0400 |
commit | 397586625e71d166f493f16bfe04f3005ae464c3 (patch) | |
tree | 5f3dd455abbf838e81e242780469516996da05c1 | |
parent | c1f4ed150137d793c9d07356305a89e8785e7e02 (diff) | |
download | musl-397586625e71d166f493f16bfe04f3005ae464c3.tar.gz musl-397586625e71d166f493f16bfe04f3005ae464c3.tar.bz2 musl-397586625e71d166f493f16bfe04f3005ae464c3.tar.xz musl-397586625e71d166f493f16bfe04f3005ae464c3.zip |
getdtablesize: fix returning hard instead of soft rlimit
This makes the result consistent with sysconf(_SC_OPEN_MAX).
-rw-r--r-- | src/legacy/getdtablesize.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |