mmap fails with error 22

Geerts Steven Steven.Geerts at thomson.net
Fri Apr 13 00:00:51 PDT 2007


Hi Rob

Thanks for the reply, but it's still not working however.

If I do the following however it works:

/* check if offset is page aligned */
    if (offset & ((1 << MMAP2_PAGE_SHIFT) - 1))
        return MAP_FAILED;
  return (__ptr_t) _mmap (addr, len, prot, flags,
						  fd,(off_t) (((1 <<
MMAP2_PAGE_SHIFT) -1 )&(offset >> MMAP2_PAGE_SHIFT)))

In memory before I got the following addres: FFFB8000 this will now be
changed to 000B8000 which will work!

is this a good patch or not?

regards
-----Original Message-----
From: Rob Landley [mailto:rob at landley.net] 
Sent: donderdag 12 april 2007 19:45
To: uclibc at uclibc.org
Cc: Geerts Steven
Subject: Re: mmap fails with error 22

On Thursday 12 April 2007 10:12 am, Geerts Steven wrote:
> Hi
> 
> I build my cross toolchain for an arm big endian with eabi support and
I
> successfully booted uclibc on my target board.  But now I'm having a
> problem with eabi support for one of my own programs.
> 
> In my program I call mmap to map some memory but this gives back an
> error and I guess it's because it's calling the wrong mmap function.  
> 
> I use gcc 4.1.2, uclibc (daily snapshot 20070308, > 0.9.28.3) and

Which is amusing because that very day I checked in the following arm
mmap bug 
fix:  http://uclibc.org/cgi-bin/viewcvs.cgi?rev=18041&view=rev

Update your snapshot.

Rob
-- 
Penguicon 5.0 Apr 20-22, Linux Expo/SF Convention.  Bruce Schneier,
Christine 
Peterson, Steve Jackson, Randy Milholland, Elizabeth Bear, Charlie
Stross...



More information about the uClibc mailing list