* [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12
@ 2016-10-27 18:34 Uros Bizjak
2016-10-27 18:41 ` Jonathan Wakely
0 siblings, 1 reply; 4+ messages in thread
From: Uros Bizjak @ 2016-10-27 18:34 UTC (permalink / raw)
To: gcc-patches; +Cc: libstdc++, Jonathan Wakely, Rainer Orth
[-- Attachment #1: Type: text/plain, Size: 705 bytes --]
Attached patch improves sendfile syscall compatibility with (older)
Solaris 12, where non-null third argument is required. It also paves
the way for compatibility with Solaris 10/11, where otherwise
additional -lsendfile is needed to link with libsendfile library. The
change has no effect on linux.
2016-10-27 Uros Bizjak <ubizjak@gmail.com>
PR libstdc++/70975
* src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]:
Use pointer to zero as non-null third argument of sendfile call.
Bootstrapped and regression tested on x86_64-linux-gnu {,-m32} CentOS
5 and Fedora 24. Also tested by Rainer on older Solaris 12, where the
patch fixes testsuite failure.
OK for mainline?
Uros.
[-- Attachment #2: l.diff.txt --]
[-- Type: text/plain, Size: 546 bytes --]
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12
2016-10-27 18:34 [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12 Uros Bizjak
@ 2016-10-27 18:41 ` Jonathan Wakely
2016-10-27 18:43 ` Jonathan Wakely
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2016-10-27 18:41 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, libstdc++, Rainer Orth
On 27/10/16 20:33 +0200, Uros Bizjak wrote:
>Attached patch improves sendfile syscall compatibility with (older)
>Solaris 12, where non-null third argument is required. It also paves
>the way for compatibility with Solaris 10/11, where otherwise
>additional -lsendfile is needed to link with libsendfile library. The
>change has no effect on linux.
>
>
>2016-10-27 Uros Bizjak <ubizjak@gmail.com>
>
> PR libstdc++/70975
> * src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]:
> Use pointer to zero as non-null third argument of sendfile call.
>
>Bootstrapped and regression tested on x86_64-linux-gnu {,-m32} CentOS
>5 and Fedora 24. Also tested by Rainer on older Solaris 12, where the
>patch fixes testsuite failure.
>
>OK for mainline?
>
>Uros.
>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
Is there a good reason to call it "always_zero_offset" rather than
something that fits on one line, like "offset"?
OK for trunk anyway, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12
2016-10-27 18:41 ` Jonathan Wakely
@ 2016-10-27 18:43 ` Jonathan Wakely
2016-10-27 18:46 ` Uros Bizjak
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2016-10-27 18:43 UTC (permalink / raw)
To: Uros Bizjak; +Cc: gcc-patches, libstdc++, Rainer Orth
On 27/10/16 19:41 +0100, Jonathan Wakely wrote:
>On 27/10/16 20:33 +0200, Uros Bizjak wrote:
>>Attached patch improves sendfile syscall compatibility with (older)
>>Solaris 12, where non-null third argument is required. It also paves
>>the way for compatibility with Solaris 10/11, where otherwise
>>additional -lsendfile is needed to link with libsendfile library. The
>>change has no effect on linux.
>>
>>
>>2016-10-27 Uros Bizjak <ubizjak@gmail.com>
>>
>> PR libstdc++/70975
>> * src/filesystem/ops.cc (do_copy_file) [_GLIBCXX_USE_SENDFILE]:
>> Use pointer to zero as non-null third argument of sendfile call.
>>
>>Bootstrapped and regression tested on x86_64-linux-gnu {,-m32} CentOS
>>5 and Fedora 24. Also tested by Rainer on older Solaris 12, where the
>>patch fixes testsuite failure.
>>
>>OK for mainline?
>>
>>Uros.
>
>>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
>
>Is there a good reason to call it "always_zero_offset" rather than
>something that fits on one line, like "offset"?
>
>OK for trunk anyway, thanks.
(I actually already sent a similar patch, see
https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02276.html but I didn't
commit it yet due to some network issues I've been having today).
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12
2016-10-27 18:43 ` Jonathan Wakely
@ 2016-10-27 18:46 ` Uros Bizjak
0 siblings, 0 replies; 4+ messages in thread
From: Uros Bizjak @ 2016-10-27 18:46 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc-patches, libstdc++, Rainer Orth
On Thu, Oct 27, 2016 at 8:43 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
>> Is there a good reason to call it "always_zero_offset" rather than
>> something that fits on one line, like "offset"?
>>
>> OK for trunk anyway, thanks.
>
>
>
> (I actually already sent a similar patch, see
> https://gcc.gnu.org/ml/gcc-patches/2016-10/msg02276.html but I didn't
> commit it yet due to some network issues I've been having today).
Oh, I just planned to re-test and submit exactly the version you sent.
I'll take care for commit to SVN.
Thanks,
Uros.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-27 18:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-27 18:34 [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12 Uros Bizjak
2016-10-27 18:41 ` Jonathan Wakely
2016-10-27 18:43 ` Jonathan Wakely
2016-10-27 18:46 ` Uros Bizjak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).