RFR: 8338851: Hoist os::Posix::realpath() to os::realpath() and implement on Windows [v2]

Simon Tooke stooke at openjdk.org
Thu Sep 12 13:56:43 UTC 2024


On Wed, 11 Sep 2024 14:43:24 GMT, Simon Tooke <stooke at openjdk.org> wrote:

>> src/hotspot/os/windows/os_windows.cpp line 5330:
>> 
>>> 5328:   if (result == nullptr) {
>>> 5329:     errno = ENAMETOOLONG;
>>> 5330:   }
>> 
>> This is a bit of an assumption. What if the name "includes a drive letter that isn't valid or can't be found"? Unfortunately Windows doesn't specify any further details beyond returning null.
>
> I probably cleaned up this code too much, and should've left it more like the Posix implementation.  
> What I used to have would do one call (with buffer NULL) to get the real full path, then copy it if it fit or ENAMETOOLONG.  In attempting to speed up the code I changed the semantics.  I will change this code back to my previous implementation

changed code to test for ENAMETOOLONG.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20683#discussion_r1756922180


More information about the serviceability-dev mailing list