reflink: osx: check that not older than High Sierra

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-09-23 13:29:18 +03:00
parent 3fd5603921
commit 10e10f9535
+7
View File
@@ -36,6 +36,13 @@ class System(object):
@staticmethod
def _reflink_darwin(src, dst):
import ctypes
import platform
version = platform.mac_ver()[0]
major, minor, patch = version.split('.')
# Starting from High Sierra
if major < 10 or (major == 10 and minor < 13):
return -1
clonefile = ctypes.CDLL('libc.dylib').clonefile
clonefile.argtypes = [ctypes.c_char_p,