--- old/src/java.base/unix/classes/java/io/FileDescriptor.java 2016-09-29 14:26:27.176927328 -0700 +++ new/src/java.base/unix/classes/java/io/FileDescriptor.java 2016-09-29 14:26:27.053927327 -0700 @@ -59,6 +59,11 @@ private boolean append; /** + * true, if file is opened with O_DIRECT flag; + */ + private boolean direct; + + /** * Constructs an (invalid) FileDescriptor * object. */ @@ -69,6 +74,7 @@ private FileDescriptor(int fd) { this.fd = fd; this.append = getAppend(fd); + this.direct = getDirect(fd); } /** @@ -165,6 +171,14 @@ return obj.append; } + public void setDirect(FileDescriptor obj, boolean direct) { + obj.direct = direct; + } + + public boolean getDirect(FileDescriptor obj) { + return obj.direct; + } + public void setHandle(FileDescriptor obj, long handle) { throw new UnsupportedOperationException(); } @@ -181,6 +195,11 @@ */ private static native boolean getAppend(int fd); + /** + * Returns true, if the file was opened with O_DIRECT flag. + */ + private native boolean getDirect(int fd); + /* * Package private methods to track referents. * If multiple streams point to the same FileDescriptor, we cycle