Subject: Re: getpw*_r standards
To: Klaus Klein <kleink@mibh.de>
From: Luke Mewburn <lukem@NetBSD.org>
List: current-users
Date: 04/19/2005 09:57:31
--qJM7dOmrnYWq+SaN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Tue, Apr 19, 2005 at 01:36:15AM +0200, Klaus Klein wrote:
| > AFAICT, Klaus & Nathan are recommending that getpwnam_r():
| > * return 0 and set result to NULL for "notfound", and
| > * return errno (!0) and set result to NULL for "error".
| > If I have understood that correctly, we can change get{pw,gr}*_r()
| > to do this.
|=20
| That's correct as far as I'm concerned.
|=20
| > 2.0's getpwnam() returns NULL in both the "not found" and "error"
| > case, and in both cases errno is indeterminately set depending
| > on what the back-end modules (files, nis, dns, ...) do.
| > -current's getpwnam() has the same behaviour.
|=20
| I tried my little experiment in a simple files back-end environment
| only (I didn't have any other 2.0 setup at hand, but OTOH that
| configuration is what one would expect to be as close as it can
| still get to "traditional" behavior given code reuse in the
| back-end). However, the spec applies the same way here: There
| should be no "error" indication (as in touching errno) for
| "notfound".
Ok.
| But given nsdispatch()'s callback return values it should be easy to
| distinguish between that and "error", shouldn't it?
Yes.
Thanks,
Luke.
--qJM7dOmrnYWq+SaN
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)
iD8DBQFCZElqpBhtmn8zJHIRAkUrAJ0SPoEIZKHcTV6jmty+fXm6mjKDEACgv/uj
vOJYJs7dqSwU4aeWj5qAgZE=
=QqBg
-----END PGP SIGNATURE-----
--qJM7dOmrnYWq+SaN--