From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10377 Path: news.gmane.org!.POSTED!not-for-mail From: Olivier Brunel Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] getdtablesize: Fix returning hard instead of soft rlimit Date: Sat, 13 Aug 2016 21:36:13 +0200 Message-ID: <20160813213613.3e5c068c@jjacky.com> References: <20160813183149.6886-1-jjk@jjacky.com> <20160813192501.GE15995@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1471117080 32211 195.159.176.226 (13 Aug 2016 19:38:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2016 19:38:00 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-10390-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 13 21:37:57 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bYekk-0008Db-L5 for gllmg-musl@m.gmane.org; Sat, 13 Aug 2016 21:37:54 +0200 Original-Received: (qmail 5452 invoked by uid 550); 13 Aug 2016 19:37:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5425 invoked from network); 13 Aug 2016 19:37:52 -0000 In-Reply-To: <20160813192501.GE15995@brightrain.aerifal.cx> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.30; x86_64-unknown-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:10377 Archived-At: On Sat, 13 Aug 2016 15:25:02 -0400 Rich Felker wrote: > On Sat, Aug 13, 2016 at 08:31:49PM +0200, Olivier Brunel wrote: > > --- > > src/legacy/getdtablesize.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/legacy/getdtablesize.c b/src/legacy/getdtablesize.c > > index 682da6d..b30c193 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; > > Is there a motivation for this? > > Rich Well, I found this running tests for findutils, and having a couple failing because of it. I'm not sure about possible implications/issues it could cause in the actual tools, was only trying to get the tests to pass (and things to work as expected), but I wasn't facing an "actual" issue/bug, if that was the question.