[SCM] strace branch, master, updated. v4.7-98-g1ba8543

Dmitry V. Levin ldv at altlinux.org
Tue Mar 5 12:47:07 UTC 2013


On Tue, Feb 19, 2013 at 11:02:29AM +0000, Denys Vlasenko wrote:
[...]
> commit 1ba85436def7da80971aeb902fbc6e52997a46fa
> Author: Denys Vlasenko <vda.linux at googlemail.com>
> Date:   Tue Feb 19 11:28:20 2013 +0100
> 
>     Clean up mmap decoding
[...]
>     * mem.c: Refactor mmap functions so that we have five mmap syscall
>     handlers, each with the fixed API (not varying by arch).
[...]
mem.c b/mem.c
> index b67a1b6..6f22922 100644
> --- a/mem.c
> +++ b/mem.c
> @@ -39,8 +39,14 @@
>  #  define modify_ldt_ldt_s user_desc
>  # endif
>  #endif
> +
> +#include <sys/user.h>	/* for PAGE_SHIFT */
>  #if defined(SH64)
> -# include <asm/page.h>	    /* for PAGE_SHIFT */
> +# include <asm/page.h>	/* for PAGE_SHIFT */
> +#endif
> +#if !defined(PAGE_SHIFT)
> +# warning Failed to get PAGE_SHIFT, assuming 12
> +# define PAGE_SHIFT 12
>  #endif

In glibc, sys/user.h is notoriously incomplete header file containing a
nice comment that "The whole purpose of this file is for GDB and GDB
only".  In particular, on most of architectures it doesn't define
PAGE_SHIFT, and on some architectures PAGE_SHIFT is greater that 12.
I think we should not rely on <sys/user.h>.  The natural source of
PAGE_SHIFT definition seems to be <asm/page.h>; we can either include it
directly, or, if there is a risk of namespace collisions, fetch PAGE_SHIFT
during configure stage.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130305/f8be0758/attachment.bin>


More information about the Strace-devel mailing list