Cannot find include file <mqueue.h> on OS X?

孤街浪徒 提交于 2020-01-05 08:53:50

问题


I am unable to use mqueue.h in mac. When I try to include this header file in my C++ program it says Cannot find include file . Is there a way to use this in mac ? Or are there any universal alternatives to this.

I want to use the O_NOBLOCK flag which is present in mqueue.h ?

I found out that the IPC message queues have the following restrictions which may be useful before making a decision to use them.

Max Number of Msg Queue Identifiers = 16
Max Size of Messages = 8192 (Bytes)
Default Max Size of a Message Queue = 16384

回答1:


mqueueh.h is for POSIX messaging queues, and is not available on OS X. O_NONBLOCK has nothing to do with that, and is defined in fcntl.h.

#include <sys/fcntl.h>

should do the trick.




回答2:


I don't recall what mqueue.h is, but it's not needed for O_NONBLOCK. You want <fcntl.h>.



来源:https://stackoverflow.com/questions/10079403/cannot-find-include-file-mqueue-h-on-os-x

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!