Watchout if the index file ends exactly on a page boundary, you'll
probably get a segmentation violation as the program tries to access
the non-existant null at the end of the file. When you mmap the file,
add 1 to the file size to prevent this.
(Try padding the file out manually and test).
I saw this with a mkover program which had exactly this problem
when a news article was exactly 32768 bytes long.
-- Peter Fox