8264744: (fs) Use file cloning in Linux version of Files::copy method

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2022-09-06 18:10:58 +00:00
parent 85d4b49151
commit da596182a4
4 changed files with 76 additions and 16 deletions

View file

@ -161,6 +161,8 @@ class LinuxFileSystem extends UnixFileSystem {
// -- native methods --
private static native void init();
/**
* Copies data between file descriptors {@code src} and {@code dst} using
* a platform-specific function or system call possibly having kernel
@ -179,4 +181,9 @@ class LinuxFileSystem extends UnixFileSystem {
private static native int directCopy0(int dst, int src,
long addressToPollForCancel)
throws UnixException;
static {
jdk.internal.loader.BootLoader.loadLibrary("nio");
init();
}
}