*/
#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.
*/
#if defined __NR_mmap && \
( defined __arm__ \
|| defined __i386__ \
- || defined __m68k__ \
|| (defined __s390__ && !defined __s390x__) \
)
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 */
};
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],
#else
-SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__ || __m68k__"
+SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__"
" || (__s390__ && !__s390x__))")
#endif