]> granicus.if.org Git - strace/blobdiff - tests/old_mmap.c
tests: extend TEST_NETLINK_OBJECT macro
[strace] / tests / old_mmap.c
index c9e802de859d9617f17166c61ad08c9082ae60d5..2725fb754e450716b47a1987f7fe4699751d2a46 100644 (file)
  */
 
 #include "tests.h"
-#include <sys/syscall.h>
+#include <asm/unistd.h>
 
 /*
- * On s390x, this is the mmap syscall used by glibc, so,
+ * On s390x and m68k, this is the mmap syscall used by glibc, so,
  * from one side, it's already covered by another test, and, from another side,
  * it would require additional efforts to filter out mmap calls made by glibc.
  */
@@ -39,7 +39,6 @@
 #if defined __NR_mmap && \
 (   defined __arm__ \
  || defined __i386__ \
- || defined __m68k__ \
  || (defined __s390__ && !defined __s390x__) \
 )
 
@@ -51,6 +50,9 @@
 int
 main(void)
 {
+       long rc = syscall(__NR_mmap, 0);
+       printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name());
+
        const unsigned int args1_c[6] = {
                0xdeadbeef,             /* addr */
                0xfacefeed,             /* len */
@@ -70,7 +72,7 @@ main(void)
        };
        void *args = tail_memdup(args1_c, sizeof(args1_c));
 
-       long rc = syscall(__NR_mmap, args);
+       rc = syscall(__NR_mmap, args);
        printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED"
               ", %d, %#x) = %ld %s (%m)\n",
               args1_c[0], args1_c[1], args1_c[4], args1_c[5],
@@ -93,7 +95,7 @@ main(void)
 
 #else
 
-SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__ || __m68k__"
+SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__"
                    " || (__s390__ && !__s390x__))")
 
 #endif