aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/internal/poll
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-09-22 20:30:08 -0700
committerIan Lance Taylor <iant@golang.org>2020-09-23 17:32:49 -0700
commit10a83805e047a583348e8bef18b966ecb8eee5d4 (patch)
tree0e35588beed26134397f6e25aa58dfd3600ed8db /libgo/go/internal/poll
parent82b77dee751c916bcef55e527bffdd82b68fc897 (diff)
downloadgcc-10a83805e047a583348e8bef18b966ecb8eee5d4.zip
gcc-10a83805e047a583348e8bef18b966ecb8eee5d4.tar.gz
gcc-10a83805e047a583348e8bef18b966ecb8eee5d4.tar.bz2
libgo: update to Go1.15.2 release
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/256618
Diffstat (limited to 'libgo/go/internal/poll')
-rw-r--r--libgo/go/internal/poll/copy_file_range_linux.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/libgo/go/internal/poll/copy_file_range_linux.go b/libgo/go/internal/poll/copy_file_range_linux.go
index 604607f..09de299 100644
--- a/libgo/go/internal/poll/copy_file_range_linux.go
+++ b/libgo/go/internal/poll/copy_file_range_linux.go
@@ -41,7 +41,7 @@ func CopyFileRange(dst, src *FD, remain int64) (written int64, handled bool, err
// use copy_file_range(2) again.
atomic.StoreInt32(&copyFileRangeSupported, 0)
return 0, false, nil
- case syscall.EXDEV, syscall.EINVAL:
+ case syscall.EXDEV, syscall.EINVAL, syscall.EOPNOTSUPP, syscall.EPERM:
// Prior to Linux 5.3, it was not possible to
// copy_file_range across file systems. Similarly to
// the ENOSYS case above, if we see EXDEV, we have
@@ -52,6 +52,14 @@ func CopyFileRange(dst, src *FD, remain int64) (written int64, handled bool, err
// dst or src refer to a pipe rather than a regular
// file. This is another case where no data has been
// transfered, so we consider it unhandled.
+ //
+ // If the file is on NFS, we can see EOPNOTSUPP.
+ // See issue #40731.
+ //
+ // If the process is running inside a Docker container,
+ // we might see EPERM instead of ENOSYS. See issue
+ // #40893. Since EPERM might also be a legitimate error,
+ // don't mark copy_file_range(2) as unsupported.
return 0, false, nil
case nil:
if n == 0 {