I'm having a problem with creating mqueues, namely my system appears to block me from creating more than 5 mqueues, even though /proc/sys/fs/mqueue/queues_max is set to 256. I'm running Ubuntu 13.04 server on an a Q7 module system with a Atom E680T, I'm also running a custom compiled kernel (3.8.0) to reduce the kernel size and to add watchdog and i2c access that was missing from the default.
I've checked to make sure that only 5 mqueues are being used by mounting the mqueue interface, after 5 have been created it won't let me create a 6th, returning a "Too many open files." error. To make sure there was nothing wrong with the function call I deleted one of the existing queues and ran my program again and it successfully created the queue.
I'm currently at a loss, the information I can find indicates that /proc/sys/fs/mqueue/queues_max should control the limit, and that defaults to 256. But modifiying this or any other file in that folder doesn't appeart to help.
So if anyone can point me in the right direction as to where this limit could be I would be grateful, for the most part the mqueues are being created with variations of this:
mq_attr attribs;
//initialise the incoming message queue.
printLog ("I2C MANAGER: Registering mqueue.\n");
// Set attributes for main message queue
attribs.mq_maxmsg = 512;
attribs.mq_msgsize = sizeof(t_io_message);
attribs.mq_flags=0;
// Create the queue
in_queue = mq_open(I2C_MQUEUE, O_RDONLY|O_CREAT, 0666, &attribs);
// Check queue was successfully created
if (-1 == in_queue)
{
printLogf ("I2C MANAGER: Error unable to register mqueue /i2c-manager: %s.\n", strerror(errno));
exit(1);
}
else
{
printLog ("I2C MANAGER: Mqueue Initialisation succesfull.\n");
}