patch-1.3.33 linux/fs/proc/array.c

Next file: linux/include/asm-alpha/reg.h
Previous file: linux/fs/exec.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.32/linux/fs/proc/array.c linux/fs/proc/array.c
@@ -61,10 +61,18 @@
 	int count1;
 	char * pnt;
 	struct user dump;
+#ifdef __i386__
+#	define FIRST_MAPPED	PAGE_SIZE	/* we don't have page 0 mapped on x86.. */
+#else
+#	define FIRST_MAPPED	0
+#endif
 
 	memset(&dump, 0, sizeof(struct user));
 	dump.magic = CMAGIC;
 	dump.u_dsize = MAP_NR(high_memory);
+#ifdef __alpha__
+	dump.start_data = PAGE_OFFSET;
+#endif
 
 	if (count < 0)
 		return -EINVAL;
@@ -87,14 +95,14 @@
 		read += count1;
 	}
 
-	while (p < 2*PAGE_SIZE && count > 0) {
+	while (count > 0 && p < PAGE_SIZE + FIRST_MAPPED) {
 		put_user(0,buf);
 		buf++;
 		p++;
 		count--;
 		read++;
 	}
-	memcpy_tofs(buf,(void *) (PAGE_OFFSET + p - PAGE_SIZE),count);
+	memcpy_tofs(buf, (void *) (PAGE_OFFSET + p - PAGE_SIZE), count);
 	read += count;
 	file->f_pos += read;
 	return read;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this