Skip navigation.
Home
The QNX Community Portal

View topic - mq_open() is failed with errno 78

Page 1 of 1

mq_open() is failed with errno 78

PostPosted: Wed Mar 30, 2016 11:32 am
by nava
Hi
I am calling mq_open as
mq_open(qname, O_WRONLY|O_CREAT|O_NONBLOCK, 0666, &mqattr );
in regression test mq_open is failed with errno 78
I checked qname and found that its size less than 64
however I found that errno 78 indicates ENAMETOOLONG The length of name exceeds PATH_MAX
ref: http://www.qnx.com/developers/docs/6.3. ... ml?lang=de
what are the possible cases/reasons that mq_open() failed with 78
I am linking my sample app with -lmq
could you please guide me to solve this issue

Thanks And Regards,
nava

Re: mq_open() is failed with errno 78

PostPosted: Wed Mar 30, 2016 1:44 pm
by space
Try using a hard coded queue name.
mq_open( "test1", O_WRONLY|O_CREAT|O_NONBLOCK, 0666, &mqattr );

Make sure it shows up at "/dev/mq/test1" after it is created.

Are you using a mq to communicate with a non-QNX system?

Re: mq_open() is failed with errno 78

PostPosted: Thu Mar 31, 2016 5:13 am
by nava
I tried to hard code the value and run the test ..
able to get the "/dev/mq/test1"
but while doing regression test it failed and test1 is present.
I am not sure why it is there .. because I did not call mq_unlink() so it is still present
I am communicating with other process running on same qnx system

Re: mq_open() is failed with errno 78

PostPosted: Thu Mar 31, 2016 2:21 pm
by Tim
Can you post your code and by that I don't just mean 1-2 lines, as much of the regression test code as you can.

Are you running as root?

Tim

Re: mq_open() is failed with errno 78

PostPosted: Sat Apr 02, 2016 11:25 am
by denkelly
>>>because I did not call mq_unlink() so it is still present
Yes - the name remains when the server that created it dies

>>>I am communicating with other process running on same qnx system
Actually "no process" - which is why the next open fails

Create a server signal handler which on exit, deletes the filesystem entry.

Re: mq_open() is failed with errno 78

PostPosted: Tue Apr 05, 2016 4:59 am
by nava
Hi Tim and denkelly,

thanks for the inputs
sorry Tim I could not share the code . It is proprietary code
I am trying signal handler mechanism , will post you soon
is any qnx tool or utility help me to do analysis