简体   繁体   中英

mq_unlink setting errno to EEXIST

I'm using message queues for inter-thread communication in a server. The server was functioning as expected on Thursday evening. When I picked the project back up on Monday, it was unable to create two of the six queues in use, citing that they were already open (O _ EXCL is set). This should not have been the case, but nevertheless I added an mq _ unlink call with error checking and removed the O _ EXCL flag from mq _ open.

When I compiled and ran, the errno was set to EEXIST by both mq _ unlink and mq _ open. This should be a can't happen: mq _ unlink can't set errno to EEXIST under any circumstances, and mq _ open can only set EEXIST when the O _ EXCL flag is set.

Any ideas why this is happening?

I believe that this is a Solaris bug. Check for a lock file (usually /var/tmp/.MQL/ ...) and remove it if you know the message queue is not in use. That should allow the unlink to succeed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM