Subject: Re: Making file-based getXent quicker
To: Darren Reed <>
From: Luke Mewburn <>
List: tech-userlevel
Date: 03/20/2006 10:42:35
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Mar 19, 2006 at 08:41:14PM +0000, Darren Reed wrote:
  | In a discussion about how NetBSD opens and closes nls files way too
  | often, it was brought up that there are similar problems with the
  | name-number files like /etc/services and /etc/protocols.
  | So the problem is, what to do about it?  How can they be made quicker?

Have you profiled that these are a problem?

  | [...]
  | But in a local files approach, I can see the following being cached:
  | /etc/services
  | /etc/protocols
  | /etc/hosts
  | /etc/passwd
  | /etc/rpc

For /etc/passwd, getpwent(3) (et al) already use a db(3) database.

There's no reason we can't consider /etc/services.db (etc)
and implement an nsswitch "db" database lookup for these.
We have db(1) to easily create db(3) files.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.4.2.2 (NetBSD)