Subject: Re: getpwent(3) funcs return static structure
To: Rick Byers <rickb@iaw.on.ca>
From: Johan Danielsson <joda@pdc.kth.se>
List: current-users
Date: 03/02/1997 03:06:18
Rick Byers <rickb@iaw.on.ca> writes:
> Shouldn't it atleast be mentioned in the man pages?
getpwent(3):
BUGS
The functions getpwent(), getpwnam(), and getpwuid(), leave their results
in an internal static object and return a pointer to that object. Subse-
quent calls to the same function will modify the same object.
The right thing to do is to use the thread-safe getpw*_r(), that
unfortunately aren't available in NetBSD.
/Johan