This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix wordsize-32 mmap offset for negative value (BZ#18877)


I'm looking at failures of this new test for MIPS, but am puzzled by the 
descriptions of this issue in terms of things being incorrect and fixed 
without any statement of what is actually correct or why that is correct.

The expectation in the test seems to be that negative offsets passed to 
mmap should be interpreted as large unsigned values.  But I can't find 
anything in POSIX, or in the glibc manual, or in the Linux man-pages 
collection, to justify those semantics.  So what is the basis for that 
interpretation as part of the glibc API (and for its being compatible with 
POSIX), rather than negative arguments being considered invalid?

(The MIPS mmap syscall uses a signed argument and does a signed arithmetic 
shift on it, meaning that matching the MIPS semantics to other 
architectures will involve using mmap2 for o32 and making mmap not an 
alias for mmap64 for n32 because mmap for n32 will need to zero-extend its 
offset argument before calling the syscall.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]