42
42
COPY_BUFSIZE = 1024 * 1024 if _WINDOWS else 64 * 1024
43
43
# This should never be removed, see rationale in:
44
44
# https://bugs.python.org/issue43743#msg393429
45
- _USE_CP_SENDFILE = hasattr (os , "sendfile" ) and sys .platform .startswith ("linux" )
45
+ _USE_CP_SENDFILE = hasattr (os , "sendfile" ) and sys .platform .startswith (( "linux" , "sunos" ) )
46
46
_HAS_FCOPYFILE = posix and hasattr (posix , "_fcopyfile" ) # macOS
47
47
48
48
# CMD defaults in Windows 10
@@ -106,7 +106,7 @@ def _fastcopy_fcopyfile(fsrc, fdst, flags):
106
106
def _fastcopy_sendfile (fsrc , fdst ):
107
107
"""Copy data from one regular mmap-like fd to another by using
108
108
high-performance sendfile(2) syscall.
109
- This should work on Linux >= 2.6.33 only.
109
+ This should work on Linux >= 2.6.33 and Solaris only.
110
110
"""
111
111
# Note: copyfileobj() is left alone in order to not introduce any
112
112
# unexpected breakage. Possible risks by using zero-copy calls
@@ -264,7 +264,7 @@ def copyfile(src, dst, *, follow_symlinks=True):
264
264
return dst
265
265
except _GiveupOnFastCopy :
266
266
pass
267
- # Linux
267
+ # Linux / Solaris
268
268
elif _USE_CP_SENDFILE :
269
269
try :
270
270
_fastcopy_sendfile (fsrc , fdst )
@@ -285,7 +285,6 @@ def copyfile(src, dst, *, follow_symlinks=True):
285
285
raise FileNotFoundError (f'Directory does not exist: { dst } ' ) from e
286
286
else :
287
287
raise
288
-
289
288
return dst
290
289
291
290
def copymode (src , dst , * , follow_symlinks = True ):
0 commit comments