Re: [PATCH] Inconsistent mmap()/mremap() flags

2007-10-02 Thread Hugh Dickins
On Tue, 2 Oct 2007, Thayne Harbaugh wrote: > On Tue, 2007-10-02 at 07:15 +0200, Andi Kleen wrote: > > > For mmap you can emulate it by passing a low hint != 0 (e.g. getpagesize()) > > in address but without MAP_FIXED and checking if the result is not beyond > > your range. > > Cool. That's a mu

Re: [PATCH] Inconsistent mmap()/mremap() flags

2007-10-02 Thread Thayne Harbaugh
On Tue, 2007-10-02 at 07:15 +0200, Andi Kleen wrote: > On Mon, Oct 01, 2007 at 08:57:10PM -0600, Thayne Harbaugh wrote: > For mmap you can emulate it by passing a low hint != 0 (e.g. getpagesize()) > in address but without MAP_FIXED and checking if the result is not beyond > your range. Cool. T

Re: [PATCH] Inconsistent mmap()/mremap() flags

2007-10-01 Thread Andi Kleen
On Mon, Oct 01, 2007 at 08:57:10PM -0600, Thayne Harbaugh wrote: > Yeah, after I sent the email I realized that it was a bit more involved. > As far as the 32/31 bit, it just depends on the perspective. I can see > that 32 bits are needed to represent all possible return values from > mmap() - pos

Re: [PATCH] Inconsistent mmap()/mremap() flags

2007-10-01 Thread Thayne Harbaugh
On Mon, 2007-10-01 at 13:13 +0200, Andi Kleen wrote: > > @@ -388,6 +392,9 @@ > > if (vma->vm_flags & VM_MAYSHARE) > > map_flags |= MAP_SHARED; > > > > + if (flags & MAP_32BIT) > > + map_flags |= MAP_32BIT;

Re: [PATCH] Inconsistent mmap()/mremap() flags

2007-10-01 Thread Andi Kleen
> @@ -388,6 +392,9 @@ > if (vma->vm_flags & VM_MAYSHARE) > map_flags |= MAP_SHARED; > > + if (flags & MAP_32BIT) > + map_flags |= MAP_32BIT; > + > new_addr = get_unmapped_are