Boost::interprocess::message_queue权限被拒绝
boost::interprocess::message_queue permission denied
所以我有下面的代码与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() //name
,numElements //max message number
,sizeof(Message) //max message size
));
}
catch(boost::interprocess::interprocess_exception &e)
{
cerr << e.what();
}
where name="test_queue", numElements=100, sizeof(Message)=256.
输出如下:没有权限
如果我以root用户运行,它将通过。我不知道它要写到哪里,哪里会有权限错误。看看boost代码,它不应该只是在/tmp/boost_interprocess中,任何用户都可以访问它来创建和写入吗?另外,我注意到https://svn.boost.org/trac/boost/ticket/4250,但是现在应该修复了。
我使用的是Centos 5.5。对我来说,需要将运行队列的用户的掩码设置为022。当我在。bashrc中设置后,所有工作都如预期的那样。
相关文章:
- Termux权限被拒绝
- AWS Lambda C++运行时权限被拒绝
- 为什么 KMS drmModeSetCrtc() 在 X11 会话中运行时会失败并被拒绝权限?
- 使用崇高文本 3 进行C++拒绝授予权限?
- 安卓inotify_add_watch失败:权限被拒绝?
- clang --版本权限被拒绝错误
- 为什么 mkdir() 后跟 ofstream::operator<< 失败并被拒绝权限?
- QSSLSLSOCKETS无法解决和权限拒绝错误
- 运行简单 c++ 程序时出现权限被拒绝错误
- Apache HTTPD模块共享内存权限拒绝了错误
- CLION无法打开输出文件,拒绝了权限
- 无法打开输出文件___.exe:权限被拒绝
- 写入文件权限被拒绝
- .out 使用 -c 指令和 g++ 拒绝权限
- 当我使用 remove() 时权限被拒绝
- Linux 拒绝使用 boost asio 的套接字绑定权限
- 获取错误 - 启用权限后,OpenProcess() 中的访问被拒绝
- 连接到Boost.Asio创建的域套接字时权限被拒绝
- 无法打开输出文件:binDebugPrimeChecker.exe权限被拒绝
- 对解压缩文件(popen)的权限被拒绝