The msgrcv() function reads a message from the queue associated with the message queue identifier specified by msgid and places it in the user-defined buffer pointed to by msgp. ... The structure member, mtext , is the text of the message.
Is Msgrcv a blocking call?
The msgsnd(2) and msgrcv(2) functions can be performed as either blocking or non-blocking operations. A blocked message operation remains suspended until one of the following three conditions occurs: The call succeeds.
Does msgrcv remove the message from the queue?
The msgrcv() system call removes a message from the queue specified by msqid and places it in the buffer pointed to by msgp.