This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Usage of strerror in natFileDescriptor.cc
- From: Andrew Haley <aph at redhat dot com>
- To: Mark Wielaard <mark at klomp dot org>
- Cc: java at gcc dot gnu dot org
- Date: Mon, 20 Oct 2003 15:10:42 +0100
- Subject: Usage of strerror in natFileDescriptor.cc
- References: <1066400355.1050.26.camel@localhost>
Mark Wielaard writes:
> Hi,
>
> While reading natFileDescriptor.cc I noticed the use of strerror(). Is
> this funtion thread save?
No.
> All calls are wrapped in a JvNewStringLatin1() call so this might
> be save, but it seems there might be a small opertunity for a race
> to occur when called from two threads at the same time.
Indeed. strerror_r() exists, but it is a GNU extension. I suppose
we'd have to check for its existence.
Andrew.