This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Fix wordsize-32 mmap offset for negative value (BZ#18877)
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 28 Jan 2016 17:50:29 -0200
- Subject: Re: [PATCH] Fix wordsize-32 mmap offset for negative value (BZ#18877)
- Authentication-results: sourceware.org; auth=none
- References: <55DF6F59 dot 3000404 at linaro dot org> <alpine dot DEB dot 2 dot 10 dot 1601202136590 dot 10142 at digraph dot polyomino dot org dot uk> <alpine dot DEB dot 2 dot 10 dot 1601281744340 dot 9617 at digraph dot polyomino dot org dot uk>
On 28-01-2016 15:45, Joseph Myers wrote:
> Does anyone else have comments on my question
> <https://sourceware.org/ml/libc-alpha/2016-01/msg00534.html> of what the
> desired architecture-independent mmap semantics should be for negative
I recheck Linux handling of mmap syscall and I would say we should handle
it an unsigned integer since it is what general mmap implementation is
being based current (mmap_pgoff - mm/mmap.c).
The problem is some architecture implements mmap (either default or
for compatibility) as signed and others as unsigned. As far I could
check mmap2 is handled as unsigned for all the ports.
Now from GLIBC side I see we need to start use mmap2 where is possible
for the ports that already are not using it (mips for instance). The
problem is ports that only provides mmap with signed offset and for
such cases I am not sure how we will enforce architecture-independent
semantics for negative offset.