[POSIX][Bug] mqueue.h: Include file does not conform the standard

The Open Group Base Specification IEEE Std 1003.1-2024 states that

> The <mqueue.h> header shall define O_RDONLY, O_WRONLY, O_RDWR,
> O_CREAT, O_EXCL, and O_NONBLOCK as described in <fcntl.h>.
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/mqueue.h.html

It also states that:

> The <mqueue.h> header shall define the struct timespec structure as described in <time.h>.
https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/mqueue.h.html

The way the `mqueue.h` include file is defined right now violates the
standard, having potentially different code depending on the platform the
code is being compiled against - assuming a multi-arch POSIX environment.

The standard also states that:

> Inclusion of the <mqueue.h> header may make visible symbols defined
> in the headers <fcntl.h>, <signal.h>, and <time.h>.

So having those includes shouldn't be an issue.
This commit is contained in:
Javier Alonso 2024-12-09 09:34:26 +01:00 committed by Xiang Xiao
parent 0d0638ac98
commit d1772e1432

View file

@ -27,8 +27,10 @@
* Included Files
****************************************************************************/
#include <fcntl.h>
#include <sys/types.h>
#include <signal.h>
#include <time.h>
/****************************************************************************
* Pre-processor Definitions