]> granicus.if.org Git - strace/commitdiff
tests: fix remap_file_pages.test breakage on hppa
authorEugene Syromyatnikov <evgsyr@gmail.com>
Mon, 5 Mar 2018 03:15:53 +0000 (04:15 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 7 Mar 2018 22:07:20 +0000 (22:07 +0000)
Apparently, hppa is the only architecture that has MAP_TYPE
defined to 0x3 instead of 0xf, and the tests hit that corner case.

* tests/remap_file_pages.c (main) [MAP_HUGETLB]: Print the value
of mapping type depending on the architecture (MAP_SHARED_VALIDATE
for hppa and unknown value for other architectures).

Fixes: v4.21~59 ("xlat: update MAP_* constants")
tests/remap_file_pages.c

index 4e409630225842e9912b7aea004bbd2f5b06adf2..9fd1e57bebda46399ad44a79e5b540644c51cf00 100644 (file)
@@ -81,13 +81,21 @@ main(void)
 
        k_remap_file_pages(addr, size, prot, pgoff, flags);
        printf("remap_file_pages(%#jx, %ju, %s, %ju"
-              ", %#x /* MAP_??? */"
+/*
+ * HP PA-RISC is the only architecture that has MAP_TYPE defined to 0x3, which
+ * is also used for MAP_SHARED_VALIDATE since Linux commit v4.15-rc1~71^2^2~23.
+ */
+# ifdef __hppa__
+              ", MAP_SHARED_VALIDATE"
+# else
+              ", 0xf /* MAP_??? */"
+# endif
               "|MAP_FIXED|MAP_NORESERVE|MAP_HUGETLB|21<<MAP_HUGE_SHIFT)"
               " = %s\n",
               (uintmax_t) addr, (uintmax_t) size,
               prot == PROT_NONE ? "PROT_NONE" :
                                   "0xdefaced00000000 /* PROT_??? */",
-              (uintmax_t) pgoff, MAP_TYPE, errstr);
+              (uintmax_t) pgoff, errstr);
 #endif /* MAP_HUGETLB */
 
        puts("+++ exited with 0 +++");