[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zmailer getpw* routines



> In lib/pwdgrp.c, it says:
> /*
>  * We implement getpwnam(), getpwuid(), and getgrnam() using the primitive
>  * iteration functions (*ent()), in order to avoid constant allocations and
>  * frees of fgets() buffers when the normal *nam() routines clean up after
>  * finding what they're looking for.  This will lose if we're using a database
>  * with slow iteration, but that can be handled elsewhere.
>  */
> 
> Is it really "handled elsewhere"?  This looks like a classic time/space
> tradeoff, but we can afford neither the time nor the space.

  I haven't found for sure, however using NIS -flavoured versions of this
might do some good.  That kind of version does use NIS-hash-tables for
reading names, etc, and is a lot faster than linear parsing even with
possible cache..

	/Matti Aarnio <mea@nic.funet.fi>