From mboxrd@z Thu Jan 1 00:00:00 1970 References: From: Paul Janzen Date: Thu, 09 Apr 2015 14:11:53 -0700 In-Reply-To: (Phil Mitchell's message of "Thu, 9 Apr 2015 16:52:26 -0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Xenomai] Why does mqueue.h define mqd_t as unsigned List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Phil Mitchell Cc: Xenomai Mailing List Phil Mitchell writes: > mqueue.h defines mqd_t as an unsigned long. The function mq_open returns > type mqd_t and states that -1 is returned in case of error. > > Is mqd_t defined incorrectly or am I missing something? The man page says mq_open returns (mqd_t)(-1) on error. If you include that cast when you test the return value it works, even if mqd_t is unsigned. (Or a pointer.) -- Paul