This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: getenv not thread safe
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Paul Orang <orang139 at yahoo dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Mon, 15 Aug 2005 13:49:53 +0200
- Subject: Re: getenv not thread safe
- References: <20050815101657.2559.qmail@web35313.mail.mud.yahoo.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Aug 15, 2005 at 03:16:56AM -0700, Paul Orang wrote:
> http://blogs.sun.com/roller/page/pgdh/20050614 points
> out that glibc getenv is not protected against
> parallel setenvs. Can it be fixed?
getenv is not required to be thread-safe, see
http://www.opengroup.org/onlinepubs/009695399/functions/getenv.html
The string returned by getenv may become invalid after next
setenv/putenv/unsetenv call, so any program relying on thread-safety
of these is broken.
Jakub