This is the mail archive of the
mailing list for the glibc project.
Re: NGROUPS_MAX in linux 2.6.3+
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Andreas Jaeger <aj at suse dot de>
- Cc: thockin at sun dot com, "GNU C. Library" <libc-alpha at sources dot redhat dot com>
- Date: Wed, 25 Feb 2004 00:14:55 -0800
- Subject: Re: NGROUPS_MAX in linux 2.6.3+
- Organization: Red Hat, Inc.
- References: <20040219212025.GE9155@sun.com> <20040224223909.GJ18498@sun.com> <firstname.lastname@example.org>
-----BEGIN PGP SIGNED MESSAGE-----
Andreas Jaeger wrote:
> The problem I see with your patch, is that there seems to be no
> fallback for the case where you compile this with kernel headers that
> define KERN_NGROUPS_MAX but do run it on an older kernel. Check how
> we do this with kernel-features.h,
That's not the only problem.
More critical is that, according to Arjan, numeric sysctl() calls are
deprecated. There isn't yet a replacement which takes strings so you'll
have to use /proc/sys/kernel/....
So, rewrite the code to use open+read+strtol (don't even thing about
fopen+fscanf). Replace the default case with a simple break, move the
posix_sysconf call to the end of the function, and return from the
special NGROUPS handling only if reading the file was successful.
Otherwise fall through to the posix_sysconf call. Oh, and since you'll
use /proc there is no need for any #ifdef.
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
-----END PGP SIGNATURE-----