This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Consistently use page_shift in sysdeps/unix/sysv/linux/mmap64.c
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: <libc-alpha at sourceware dot org>, Andreas Schwab <schwab at linux-m68k dot org>
- Date: Tue, 9 Jul 2013 12:53:58 -0700 (PDT)
- Subject: Re: Consistently use page_shift in sysdeps/unix/sysv/linux/mmap64.c
- References: <Pine dot LNX dot 4 dot 64 dot 1306282000050 dot 15167 at digraph dot polyomino dot org dot uk> <20130628213457 dot 38E962C09C at topped-with-meat dot com> <Pine dot LNX dot 4 dot 64 dot 1307012238110 dot 13535 at digraph dot polyomino dot org dot uk>
> This patch (untested, given the unused nature of this #if block) uses
> __getpagesize and fixes the race with use of __ffs.
That's fine. I agree with your response to the issues raised about using
__ffs.
> 2013-07-01 Joseph Myers <joseph@codesourcery.com>
>
> * sysdeps/unix/sysv/linux/mmap64.c (__mmap64) [MMAP2_PAGE_SHIFT ==
> -1]: Use __getpagesize to determine page size. Use __ffs to
> determine corresponding shift.
I don't like to see wrapping in the middle of a [...] like that.
I'd have written:
* sysdeps/unix/sysv/linux/mmap64.c (__mmap64)
[MMAP2_PAGE_SHIFT == -1]: Use __getpagesize to determine page size.
Use __ffs to determine corresponding shift.
Thanks,
Roland