summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaki Matsushita <glass.saga@gmail.com>2017-12-20 16:23:37 +0900
committerMasaki Matsushita <glass.saga@gmail.com>2017-12-22 17:18:33 +0900
commitf22a583b4816a6196d928d1af048dad547ac0758 (patch)
tree32364bcebfff775b2f38abf879f815b9b965aec3
parent161f4a511ad01c0e7f013b03aae6afd4c386b1df (diff)
downloadruby-copy_file_range_bug.tar.gz
io.c: ignore EPERMcopy_file_range_bug
* io.c (nogvl_copy_file_range): ignore EPERM and fallback to sendfile(2) or read/write. copy_file_range(2) may not exist even if __NR_copy_file_range is defined in the build environment. [Bug #14207]
-rw-r--r--io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/io.c b/io.c
index f2d1f84be8..1aa5a0e72a 100644
--- a/io.c
+++ b/io.c
@@ -10783,6 +10783,8 @@ nogvl_copy_file_range(struct copy_stream_struct *stp)
}
switch (errno) {
case EINVAL:
+ case EPERM: /* copy_file_range(2) doesn't exist (may happen in
+ docker container) */
#ifdef ENOSYS
case ENOSYS:
#endif