I can get the total number of messages in queue with msgctl(int msqid, int cmd, struct msqid_ds *buf) with using IPC_STAT as cmd and the msg_qnum field of msqid_ds struct. Is there a way to know the number of elements for a specific priority like 1, 2 etc.?