mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
6539707: (fc) MappedByteBuffer.force() method throws an IOException in a very simple test
Reviewed-by: alanb
This commit is contained in:
parent
189289d9c7
commit
46d78f0d24
5 changed files with 97 additions and 5 deletions
|
@ -28,6 +28,8 @@ package java.nio;
|
|||
import jdk.internal.misc.Unsafe;
|
||||
|
||||
import java.io.FileDescriptor;
|
||||
import java.io.IOException;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
/* package */ class MappedMemoryUtils {
|
||||
|
||||
|
@ -94,7 +96,11 @@ import java.io.FileDescriptor;
|
|||
} else {
|
||||
// force writeback via file descriptor
|
||||
long offset = mappingOffset(address, index);
|
||||
force0(fd, mappingAddress(address, offset, index), mappingLength(offset, length));
|
||||
try {
|
||||
force0(fd, mappingAddress(address, offset, index), mappingLength(offset, length));
|
||||
} catch (IOException cause) {
|
||||
throw new UncheckedIOException(cause);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +109,7 @@ import java.io.FileDescriptor;
|
|||
private static native boolean isLoaded0(long address, long length, int pageCount);
|
||||
private static native void load0(long address, long length);
|
||||
private static native void unload0(long address, long length);
|
||||
private static native void force0(FileDescriptor fd, long address, long length);
|
||||
private static native void force0(FileDescriptor fd, long address, long length) throws IOException;
|
||||
|
||||
// utility methods
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue