diff -r 764addae3e37 -r 22866513a80e src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java --- a/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java Thu May 02 15:20:06 2019 -0400 +++ b/src/java.base/unix/classes/sun/nio/fs/UnixNativeDispatcher.java Thu May 02 13:25:00 2019 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -401,7 +401,7 @@ static native void fchmod(int fd, int mode) throws UnixException; /** - * utimes(conar char* path, const struct timeval times[2]) + * utimes(const char* path, const struct timeval times[2]) */ static void utimes(UnixPath path, long times0, long times1) throws UnixException @@ -417,11 +417,27 @@ throws UnixException; /** - * futimes(int fildes,, const struct timeval times[2]) + * futimes(int fildes, const struct timeval times[2]) */ static native void futimes(int fd, long times0, long times1) throws UnixException; /** + * lutimes(const char* path, const struct timeval times[2]) + */ + static void lutimes(UnixPath path, long times0, long times1) + throws UnixException + { + NativeBuffer buffer = copyToNativeBuffer(path); + try { + lutimes0(buffer.address(), times0, times1); + } finally { + buffer.release(); + } + } + private static native void lutimes0(long pathAddress, long times0, long times1) + throws UnixException; + + /** * DIR *opendir(const char* dirname) */ static long opendir(UnixPath path) throws UnixException { @@ -578,9 +594,10 @@ /** * Capabilities */ - private static final int SUPPORTS_OPENAT = 1 << 1; // syscalls + private static final int SUPPORTS_OPENAT = 1 << 1; // syscalls private static final int SUPPORTS_FUTIMES = 1 << 2; - private static final int SUPPORTS_BIRTHTIME = 1 << 16; // other features + private static final int SUPPORTS_LUTIMES = 1 << 4; + private static final int SUPPORTS_BIRTHTIME = 1 << 16; // other features private static final int capabilities; /** @@ -598,6 +615,13 @@ } /** + * Supports lutimes + */ + static boolean lutimesSupported() { + return (capabilities & SUPPORTS_LUTIMES) != 0; + } + + /** * Supports file birth (creation) time attribute */ static boolean birthtimeSupported() {