public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	       libstdc++ <libstdc++@gcc.gnu.org>,
	       Rainer Orth <ro@cebitec.uni-bielefeld.de>
Subject: Re: [PATCH, libstdc++]: Fix PR 70975, experimental/filesystem/operations/copy.cc FAILs on Solaris 12
Date: Thu, 27 Oct 2016 18:41:00 -0000	[thread overview]
Message-ID: <20161027184144.GA2922@redhat.com> (raw)
In-Reply-To: <CAFULd4ZXugSW4_buBE8YvpTQU25FCRY1Zf9L3mYTB3Cbcb5VFA@mail.gmail.com>

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.

  reply	other threads:[~2016-10-27 18:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 18:34 Uros Bizjak
2016-10-27 18:41 ` Jonathan Wakely [this message]
2016-10-27 18:43   ` Jonathan Wakely
2016-10-27 18:46     ` Uros Bizjak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161027184144.GA2922@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ro@cebitec.uni-bielefeld.de \
    --cc=ubizjak@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).