This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch 2/4] ARM 64 bit sync atomic operations [V2]
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 3 Oct 2011 15:55:58 +0000 (UTC)
- Subject: Re: [Patch 2/4] ARM 64 bit sync atomic operations [V2]
- References: <20110701155254.GA5242@davesworkthinkpad> <CACUk7=XU8JS+NmcCeKMWQX=WfUeJ4Yn3J+sSk_jOEjOk10EcVg@mail.gmail.com> <20110726085910.GA6925@davesworkthinkpad> <20110726090039.GB6925@davesworkthinkpad> <20110726090115.GC6925@davesworkthinkpad> <CACUk7=VDwc8aQvA1dT22BFFGaMy=is4CEOYWq1R_-YYxO=vnTg@mail.gmail.com> <Pine.LNX.4.64.1109301952310.22013@digraph.polyomino.org.uk> <4E8973C6.90703@redhat.com>
On Mon, 3 Oct 2011, Andrew Haley wrote:
> On 09/30/2011 08:54 PM, Joseph S. Myers wrote:
> > On Fri, 30 Sep 2011, Ramana Radhakrishnan wrote:
> >
> >> On 26 July 2011 10:01, Dr. David Alan Gilbert <david.gilbert@linaro.org> wrote:
> >>>
> >>> +
> >>> +extern unsigned int __write(int fd, const void *buf, unsigned int count);
> >>
> >> Why are we using __write instead of write?
> >
> > Because plain write is in the user's namespace in ISO C. See what I said
> > in <http://gcc.gnu.org/ml/gcc-patches/2011-07/msg00084.html> - the
> > alternative is hardcoding the syscall number and using the syscall
> > directly.
>
> That would be better, no? Unless __write is part of the glibc API,
> which AFAIK it isn't.
It's exported at version GLIBC_2.0 (not GLIBC_PRIVATE) under the comment
"functions used in inline functions or macros", although I don't actually
see any such functions or macros in current glibc headers. I think being
under a public version means you can rely on it staying there.
--
Joseph S. Myers
joseph@codesourcery.com