[libiberty patch]: Change strncmp test in the way it uses mmap

Stan Shebs shebs@apple.com
Mon Dec 31 12:35:00 GMT 2001


Ira Ruben wrote:
> 
> At 2:46 PM -0500 12/31/01, DJ Delorie wrote:
> 
> > > What's wrong with the change I did?  Yes, both kinds of mmap's could
> >> be done.  But what's wrong with doing the anonymous mmap if that is
> >> available and the "/dev/zero" file mmap if not.  Why do both?
> >
> >Well, what's wrong with doing the /dev/zero file mmap is available,
> >and anonymous if not?
> 
> I don't see why you seem so "protective" of doing that /dev/zero form when the other works equally as well (and in our case is necessary) and when it can be determined which to use based on the definitions of MAP_ANON and MAP_ANONYMOUS.

If nothing else, the original code is known to work correctly across
many more types of machines than any individual here has access to for
testing.  We should try to preserve the original code sequence if at
all possible, and just add code to catch the Darwin failure at the
point it occurs.

Stan



More information about the Gcc-patches mailing list