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>
- Date: Fri, 28 Jun 2013 14:34:57 -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>
That's fine but if you're going to worry about the unused #if case then you
might make it name space clean (use __getpagesize or GLRO(dl_pagesize)) and
make it use __ffs instead of a loop for its log2. (The latter is also a
correctness fix in case of a race to be the first call, in which case the
first thread could be partway through its loop when the second thread comes
along and uses a bogus nonzero value for page_shift.)