Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapped file base address is not honored #46

Open
bovine opened this issue Jan 6, 2015 · 3 comments
Open

Mapped file base address is not honored #46

bovine opened this issue Jan 6, 2015 · 3 comments

Comments

@bovine
Copy link
Member

bovine commented Jan 6, 2015

Karl reports that the base address specified for the memory mapped file may not be actually honored and that a self-assigned address is used instead.

@gahr
Copy link
Collaborator

gahr commented Jan 7, 2015

I haven't looked at the code, but the MAP_FIXED flag to mmap comes to mind. Is that used already?

@resuna
Copy link
Member

resuna commented Jan 7, 2015

I had that in the original code.

if(addr == (char *)-1)
    addr = 0;
if(addr) flags |= MAP_FIXED;
map = mmap(addr, size, PROT_READ|PROT_WRITE, flags, fd, (off_t) 0);

It now looks like it's calling a BOOST API that may not provide as much
control:

#include <boost/interprocess/managed_mapped_file.hpp>
...

if (create != 0) { mmf = new managed_mapped_file(open_or_create, file,
default_size, (void_)addr); } else { mmf = new managed_mapped_file(open_only,
file, (void_)addr); }
Need to check what Boost is doing.

On Wed, Jan 7, 2015 at 2:24 AM, Pietro Cerutti notifications@github.com
wrote:

I haven't looked at the code, but the MAP_FIXED flag to mmap comes to
mind. Is that used already?


Reply to this email directly or view it on GitHub
#46 (comment)
.

@resuna
Copy link
Member

resuna commented Apr 7, 2016

This might be worked on alongside the fix to issue #38 if boost allows for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants