mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8293122: (fs) Use file cloning in macOS version of Files::copy method
Reviewed-by: alanb
This commit is contained in:
parent
95c7c556a3
commit
a75ddb836b
5 changed files with 124 additions and 1 deletions
|
@ -32,6 +32,7 @@
|
|||
#include <sys/stat.h>
|
||||
#ifdef _ALLBSD_SOURCE
|
||||
#include <sys/attr.h>
|
||||
#include <sys/clonefile.h>
|
||||
#endif
|
||||
|
||||
/* To be able to name the Java constants the same as the C constants without
|
||||
|
@ -133,6 +134,10 @@ class UnixConstants {
|
|||
static final int PREFIX_ERANGE = ERANGE;
|
||||
static final int PREFIX_EMFILE = EMFILE;
|
||||
|
||||
#ifdef _ALLBSD_SOURCE
|
||||
static final int PREFIX_ENOTSUP = ENOTSUP;
|
||||
#endif
|
||||
|
||||
// flags used with openat/unlinkat/etc.
|
||||
#if defined(AT_SYMLINK_NOFOLLOW) && defined(AT_REMOVEDIR)
|
||||
static final int PREFIX_AT_SYMLINK_NOFOLLOW = AT_SYMLINK_NOFOLLOW;
|
||||
|
@ -144,6 +149,10 @@ class UnixConstants {
|
|||
#endif
|
||||
|
||||
#ifdef _ALLBSD_SOURCE
|
||||
// flags used with clonefile
|
||||
static final int PREFIX_CLONE_NOFOLLOW = CLONE_NOFOLLOW;
|
||||
static final int PREFIX_CLONE_NOOWNERCOPY = CLONE_NOOWNERCOPY;
|
||||
|
||||
// flags used with setattrlist
|
||||
static final int PREFIX_ATTR_CMN_CRTIME = ATTR_CMN_CRTIME;
|
||||
static final int PREFIX_ATTR_CMN_MODTIME = ATTR_CMN_MODTIME;
|
||||
|
|
|
@ -428,7 +428,7 @@ abstract class UnixFileSystem
|
|||
}
|
||||
|
||||
// The flags that control how a file is copied or moved
|
||||
private static class Flags {
|
||||
protected static class Flags {
|
||||
boolean replaceExisting;
|
||||
boolean atomicMove;
|
||||
boolean followLinks;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue