Like we can do, poll/epoll/select on an fd, we can not on msg queue id. I found some non standard methods to make msgqueue-id to fd, but afterall its a non standard. So my q
I'm surprised that it doesn't just work, but if it doesn't, I suspect the reason is to avoid encouraging such a non-portable practice. While message queue descriptors are allowed to be file descriptors, they're not required to be, and code that assumes they're file descriptors (and thus occupy the same "numberspace") is non-portable.
If you need file descriptors, you'd probably be better off just using Unix sockets or some other mechanism in place of message queues. Message queues seem to be intended for use with real-time programming with threads where select
/poll
-based event-driven IO is generally not used.