On Thu, May 04, 2006 at 09:48:09PM +0200, Michael Kerrisk wrote:
> > > > I just wrote a test case for "r+m", which seems to indicate that you
> > > > are correct; an "r+m" file is read() not mmaped.
> > > 
> > > Have you written a test program that verifies (presumably via
> > > monitoring via 'strace') how 'm' changes the behaviour of stdio
> > > with respect to the use of mmap()?
> > Erm, yes, thats what I'm talking about (and is strace exactly what I
> > did).  But I'm not sure if I understand you .. I verified that all 3
> > routines mmap() a file if "m" is given (and it is read-only), and do
> > not mmap() it if "m" is not given (or if it is not read-only).
> > 
> > I include now the test program :)
> 
> Yes, but did you verify:
> 
> -- which file is being mmap()ed?  (There might be many other
>    unrelated mmap() calls going on.)
Yes; note that it only happens after you fread() for the first time.

> -- whether the behaviour changes if 'm' is removed from the fopen()?
>    (the strace output shd be different).
Yes:
> > routines mmap() a file if "m" is given (and it is read-only), and do
> > not mmap() it if "m" is not given (or if it is not read-only).

Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to