消息隊列 mq_queue,報錯: message too long

原因說明:

原因很簡單,要注意看LINUX man手冊,man 3 mq_receive裏明確說了,“The msg_len argument must be greater than or equal to the mq_msgsize attribute of the queue(see mq_getattr(3))”。同理,在man 3 mq_send時,msg_len必須小於或等於 mq_msgsize。如果不注意,就會報 message too long的錯誤。

參考鏈接:

mq_receive: message too long

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章