This does not work. Example:
1. JamieEmacs loads file using MAP_PRIVATE.
2. Something else writes to the file.
3. Scroll to the bottom of the file in JamieEmacs. It displays some
of the newly written data, though not all of it.
--> Wrong editor semantics.
Note that the something else which modifies the file in step 2 is not an
editor written especially to cooperate with JamieEmacs. So it does not
do renaming -- why should it? You might have just loaded
/var/log/messages into JamieEmacs, for example, and syslog is the
program in step 2.
What you need is read() or an equivalent. I don't know of a
memory-efficient equivalent to read. MAP_PRIVATE doesn't do it because
you have to dirty every page before you can be sure that file
modifications won't change your view of the data, and the dirtying
creates just as many page duplicates as read() does.
cheers,
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/