diff options
author | Jakub KulĂk <Kulikjak@gmail.com> | 2024-09-19 14:47:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-19 14:47:05 (GMT) |
commit | 8f82d9aa2191db7826bb7a453fe06ce65f966cf8 (patch) | |
tree | 22ac421d6a5fee93eead57f35195829d8981630e /Lib/shutil.py | |
parent | 426569eb8ca1edaa68026aa2bab6b8d1c9105f93 (diff) | |
download | cpython-8f82d9aa2191db7826bb7a453fe06ce65f966cf8.zip cpython-8f82d9aa2191db7826bb7a453fe06ce65f966cf8.tar.gz cpython-8f82d9aa2191db7826bb7a453fe06ce65f966cf8.tar.bz2 |
bpo-41843: Reenable use of sendfile in shutil module on Solaris (GH-23893)
Diffstat (limited to 'Lib/shutil.py')
-rw-r--r-- | Lib/shutil.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/shutil.py b/Lib/shutil.py index 6037092..89c12b7 100644 --- a/Lib/shutil.py +++ b/Lib/shutil.py @@ -48,7 +48,7 @@ COPY_BUFSIZE = 1024 * 1024 if _WINDOWS else 64 * 1024 # This should never be removed, see rationale in: # https://bugs.python.org/issue43743#msg393429 _USE_CP_SENDFILE = (hasattr(os, "sendfile") - and sys.platform.startswith(("linux", "android"))) + and sys.platform.startswith(("linux", "android", "solaris"))) _HAS_FCOPYFILE = posix and hasattr(posix, "_fcopyfile") # macOS # CMD defaults in Windows 10 @@ -110,7 +110,7 @@ def _fastcopy_fcopyfile(fsrc, fdst, flags): def _fastcopy_sendfile(fsrc, fdst): """Copy data from one regular mmap-like fd to another by using high-performance sendfile(2) syscall. - This should work on Linux >= 2.6.33 only. + This should work on Linux >= 2.6.33, Android and Solaris. """ # Note: copyfileobj() is left alone in order to not introduce any # unexpected breakage. Possible risks by using zero-copy calls @@ -265,7 +265,7 @@ def copyfile(src, dst, *, follow_symlinks=True): return dst except _GiveupOnFastCopy: pass - # Linux + # Linux / Android / Solaris elif _USE_CP_SENDFILE: try: _fastcopy_sendfile(fsrc, fdst) |