C++ boost::进程间::消息队列权限被拒绝
因此,我使用boost 1.47编写了以下代码:C++ boost::进程间::消息队列权限被拒绝,c++,boost,ipc,C++,Boost,Ipc,因此,我使用boost 1.47编写了以下代码: try { m_messageQueue = boost::shared_ptr<boost::interprocess::message_queue>( new boost::interprocess::message_queue ( boost::interprocess::open_or_create ,name.c_str()
try
{
m_messageQueue = boost::shared_ptr<boost::interprocess::message_queue>(
new boost::interprocess::message_queue (
boost::interprocess::open_or_create
,name.c_str() //name
,numElements //max message number
,sizeof(Message) //max message size
));
}
catch(boost::interprocess::interprocess_exception &e)
{
cerr << e.what();
}
试试看
{
m_messageQueue=boost::shared_ptr(
新的boost::进程间::消息队列(
boost::进程间::打开或创建
,name.c_str()//name
,numElements//max message number
,sizeof(Message)//最大消息大小
));
}
捕获(boost::进程间::进程间异常&e)
{
cerr我在Centos 5.5上。对我来说,需要将运行队列的用户的umask设置为022。
在我将其设置为.bashrc之后,所有工作都按预期进行