RFR: 8187667: Disable deprecation warning for readdir_r

Erik Helin erik.helin at oracle.com
Tue Sep 19 12:42:49 UTC 2017


Hi all,

I'm continuing to run into some small problems when compiling HotSpot 
with a more recent toolchain. It seems like readdir_r [0] has been 
deprecated beginning with glibc 2.24 [1]. In HotSpot, we use readdir_r 
for os::readdir on Linux (defined in os_linux.inline.hpp). Since 
readdir_r most likely will stay around for a long time in glibc (even 
though in deprecated form), I figured it was best to just silence the 
deprecation warning from gcc. If readdir_r finally is removed one day, 
then we might have to look up the appropriate readdir function using 
dlopen, dlsym etc.

Patch:
http://cr.openjdk.java.net/~ehelin/8187667/00/

Bug:
https://bugs.openjdk.java.net/browse/JDK-8187667

Testing:
- Compiles with:
   - gcc 7.1.1 and glibc 2.25 on Fedora 26
   - gcc 4.9.2 and glibc 2.12 on OEL 6.4
- JPRT

Thanks,
Erik

[0]: http://pubs.opengroup.org/onlinepubs/009695399/functions/readdir.html
[1]: https://sourceware.org/bugzilla/show_bug.cgi?id=19056


More information about the hotspot-dev mailing list