Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Dec 2000 02:56:16 -0600 (CST)
From:      Mike Meyer <mwm@mired.org>
To:        Dmitry Karasik <dk@plab.ku.dk>
Cc:        questions@freebsd.org
Subject:   Re: NGROUPS_MAX in sys/syslimits.h
Message-ID:  <14891.23600.60352.296277@guru.mired.org>
In-Reply-To: <121570471@toto.iv>

next in thread | previous in thread | raw e-mail | index | archive | help
Dmitry Karasik <dk@plab.ku.dk> types:
>    I recently found myself in "too many groups", as LIBC complains;
> I found that somehow that if I present in more than in 16 groups ( what
> is exactly that value of NGROUPS_MAX in sys/syslimits.h), I run into
> problems. Well, first thing that popped out was to recompile LIBC, and maybe
> I'll do that (later), but I'm just curious - how come that 16 is a limit?
> Didn't anyone before run into this "implementation flaw"? Or, maybe, there
> exists some better solution?

Yup, I ran into it the first time I wanted to use a BSD that supported
multiple group memberships in a commercial environment. We wanted
~100s of groups per user. Contemplating the effect that changing
NGROUPS_MAX to that would have on kernel memory usage made me go look
for a better solution (and I found one).

It exists for the same reason hard limits exist in so many other
places - because Unix was written when machines were much smaller and
slower (I was once at a site that ran into a bug with Unix if you put
more than 256K or so in a machine), and it was faster and more space
efficient just to set up a hard limit than to implement a linked list
for this case. It's still there because nobody who has the time,
inclination and talent to fix it has ever been hit by the limit in
such a way as to make fixing it a reasonable solution.

Which begs the question - why do you need so many groups? There may be
a better solution to the problem that's causing that than kernel
groups.

	<mike
--
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Unix/FreeBSD consultant,	email for more information.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14891.23600.60352.296277>