jdk8u-dev Digest, Vol 90, Issue 20

Kate Fox kate.fox at komprise.com
Sat May 15 16:14:52 UTC 2021


Date: Fri, 14 May 2021 14:43:31 +0100
From: Andrew Haley <aph at redhat.com<mailto:aph at redhat.com>>
To: jdk8u-dev at openjdk.java.net<mailto:jdk8u-dev at openjdk.java.net>
Subject: Re: JDK-8226245 readdir implementation
Message-ID: <9eb202bf-c807-010f-7486-3d7ab7d476bf at redhat.com<mailto:9eb202bf-c807-010f-7486-3d7ab7d476bf at redhat.com>>
Content-Type: text/plain; charset=utf-8

On 5/12/21 10:00 PM, Kate Fox wrote:
According to https://bugs.openjdk.java.net/browse/JDK-8226245 I think the usage of readdir_r has been switched over to use readdir instead?

I checked build 1.8.0_292-b10 and it still uses readdir_r.

I can't see it. Please point to the exact lines you mean.

Here is the code from UnixNativeDispatcher.c:

JNIEXPORT jbyteArray JNICALL
Java_sun_nio_fs_UnixNativeDispatcher_readdir(JNIEnv* env, jclass this, jlong value) {
...
    res = readdir64_r(dirp, ptr, &result);

It is using readdir64_r — which can’t find all the files in a directory when there are long file names with multibyte characters.  I confirmed that Java 11 is using the plain readdir and doesn’t have this problem.  It looked like https://bugs.openjdk.java.net/browse/JDK-8226245 was a back port but it doesn’t seem like the implementation of this readdir call was changed.

Is there any plans to do this back port?  Really need this change.

Thank you,

Kate




More information about the jdk8u-dev mailing list