Subject: Re: CVS commit: [elad-kernelauth] src/sys/kern
To: None <elad@NetBSD.org>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: source-changes
Date: 03/12/2006 23:10:55
> David Laight wrote:
> 
> > Are you really sure you want to replace a memcmp() with an O(n^2) operation ?
> 
> I'll elaborate some more...
> 
> kauth(9) sorts the group on its own, so we could make that a binary
> search, improving performance a bit.
> 
> But using memcmp() will treat the groups associated with the credentials
> as a block of memory, while they're not guaranteed (in the future) to be
> one.

as far as you hide it by a sane api, there's nothing wrong with
using memcmp (or memcmp-like loop which compares each gids) internally.

btw, i think the name "kauth_cred_compare" should be reserved for
a function which compares two kauth_cred_t. :-)

YAMAMOTO Takashi