This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Usage of strerror in natFileDescriptor.cc


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]