qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix building with glibc < 2.4


From: Kirill A. Shutemov
Subject: Re: [Qemu-devel] [PATCH] Fix building with glibc < 2.4
Date: Wed, 10 Dec 2008 14:07:57 +0200
User-agent: Mutt/1.5.18 (2008-10-30)

On Wed, Dec 10, 2008 at 06:57:58AM -0500, Robert Reif wrote:
> Kirill A. Shutemov wrote:
> > Prior to version 2.4, glibc did not expose the definition of
> > MREMAP_FIXED, and the prototype for mremap() did not allow
> > for the new_address argument.
> >
> > Tested only with glibc 2.9.
> >
> > Signed-off-by: Kirill A. Shutemov <address@hidden>
> > ---
> >  linux-user/mmap.c |   10 +++++++---
> >  1 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/linux-user/mmap.c b/linux-user/mmap.c
> > index 89254ae..b6dd184 100644
> > --- a/linux-user/mmap.c
> > +++ b/linux-user/mmap.c
> > @@ -24,6 +24,8 @@
> >  #include <unistd.h>
> >  #include <errno.h>
> >  #include <sys/mman.h>
> > +#include <linux/mman.h>
> > +#include <linux/unistd.h>
> >  
> >  #include "qemu.h"
> >  #include "qemu-common.h"
> > @@ -564,9 +566,11 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong 
> > old_size,
> >          if (mmap_start == -1) {
> >              errno = ENOMEM;
> >              host_addr = MAP_FAILED;
> > -        } else
> > -            host_addr = mremap(g2h(old_addr), old_size, new_size,
> > -                               flags | MREMAP_FIXED, g2h(mmap_start));
> > +        } else {
> > +            host_addr = (void *) syscall(__NR_mremap, g2h(old_addr),
> > +                    old_size, new_size, flags | MREMAP_FIXED,
> > +                    g2h(mmap_start));
> > +        }
> >      } else {
> >          host_addr = mremap(g2h(old_addr), old_size, new_size, flags);
> >          /* Check if address fits target address space */
> >   
> This version compiles for me.

Thanks. I'll resend patch with your Sign-off.

-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + ALT Linux Team, http://www.altlinux.org/

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]