问题
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