c++osx-lion

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


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

Solution

  • mqueue.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.