From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29162 invoked by alias); 25 Jun 2014 11:00:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32798 Received: (qmail 3344 invoked from network); 25 Jun 2014 11:00:13 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.2 Date: Wed, 25 Jun 2014 13:00:11 +0200 From: Thomas Klausner To: Peter Stephenson Cc: zsh-workers@zsh.org Subject: Re: ulimit -a: -r vs -N [was Re: pkgsrc patches for zsh] Message-ID: <20140625110010.GQ13765@danbala.tuwien.ac.at> References: <20120817121605.GD2428@danbala.tuwien.ac.at> <20140624143711.GG13765@danbala.tuwien.ac.at> <20140624160708.6bef4d2c@pwslap01u.europe.root.pri> <20140624161102.GJ13765@danbala.tuwien.ac.at> <20140624172642.61b422e0@pwslap01u.europe.root.pri> <20140624170908.GK13765@danbala.tuwien.ac.at> <20140625092659.3e084cc7@pwslap01u.europe.root.pri> <20140625083655.GP13765@danbala.tuwien.ac.at> <20140625113335.2a2675cd@pwslap01u.europe.root.pri> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140625113335.2a2675cd@pwslap01u.europe.root.pri> On Wed, Jun 25, 2014 at 11:33:35AM +0100, Peter Stephenson wrote: > I've added compatibility with sh when NTHR is present and RTPRIO isn't > --- which should be just about specific enough that the additional > compatibility more than offsets any confusion. Thanks, but this version doesn't compile since: rlimits.c: In function 'printulimit': rlimits.c:398:5: error: duplicate case value case RLIMIT_NTHR: ^ rlimits.c:379:5: error: previously used here case RLIMIT_PTHREAD: ^ *** Error code 1 > @@ -387,6 +392,14 @@ printulimit(char *nam, int lim, int hard, int head) > if (head) > printf("-r: max rt priority "); > break; > +# else > +# ifdef HAVE_RLIMIT_NTHR > + /* For compatibility with sh on NetBSD */ > + case RLIMIT_NTHR: > + if (head) > + printf("-r: threads "); > + break; > +# endif /* HAVE_RLIMIT_NTHR */ > # endif /* HAVE_RLIMIT_RTPRIO */ > # ifdef HAVE_RLIMIT_NPTS > case RLIMIT_NPTS: The #else here is for RTPRIO, so we have cases for RLIMIT_NTHR and RLIMIT_PTHREAD in the same case statement. Thomas