mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Clifford Wolf <clifford@clifford.at>
To: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: rlim in proc/<pid>/status
Date: Tue, 15 Jan 2008 13:15:06 +0100	[thread overview]
Message-ID: <20080115121503.GA13573@clifford.at> (raw)
In-Reply-To: <20080115194321.119D.KOSAKI.MOTOHIRO@jp.fujitsu.com>

Hi,

On Tue, Jan 15, 2008 at 07:47:22PM +0900, KOSAKI Motohiro wrote:
> sound good for me.
> a few question please.
> 
> > +	for (i=0; i<RLIM_NLIMITS; i++) {
> > +		if (rlim_names[i])
> > +			buffer += sprintf(buffer, "Rlim%s:\t", rlim_names[i]);
> > +		else
> > +			buffer += sprintf(buffer, "Rlim%d:\t", i);
> 
> this else is really necessary?

no. not with the current sources. maybe something like the following would
be better:

#if RLIM_NLIMITS != 15
#  error New RLIM_NLIMITS add mising entries to rlim_names[]
#endif

> > +		if (rlim[i].rlim_cur != ~0)
> > +			buffer += sprintf(buffer, "%lu\t", rlim[i].rlim_cur);
> > +		else
> > +			buffer += sprintf(buffer, "-\t");
> > +		if (rlim[i].rlim_max != ~0)
> > +			buffer += sprintf(buffer, "%lu\n", rlim[i].rlim_max);
> > +		else
> > +			buffer += sprintf(buffer, "-\n");
> 
> Why do you don't use RLIM_INFINITY?

because I'm blind and didn't see it... ;-)

maybe it would also be better to output 'inf' instead of '-' in this case?

yours,
 - clifford

-- 
The number of the beast - vi vi vi.

  reply	other threads:[~2008-01-15 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 10:06 [PATCH] " Clifford Wolf
2008-01-15 10:47 ` KOSAKI Motohiro
2008-01-15 12:15   ` Clifford Wolf [this message]
2008-01-15 20:36 ` [PATCH] " serge
2008-01-16  7:03   ` [PATCH] rlim in proc/<pid>/status (2nd rev.) Clifford Wolf
2008-01-16  7:33     ` KOSAKI Motohiro
2008-01-16 10:04       ` Clifford Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080115121503.GA13573@clifford.at \
    --to=clifford@clifford.at \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®