我是StackExchange noob,请原谅格式化。
Linux版本3.4.44
分布Angstrom 2011.03 \ n \ l
gcc version 4.3.3
以下代码的输出显示:
m_msgQueue属性: mq_flags = 0 ,mq_maxmsg = 5,mq_msgsize = 15,mq_curmsgs = 0
struct mq_attr stAttr;
int m_msgQueue;
const char* m_pszMsgQueueName = "/ThreadWatchdog";
memset( &stAttr, 0, sizeof(stAttr) );
stAttr.mq_flags = O_NONBLOCK;
stAttr.mq_maxmsg = 5;
stAttr.mq_msgsize = sizeof(THREAD_WATCHDOG_MSG) - 1;
// set up the message queue to receive thread watchdog requests
m_msgQueue = mq_open( m_pszMsgQueueName, O_CREAT | O_RDWR, 666, &stAttr );
if( m_msgQueue > 0 )
{
struct mq_attr stAttr;
mq_getattr( m_msgQueue, &stAttr );
printf("\nm_msgQueue attributes: mq_flags=%ld, mq_maxmsg=%ld, mq_msgsize=%ld, mq_curmsgs=%ld",
stAttr.mq_flags,
stAttr.mq_maxmsg,
stAttr.mq_msgsize,
stAttr.mq_curmsgs
);
我的内核中是否有错误的配置?默认消息队列配置的典型位置是什么?我只在/ proc / sys / fs / mqueue中看到msg_max,msgsize_max和queue_max。