mmap support
Support the following calls:
- mmap/mmap64
- msync
- munmap
Expected behavior:
GekkoFS client library returns a pointer to some allocated memory for a given file descriptor. If PROT_READ
is used, the corresponding GekkoFS file is first read for the given offset and size, populating the allocated memory for which a pointer is returned.
If PROT_WRITE
is passed, the application can freely modify the buffer space, but we will not be notified of the changes (see below). The data is only pushed to the GekkoFS file once msync
is issued. Therefore, we will provide a commit consistency for this operation which seems to be sufficient for now.
On a possible segmentation fault handler
It is possible for us get notified of any change of the buffer. For this, we would use an mmap
with PROT_NONE
combined with segmentation handlers. When the application accesses a page, this would therefore cause a segmentation fault which the kernel knows we handle. Nevertheless, because this causes several user-space/kernel switches, this could be quite slow. If required, we may offer this functionality in the future.