RFR: 8356127: (fs) UnixFileSystemProvider.implDelete could save a syscall in some cases

Brian Burkhalter bpb at openjdk.org
Thu May 8 17:33:53 UTC 2025


On Thu, 8 May 2025 07:14:42 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> I think this will need to be predicated on a capability (UnixNativeDispatcher.SUPPORTS_xxx) so that it only unconditionally attempts unlink on Linux or other operating systems that document EISDIR.

It looks like this would have to be hard-coded as a function of the OS. The following obtains on macOS:

$ cat eisdir.c
#include <errno.h>
#include <stdio.h>

int main(int argc, char** argv)
{
    printf("EISDIR: %d\n", EISDIR);
}
$ ./eisdir 
EISDIR: 21

This shows that macOS defines `EISDIR` to be the POSIX value 21.

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

PR Comment: https://git.openjdk.org/jdk/pull/25107#issuecomment-2863782711


More information about the nio-dev mailing list