Manual update for get.*_r functions
Thorsten Kukuk
kukuk@suse.de
Wed Jun 30 14:03:00 GMT 1999
On Wed, Jun 30, Ulrich Drepper wrote:
> Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:
>
> > I've checked POSIX and my understanding of POSIX is that the check for
> > NULL is necessary.
>
> POSIX says:
>
> If successful, the getpwuid_r() and getpwnam_r() functions shall
> return zero. Otherwise, an error number shall be returned to
> indicate the error.
>
>
> I.e., the return value is != 0 in all error cases and no found entry
> is an error case.
No, no found entry is not an error case.
I don't have a copy of POSIX, but what I have read is, that the
pointer is NULL if there is an error or we couldn't find the entry.
All texts I have read about this mentions explicitly both cases.
And only if there is an error we return the error code. Not if
we doesn't found the entry.
Thorsten
--
Thorsten Kukuk http://www.suse.de/~kukuk/ kukuk@suse.de
SuSE GmbH Schanzaeckerstr. 10 90443 Nuernberg
Linux is like a Vorlon. It is incredibly powerful, gives terse,
cryptic answers and has a lot of things going on in the background.
More information about the Libc-hacker
mailing list