RFR: 8187667: Disable deprecation warning for readdir_r

Stefan Johansson stefan.johansson at oracle.com
Thu Sep 21 09:12:36 UTC 2017



On 2017-09-19 14:42, Erik Helin wrote:
> 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/
>
Looks good,
StefanJ
> 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