[Bug libstdc++/70975] experimental/filesystem/operations/copy.cc FAILs on Solaris 12
ro at CeBiTec dot Uni-Bielefeld.DE
gcc-bugzilla@gcc.gnu.org
Thu Oct 27 12:12:00 GMT 2016
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
More information about the Gcc-bugs
mailing list