This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/70975] experimental/filesystem/operations/copy.cc FAILs on Solaris 12
- From: "ro at CeBiTec dot Uni-Bielefeld.DE" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 27 Oct 2016 11:53:46 +0000
- Subject: [Bug libstdc++/70975] experimental/filesystem/operations/copy.cc FAILs on Solaris 12
- Auto-submitted: auto-generated
- References: <bug-70975-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70975
--- Comment #5 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
> Does following patch work:
>
> --cut here--
> diff --git a/libstdc++-v3/src/filesystem/ops.cc
> b/libstdc++-v3/src/filesystem/ops.cc
> index 9abcee0..b709858 100644
> --- a/libstdc++-v3/src/filesystem/ops.cc
> +++ b/libstdc++-v3/src/filesystem/ops.cc
> @@ -444,7 +444,9 @@ namespace
> }
>
> #ifdef _GLIBCXX_USE_SENDFILE
> - const auto n = ::sendfile(out.fd, in.fd, nullptr, from_st->st_size);
> + off_t always_zero_offset = 0;
> + const auto n = ::sendfile(out.fd, in.fd,
> + &always_zero_offset, from_st->st_size);
> if (n < 0 && (errno == ENOSYS || errno == EINVAL))
> {
> #endif
> --cut here--
Cursory testing indicates it does: I've built copy.cc both without and
with the patch and copied the binaries to the only remaining Solaris 12
machine with an older build which doesn't have the recent sendfile
change. The unpatched binary SEGVs as before, the patched one completes
successfully.
Thanks.
Rainer