Permalink
Browse files

Prefer mmap2() if present.

i386 has an mmap(), but mmap2() is the one we want with the right
calling convention.
  • Loading branch information...
1 parent 6e4d75a commit c03bd974f4bd4a3dc0b406f635feee6b6ee2dd8f @nelhage committed Jan 28, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 attach.c
View
@@ -16,10 +16,10 @@
#include "ptrace.h"
#include "reptyr.h"
-#ifdef __NR_mmap
-#define mmap_syscall __NR_mmap
-#else
+#ifdef __NR_mmap2
#define mmap_syscall __NR_mmap2
+#else
+#define mmap_syscall __NR_mmap
#endif
static void do_unmap(struct ptrace_child *child, child_addr_t addr, unsigned long len) {

0 comments on commit c03bd97

Please sign in to comment.