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).
What could be the cause of this error?