RFR: 8343785: (fs) Remove syscalls that set file times with microsecond precision [v2]

Alan Bateman alanb at openjdk.org
Wed Nov 13 10:22:03 UTC 2024


On Wed, 13 Nov 2024 00:47:49 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> Remove the syscalls `utimes`, `futimes`, and `lutimes` that set the file access and modification times using microsecond precision.
>
> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8343785: Use file descriptor in preference to path; add AIX to test @requires

src/java.base/unix/classes/sun/nio/fs/UnixFileAttributeViews.java line 80:

> 78:             // if path is a symlink, then the open should fail with ELOOP and
> 79:             // the path will be used instead of the file descriptor.
> 80:             boolean haveFd = false;

In passing, we don't need haveFd, instead we can use fd >= 0 as is done in other places.

src/java.base/unix/classes/sun/nio/fs/UnixFileAttributeViews.java line 83:

> 81:             int fd = -1;
> 82:             try {
> 83:                 fd = file.openForAttributeAccess(followLinks);

This throws if O_NOFOLLOW is not supported. Are there any platforms where this is possible?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21989#discussion_r1839879979
PR Review Comment: https://git.openjdk.org/jdk/pull/21989#discussion_r1839882104


More information about the nio-dev mailing list