PATCH: fix buffer overrun in natFile.cc

Jeff Sturm jsturm@one-point.com
Tue May 29 21:46:00 GMT 2001


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



More information about the Java-patches mailing list