我有一个消息队列,我从中循环获取消息。问题是我不知道如何退出循环。msgrcv 返回类型 size_t 所以它继续。我应该比较返回值什么值才能退出循环?
while(msgrcv(msqid, &msgreceived, sizeof(msgreceived), BUFFER_CHANGED, 0) != -1){
printf("%d %d %d %d ",msgreceived.value0,msgreceived.value1,msgreceived.value2,msgreceived.value3);