1 ;;;; Begin Copyright Notice
2 ; SPDX-License-Identifier: BSD-3-Clause
3 ; Copyright 2015-2018, Intel Corporation
4 ;;;; End Copyright Notice
7 ; XXX - libpmem exports mmap/munmap/msync/mprotect functions
9 ; This is a _temporary_ solution to make those function available for all
10 ; the other PMDK libraries and to have only one instance of a file mapping
11 ; list (owned by libpmem). Otherwise, each library would have its own
12 ; instance of the file mapping list, resulting in libpmem being not able
13 ; to find a file handle associated with the mapping address passed to
14 ; pmem_msync(), pmem_memcpy(), etc. causing those functions to fail.
16 ; The proposed target solution would include:
17 ; - implementation of pmem_mmap, pmem_unmap, pmem_msync and
18 ; pmem_mprotect functions in libpmem (pmem_unmap and pmem_msync are
20 ; - making sure that all the PMDK libraries never call mmap, munmap,
21 ; msync and mprotect directly, but only through their libpmem counterparts;
22 ; - new pmem_mmap() function must provide similar functionality to
23 ; mmap(), i.e. it must take 'offset' argument, but should not take
24 ; file descriptor argument. Perhaps it could be an opaque handle
25 ; to the file, that is internally casted to a file descriptor
26 ; or a HANDLE, depending on the OS.