Subject: Re: [boost] Boost managed_shared_memory not working with C's mmap call on freeBSD
From: Frank Mori Hess (fmh6jj_at_[hidden])
Date: 2018-02-27 07:39:09
On Feb 27, 2018 5:39 AM, "vijay sharma via Boost" <boost_at_[hidden]>
I am having two processes and they are sharing shared-memory.
- Process-1 (implemented in c++ and using
- Process-2 (implemented in c and using "she_open" and "mmap" interfaces)
This code was working fine on Linux But When I deployed same code on
FreeBSD. Process-2 (C lang based) is keep on throwing error in mmap. Error
is "Bad file Descriptor".
Please let me know:
1. Do I need to change the interface while moving from Linux to FreeBSD.
2. Is there any known issue with this design.
obj = new boost::interprocess::managed_shared_memory(
boost::interprocess::open_or_create,<shm_name>, <shm_size>); // to
obj->allocate(<data_size>) ; // to write in shm
int fd = shm_open(<shm_name>,O_RDWR, 0666);void * startpoint =
mmap(NULL, <shm_size>, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); //
using the startpoint to read data written by process-1.
Maybe it is your filesystem. For example, jffs2 doesn't support shared
I have raised same on stackoverflow.com and below is the link:
Unsubscribe & other changes: http://lists.boost.org/