public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Hockin <thockin@hockin.org>
To: Glen Turner <glen.turner@aarnet.edu.au>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PATCH: report NGROUPS_MAX via a sysctl (read-only)
Date: Tue, 24 Feb 2004 17:14:51 -0800	[thread overview]
Message-ID: <20040225011451.GA29101@hockin.org> (raw)
In-Reply-To: <1077670767.24730.51.camel@andromache>

On Wed, Feb 25, 2004 at 11:29:27AM +1030, Glen Turner wrote:
> The mere existence of the value means it can be used correctly
> in application code for sanity checking.

Andrew seems to have picked it up for -mm.  I sent a patch to glibc-bugs (is
that the right place?  any libc folk?) to use the new sysctl in
sysconf(_SC_NGROUPS_MAX).  So if/when all those releases converge, you
should be able to get the kernel's idea of NGROUPS_MAX from
sysconf(_SC_NGROUPS_MAX);

> Returning INT_MAX for NGROUPS_MAX isn't wrong, but you
> then can't blame user space for making inefficient choices
> if the kernel limit is actually smaller.

Well, if the kernel HAS no limit, then NGROUPS_MAX really is INT_MAX.  There
are not many legit uses I can think of for userspace to actually care about
NGROUPS_MAX.  Just the current number of groups, which is easily gotten via
setgroups().

Now that the sysctl is in, it's a very tiny patch to make ngroups_max
actually raisable/ by sysctl, though it is debatable whether it is useful AT
ALL, and dubious whether it is safe to lower that value after any apps are
running.

-- 
Tim Hockin
thockin@hockin.org
Soon anyone who's not on the World Wide Web will qualify for a government 
subsidy for the home-pageless.

  reply	other threads:[~2004-02-25  1:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-20  2:39 PATCH: report NGROUPS_MAX via a sysctl (read-only) Tim Hockin
2004-02-20  5:30 ` Andrew Morton
2004-02-20  6:35   ` Tim Hockin
2004-02-20  6:47     ` Andrew Morton
2004-02-20  7:10       ` Tim Hockin
2004-02-25  0:59         ` Glen Turner
2004-02-25  1:14           ` Tim Hockin [this message]
2004-02-25  7:32             ` Ulrich Drepper

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=20040225011451.GA29101@hockin.org \
    --to=thockin@hockin.org \
    --cc=glen.turner@aarnet.edu.au \
    --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