[PATCH 2/2 v5] [BZ #10283] localedef: align fixed maps to SHMLBA
Mike Frysinger
vapier@gentoo.org
Thu Jun 20 20:55:00 GMT 2013
On Wednesday 19 June 2013 19:02:42 Roland McGrath wrote:
> You're not going to convince me that SHMLBA counts as "generic".
> The code should be written to make MAP_FIXED_ALIGNMENT optional
> and not do any extra alignment if it's not defined in libc-mmap.h.
the generic code (locale/programs/locarchive.c) is already written to assume
that MAP_FIXED requires at least PAGE_SIZE alignment. it's been this way
since the code was introduced (Apr 2009). i guess you'd submit that this code
has simply always been wrong. however, writing the generic code to work with
no alignment at all so it'll work on a hypothetical machine that, almost
certainly (hell i'll bet my hat on it) will never exist (at least that will be
capable of running glibc), is entirely pointless. especially when no one can
actually validate it does anything useful (like compile let alone execute).
> The generic libc-mmap.h should be empty (just comments).
> sysdeps/unix/sysv/linux/libc-mmap.h can use SHMLBA.
if we follow your logic, even linux/libc-mmap.h isn't the right place. the
fact that Linux (and every single OS out there) happens to have SHMLBA that
reflects the right value is incidental. so we should keep a copy of this
header file in every OS & arch combo.
we've dealt with this copy & paste hell already with things like the bits
headers. having one master version which, as i documented in another e-mail,
does the right thing for every OS/arch glibc supports (and even the ones it
doesn't) keeps the maintenance cost down. it doesn't even have a maze of
ifdefs like we've accepted with other headers.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20130620/98751d4e/attachment.sig>
More information about the Libc-alpha
mailing list