Good morning NuttX devs,

This is Javi. I'm writing you regarding a compliant bug regarding the mqueue
header and POSIX. The IEEE Std 1003.1-2024 states that some symbols should
be exposed when doing #include <mqueue.h> but are missing in the "
include/mqueue.h" NuttX version, failing to comply with the standard.

I had a look at the NuttX Community page, which suggests sending an email
with all the details so the developers can easily check this. I have
attached the patch with the changes and created a PR in GitHub (#15085
<https://github.com/apache/nuttx/pull/15085>), as it wasn't clear to me
what's the preferred procedure.

Have a nice day,

Javier Alonso Silva (he, him, his)
Geotab

Embedded Systems Developer | GEUR


*Quickly schedule a meeting <https://calendar.app.google/DRoGm4sLw89JC8At6>*

Toll-free

Visit

+34 900 535 371
www.geotab.com/es

Twitter <https://twitter.com/geotab> | Facebook
<https://www.facebook.com/Geotab> | YouTube
<https://www.youtube.com/user/MyGeotab> | LinkedIn
<https://www.linkedin.com/company/geotab/>
From 466649025556441853f572f86c4d7ca092a11871 Mon Sep 17 00:00:00 2001
From: Javier Alonso <javieralo...@geotab.com>
Date: Mon, 9 Dec 2024 09:34:26 +0100
Subject: [PATCH] [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.

Signed-off-by: Javier Alonso <javieralo...@geotab.com>
---
 include/mqueue.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/mqueue.h b/include/mqueue.h
index 8fb6c4470b..3590e9a018 100644
--- a/include/mqueue.h
+++ b/include/mqueue.h
@@ -27,8 +27,10 @@
  * Included Files
  ****************************************************************************/
 
+#include <fcntl.h>
 #include <sys/types.h>
 #include <signal.h>
+#include <time.h>
 
 /****************************************************************************
  * Pre-processor Definitions
-- 
2.47.0

Reply via email to