Re: mmap: is default non-populating behavior stable?

From: Chris Friesen
Date: Tue Nov 04 2008 - 10:57:01 EST


Rik van Riel wrote:
Peter Zijlstra wrote:

The exact interaction of mmap() and truncate() I'm not exactly clear on.

Truncate will reduce the size of the mmaps on the file to
match the new file size, so processes accessing beyond the
end of file will get a segmentation fault (SIGSEGV).

I suspect Peter was talking about using truncate() to set the initial file size, effectively increasing rather than reducing it.

Chris
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/