This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: NGROUPS_MAX in linux 2.6.3+


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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)

iD8DBQFAPFl/2ijCOnn/RHQRApK6AJ0dR9opUQtxk5A7uDCFT27nTHWgGACfYx2z
7vDTbAGM4Tdtke34v/LPWzs=
=vqDu
-----END PGP SIGNATURE-----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]