views:

27

answers:

1

POSIX provides a way to read a message queue using its mq_receive function. This function also removes it from the queue. I need to find a way to check to see if a message is in the queue without removing it.

A: 

From the Linux mq_overview(7) man page:

Polling message queue descriptors


On Linux, a message queue descriptor is actually a file descriptor, and can be monitored using select(2), poll(2), or epoll(7). This is not portable.
ninjalj
Thanks.Right I have "faked" it in order to get it to work by immediatedly doing a mq_send with a high priority message after using a mq_recieve in a check msg queue fashion.