]> granicus.if.org Git - strace/commitdiff
tests/remap_file_pages.c: fix for the upcoming change of xlat.val type
authorDmitry V. Levin <ldv@altlinux.org>
Thu, 28 Apr 2016 21:10:59 +0000 (21:10 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 28 Apr 2016 21:14:54 +0000 (21:14 +0000)
The "flags" argument of remap_file_page syscall has type "unsigned
long", so it is not correct to load most significant bits with garbage
ans assume they are going to be ignored.

* tests/remap_file_pages.c (main): Remove artificial garbage from flags.

tests/remap_file_pages.c

index 3714a17a7a03e0f5812f2cc9e0dc51f5404bd342..8626e7f032f8ee4bb913e44f0af662fed982bebb 100644 (file)
@@ -44,8 +44,7 @@ main(void)
        const unsigned long prot = (unsigned long) 0xacedcafe00000000
                                   | PROT_READ|PROT_WRITE|PROT_EXEC;
        const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deed;
-       const unsigned long flags = (unsigned long) 0xbadc0ded00000000
-                                  | MAP_PRIVATE|MAP_ANONYMOUS;
+       const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS;
 
        long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags);
        printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n",