From: Andi Kleen <ak@muc.de>

As discussed earlier. This implements Linus' idea of printing 
the addresses in /proc/<pid>/maps as 32bit if possible.

This works around some broken 32bit programs that cannot parse
64bit addresses as generated by x86-64 kernels.

Also simplifies the code slightly.



 fs/proc/task_mmu.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN fs/proc/task_mmu.c~proc-pid-maps-32-bit-fix fs/proc/task_mmu.c
--- 25/fs/proc/task_mmu.c~proc-pid-maps-32-bit-fix	2003-08-23 13:54:26.000000000 -0700
+++ 25-akpm/fs/proc/task_mmu.c	2003-08-23 13:54:26.000000000 -0700
@@ -90,14 +90,14 @@ static int show_map(struct seq_file *m, 
 		ino = inode->i_ino;
 	}
 
-	seq_printf(m, "%0*lx-%0*lx %c%c%c%c %0*lx %02x:%02x %lu %n",
-			(int) (2*sizeof(void*)), map->vm_start,
-			(int) (2*sizeof(void*)), map->vm_end,
+	seq_printf(m, "%08lx-%08lx %c%c%c%c %08lx %02x:%02x %lu %n",
+			map->vm_start,
+			map->vm_end,
 			flags & VM_READ ? 'r' : '-',
 			flags & VM_WRITE ? 'w' : '-',
 			flags & VM_EXEC ? 'x' : '-',
 			flags & VM_MAYSHARE ? 's' : 'p',
-			(int) (2*sizeof(void*)), map->vm_pgoff << PAGE_SHIFT,
+			map->vm_pgoff << PAGE_SHIFT,
 			MAJOR(dev), MINOR(dev), ino, &len);
 
 	if (map->vm_file) {

_