From: Uros Bizjak Date: Thu, 27 Oct 2016 18:55:55 +0000 (+0200) Subject: PR70975 Pass valid offset argument to sendfile X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=47ffb5d95eb5c5514dae306b7c8e4308f1f001a2;p=gcc.git PR70975 Pass valid offset argument to sendfile PR libstdc++/70975 * src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]: Pass non-null pointer to sendfile for offset argument. From-SVN: r241629 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 50f58379daa..6a061010eb5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2016-10-27 Uros Bizjak + + PR libstdc++/70975 + * src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]: + Pass non-null pointer to sendfile for offset argument. + 2016-10-27 Jonathan Wakely * testsuite/ext/random/uniform_inside_sphere_distribution/cons/ diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 9abcee0ea9b..8ed0a105dfa 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -444,7 +444,8 @@ namespace } #ifdef _GLIBCXX_USE_SENDFILE - const auto n = ::sendfile(out.fd, in.fd, nullptr, from_st->st_size); + off_t offset = 0; + const auto n = ::sendfile(out.fd, in.fd, &offset, from_st->st_size); if (n < 0 && (errno == ENOSYS || errno == EINVAL)) { #endif