Javinator9889 opened a new pull request, #15085:
URL: https://github.com/apache/nuttx/pull/15085

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   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/fcntl.h.html).
   
   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/time.h.html).
   
   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>`](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/fcntl.h.html),
 
[`<signal.h>`](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/signal.h.html),
 and 
[`<time.h>`](https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html).
   
   So having those `include`s shouldn't be an issue.
   
   ## Impact
   
   * There will be a unified behavior across platforms, where the same `.h` 
file using `mqueue` builds on any POSIX-compliant system.
   * Potential code reduction where those headers were added for the code to 
work.
   * New code conforming to the standard, fewer edge cases.
   
   ## Testing
   
   As this change does not affect code behavior but adds some missing headers, 
no derived bugs are expected. The heavy lifting was leveraged to the CI system.
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to