The answer is here:
If you explicitly specify "IPC_NOWAIT" in your flags argument, then it'll return "-1", and errno will contain "ENOMSG". Otherwise, msgrcv will block until a message does arrive.
PS:
This post would probably have been more appropriate for the "programming" forum...