[PATCH] Change logic to select mmap system call in _dl_mmap

Mike Frysinger vapier at gentoo.org
Wed Feb 22 01:20:21 UTC 2006


On Tuesday 21 February 2006 16:55, Nicolas Bellido wrote:
> On Tuesday 21 February 2006 15:20, Mike Frysinger wrote:
> > On Tuesday 21 February 2006 04:15, Nicolas Bellido wrote:
> > > Before submitting a patch, I would like to understand the rationale
> > > behind 'use mmap first before trying to use mmap2' ? Is this something
> > > required by some other architectures ?
> >
> > the rationale is 'use a straight mmap syscall before anything else
> > because it's the smallest code size'
> >
> > should be trivial to change the logic to try and do:
> >  - mmap 6 arg syscall
> >  - mmap2 syscall
> >  - mmap 1 arg syscall
> > so if you want to submit a patch to do this, i'd prob merge it ...
>
> This patch implements what you suggested. I'm not sure whether
> __UCLIBC_MMAP_HAS_6_ARGS__ can be defined even if __NR_mmap is not
> available, so I test for both.

__UCLIBC_MMAP_HAS_6_ARGS__ is defined regardless of what syscall #'s are 
available

> This patch modifies the logic used to select the appropriate mmap, as
> suggested by Mike Frysinger:
> 	. first, check if mmap 6 args syscall is available
> 	. if not, check mmap2 syscall
> 	. if not, check mmap 1 arg syscall

sync up and try current svn please
-mike



More information about the uClibc mailing list