This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
Re: NSS and db
> getpwent() function returns a pointer to a structure containing the
> broken-out fields of an entry in the user database. Each entry in
> the user database contains a passwd structure. When
> first called, getpwent() returns a pointer to a passwd structure
> containing the first entry in the user database. Thereafter, it
> returns a pointer to a passwd structure containing the next entry in
> the user database. Successive calls can be used to search the entire
> user database.
>
> Please note the words "first" and "next". I don't think we can return
> them in random order.
I would not interpret this to require a fixed order. Yes, for every
caller, there will be a "first" entry (the one returned from the first
call), and every subsequent call returns a different entry (one that
was not returned before).
Suppose you were to phrase this feature (first call initializes,
subsequent calls iterate) in a specification. Wording it as "returns
the database in order" is the most natural way, even though it
apparently leaves room to mis-interpretation: it could be taken as
requiring the same order for every caller.
Regards,
Martin
- References:
- NSS and db
- From: Marcus Harnisch <marcus@harnisch.isdn.cs.tu-berlin.de>
- Re: NSS and db
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>