This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] Improve strncpy performance further


> Roland McGrath wrote:
> > Btw while on the subject on namespaces, is bcopy correctly defined?
> > After a lot of complex inclusion and defines, it ultimately does:
> >
> > void
> > bcopy ()
> > {
> > ...
> > }
> 
> I'm not sure what kind of correctness you have in mind.  bcopy is the only
> name under which that function needs to be defined.  If it's in the same
> file as a standard function (presumably memmove) then it needs to be
> defined as weak.  No other code anywhere in libc should call bcopy (we'd
> use memmove or memcpy instead), so it doesn't need to have an __ name.

Well, bcopy and bzero are both used in several non-test sources in GLIBC, 
but one is always defined as __bzero, and the other as bcopy.

It's unclear to me what the exact namespace rules are (or whether there is 
even a concise description of them somewhere), however it is obvious that 
this is not consistent. Note any rule that relies on whether a function is
called or not from within the same library is risky unless you have 
automated checks to catch that.

Wilco




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]