unix: check for partial copy_file_range support
Fixes: https://github.com/libuv/libuv/issues/3069 PR-URL: https://github.com/libuv/libuv/pull/3070 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
b2ccbbb8a4
commit
663588e68e
@ -923,8 +923,12 @@ static ssize_t uv__fs_sendfile(uv_fs_t* req) {
|
||||
r = uv__fs_copy_file_range(in_fd, &off, out_fd, NULL, req->bufsml[0].len, 0);
|
||||
|
||||
if (r == -1 && errno == ENOSYS) {
|
||||
/* ENOSYS - it will never work */
|
||||
errno = 0;
|
||||
copy_file_range_support = 0;
|
||||
} else if (r == -1 && errno == ENOTSUP) {
|
||||
/* ENOTSUP - it could work on another file system type */
|
||||
errno = 0;
|
||||
} else {
|
||||
goto ok;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user