2005-07-05  Roland McGrath  <roland@redhat.com>

	* mem.c [LINUX] (sys_old_mmap) [X86_64]: Extract 32-bit values if
	child is 32-bit.
	Fixes RH#162467.
diff --git a/mem.c b/mem.c
index 636644e..618212a 100644
--- a/mem.c
+++ b/mem.c
@@ -245,6 +245,18 @@
     for (i=0; i<6; i++)
         u_arg[i] = tcp->u_arg[i];
 #else
+# if defined(X86_64)
+    if (current_personality == 1) {
+	    int i;
+	    for (i = 0; i < 6; ++i) {
+		    unsigned int val;
+		    if (umove(tcp, tcp->u_arg[0] + i * 4, &val) == -1)
+			    return 0;
+		    u_arg[i] = val;
+	    }
+    }
+    else
+# endif
     if (umoven(tcp, tcp->u_arg[0], sizeof u_arg, (char *) u_arg) == -1)
 	    return 0;
 #endif	// defined(IA64)