This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: fix buffer overrun in natFile.cc
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Subject: Re: PATCH: fix buffer overrun in natFile.cc
- From: Jeff Sturm <jsturm at one-point dot com>
- Date: Wed, 30 May 2001 01:01:03 -0400 (EDT)
- cc: java-patches at gcc dot gnu dot org
On Wed, 30 May 2001, Bryce McKinlay wrote:
> Should we really be using these *_r functions anyway?
Good question. I don't know.
> In glibc I get the impression that they are really only there for
> backwards compatibility,
I haven't looked at glibc's readdir. Certainly it ought to be simple
to do something with thread-local storage.
> Are there really any platforms out there that still don't have threadsafe
> implementations of the "normal" IO routines?
The Solaris 2.7 man page only says "the readdir() function is unsafe in
multithreaded applications". There's not much more detail than that. I
suppose we're forced to trust them.
Of course you could wrap plain readdir() within a mutex and get the same
results with simpler code. I honestly don't care one way or the other, as
long as the SIGBUS goes away :\
Jeff