patch fixing 297991: mmap changing a file descriptor current position

Bug caused by the following problem:
for each mmap, Valgrind reads the 1st 1024 bytes to detect
if this is an mmap-ed file containing debug info to decode.

Reading this 1Kb is done with VG_(pread). VG_(pread) should be
the equivalent of syscall pread but on linux, it is implemented as
a seek+read. 

The patch implements VG_(pread) in terms of the underlying pread syscall.

Test mmap_fcntl_bug.c completed to also verify the fd current position
before and after the mmap. 

tested on linux x86/amd64/ppc32/ppc64/s390.
(not tested on Darwin)
(manually tested on arm-android)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12504 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/NEWS b/NEWS
index 65e79f8..3199c3f 100644
--- a/NEWS
+++ b/NEWS
@@ -80,6 +80,7 @@
 n-i-bz  s390x: Shadow registers can now be examined using vgdb
 297078  gdbserver signal handling problems caused by diff vki nr/gdb nr
         and non reset of "C-ontinued" signal
+297991  Valgrind interferes with mmap()+ftell() 
 297992  Support systems missing WIFCONTINUED (e.g. pre-2.6.10 Linux) 
 
 Release 3.7.0 (5 November 2011)