RFR: JDK-8286869: unify os::dir_is_empty across posix platforms

Matthias Baesken mbaesken at openjdk.java.net
Wed May 18 07:05:57 UTC 2022


On Wed, 18 May 2022 06:44:13 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> The os::dir_is_empty coding is very similar across Posix platforms and could be unified to os_posix.cpp .
>
> src/hotspot/os/posix/os_posix.cpp line 260:
> 
>> 258:   // Scan the directory
>> 259:   bool result = true;
>> 260:   while (result && (ptr = readdir(dir)) != NULL) {
> 
> This will call `os::readdir` when we can just call `::readdir` directly.

Hi David , so do you suggest to use ::readdir instead ? What about opendir and closedir, should we use as well ::opendir and ::closedir ?

-------------

PR: https://git.openjdk.java.net/jdk/pull/8750


More information about the hotspot-runtime-dev mailing list