On Fri, May 05, 2006 at 11:08:31PM +0200, Michael Kerrisk wrote: > > > Hmmm -- I'm not seeing this. Can you post for each of the two > > > test cases: > > > > > > -- the fopen() call that is used. > > > > > > -- the command line that is used to run the program. > > > > > > -- the results of grep the strace output using: > > > > > > egrep '(mmap|open|read)' > > Sure, (using strace -e mmap2,open,read instead): > > > > fopen "r": > > |... > > |open("/tmp/fp.c", O_RDONLY) = 3 > > |mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) > > = 0xb7f3a000 > > |read(3, "#include <sys/types.h>\n#include "..., 4096) = 460 > > |read(3, "", 4096) = 0 > > > > fopen "r+m": > > |... > > |open("/tmp/fp.c", O_RDWR) = 3 > > |mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) > > = 0xb7f8e000 > > |read(3, "#include <sys/types.h>\n#include "..., 4096) = 462 > > |read(3, "", 4096) = 0 > > > > fopen "rm": > > |... > > |open("/tmp/fp.c", O_RDONLY) = 3 > > |mmap2(NULL, 461, PROT_READ, MAP_SHARED, 3, 0) = 0xb7f1c000 > > Okay -- that look good. But it's strange, I'm not seeing the > same as you on SUSE 10.0, glibc 2.3.5. Do you have another Linux > to hand to test? I just tested on another Debian machine with the same results for fopen "rm".
But another machine did only an anonymous mmap: 2.6.12-1-amd64-k8-smp glibc 2.3.6 I note the following differences: Native POSIX Threads Library by Ulrich Drepper et al and libthread_db work sponsored by Alpha Processor Inc vs. linuxthreads-0.10 by Xavier Leroy (on kobun64). On a 32 bit radhat machine, the same thing; this time, linuxthreads and libthread_db. Linux 2.4.22-1.2199.nptl and glibc 2.3.3. Alan didn't have strace installed on a different redhat machine, so I copied mine, and again it didn't mmap the file. Again, linuxthreads and libthread_db. glibc 2.3.3, and Linux 2.6.10-1.771_FC2. I note that this functionality requires the compile-time conditional _G_HAVE_MMAP. Justin -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]