I have been doing some
experiments using mmap with sbcl-1.0.25-x86-64-linux.
I have been able to sucessfully mmap to files and access the mmapped
pages from lisp.
Another thing I would like to do is create mmapped pages using
MAP_ANONYMOUS which are not mapped to files, and the pages initially
allow neither read or write access. I would like
to handle SIGSEGV interrupts to those pages to invoke code to compute
the contents of the pages, and then resume the interupted code.
An example use of such a capability is to access large jpeg compressed
tiled TIFF images.
A large region of virtual memory is mmapped using
the uncompressed image tiles (whose size are multiples of the mmap page
size). When a SIGSEGV occurs, the appropriate tile is decompressed
from the TIFF image into the uncompressed mmapped tile,
and the PROT_READ is set on those memory pages.
The problem I am having is that SBCL calls SB-SYS:MEMORY-FAULT-ERROR
which has no prevision
for invoking a user supplied interrupt-handler or for resuming the code
that triggered the SIGSEGV. Is there any hope not such a capability?