Dhruv Arya
Dhruv Arya

Reputation: 105

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

Upvotes: 1

Views: 9080

Answers (2)

Mahmoud Al-Qudsi
Mahmoud Al-Qudsi

Reputation: 29579

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.

Upvotes: 4

Ken Thomases
Ken Thomases

Reputation: 90671

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

Upvotes: 0

Related Questions