8220793: (fs) No support for changing modification time of symlink

Brian Burkhalter brian.burkhalter at oracle.com
Mon Apr 22 18:19:00 UTC 2019


> On Apr 22, 2019, at 12:36 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 19/04/2019 01:24, Brian Burkhalter wrote:
>> For issue [1] please review the patch [2]. It implements setting the access and modification times of an unfollowed symbolic link on Linux and macOS.
>> 
>> The patch uses the library function lutimes(3). The supported Unix platforms for lutimes() appear to be Linux and the BSDs, but neither Solaris (verified) nor AIX. Therefore the native function lutimes0() is a no-op for Unix platforms other than Linux and the BSDs.
>> 
> I'm in two minds on this, mostly because it should be very rare to want to change the the time stamps of a symbolic link.
> 
> In any case, can you double check setTimes - I assume it should not attempt to open the file when lutimes is available and the file is a sym link.

It will only if just one of the times is being modified (lines 99-111).

Also I neglected to put it in the retry section (lines 136-148) and that should likely be added.

> In passing, I wonder if folks targeting embedded/older versions of glibc will complain. I see lutimes has been there since glibc 2.6.

glibc 2.6 was announced in May, 2007 it appears.

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/nio-dev/attachments/20190422/c8b15547/attachment.html>


More information about the nio-dev mailing list