Re: jdk build fails due to "warning: ‘readdir_r’ is deprecated"
fweimer at redhat.com
Mon Apr 30 10:37:32 UTC 2018
On 04/05/2018 03:14 PM, David Holmes wrote:
> Sure, but "generally unnecessary in multithreaded programs" doesn't
> quite cut it when it comes to correctness. So we have a couple of
> obscure cases where readdir_r may do the wrong thing and we have a
> subset of cases where readdir may be thread-safe "enough"; and hopefully
> one day POSIX will specify it as thread-safe and all will be well in world.
> Until such time as that happens IMHO we stick with the code we that
> seems to be working perfectly fine and disable the warning.
readdir_r does not work reliably on SMB mounts on GNU/Linux. If you use
it, you have a real bug.
readdir_r was introduced to deal with systems which implement opendir as
a cast of the file descriptor to a DIR *, without allocating anything.
Such systems do not exist anymore, and they certainly do not run OpenJDK.
More information about the build-dev