I am trying to create a POSIX message queue in one of my COMPONENT_INIT functions and I am getting errno = 24 from the mq_open() which is the EMFILE error code. But it is the only message queue that I am trying to create in my component and my process in general (currently 2 components).
I do issue a cat /proc/sys/fs/mqueue/queues_max command it says 256, but I am only trying to open 1 queue. I am opening 1 other UART device (/dev/ttyHSL1).
Effectively I just want 1 component to set up the UART device and the other start a thread that waits on a message with serial data from the UART (invoking the mq_send from the SIGIO signal handler).
Yes, the process is an app. I’m just running as the app’s user. And besides the device I’m opening it is the only file descriptor that I am opening and the rlimit is set to 256.
I cannot reproduce your problem here. I am able to create message queues in sandboxed and unsandboxed apps. How do you start the app? If you could send me your adef and sources I can test it here.
I am just installing and starting it through the Remote System Explorer in Developer Studio. I’ve just attached the whole project for you. Debug_project.tar.gz (28.1 KB)
I think that is the issue. But now when I set the mqueueSize to 10240 and install and start the application, I still get:
01:20:46 -WRN- | supervisor[724]/supervisor T=main | resourceLimits.c SetRLimit() 264 | No resource limit totalPosixMsgQueueSizeLimit. Using the default value 512.
01:20:46 INFO | supervisor[724]/supervisor T=main | resourceLimits.c SetRLimit() 296 | Setting resource limit totalPosixMsgQueueSizeLimit to value 512.
output from the console
I can lower mq_msgsize and mq_maxmsg so it totals under 512 bytes and I can open the message queue with no problems. Here’s what my adef file looks like, maybe I’m defining it wrong?