You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Michal Lenc <mi...@seznam.cz> on 2025/04/28 18:20:51 UTC
Setlogmask behavior not in compliance with POSIX
Hi all,
just bringing the attention to the mailing list as well. I have
submitted a pull request that fixes the behavior of setlogmask function.
POSIX standard states passing zero mask as an argument should not modify
the current logging mask and just return it. However, our NuttX
implementation uses 0 to disable the logging. This is in a violation
with POSIX standard and thus with The Inviolable Principles of NuttX
(strict POSIX compliance part). It also makes Linux <-> NuttX
application porting harder as the behavior is different compared to
other POSIX systems.
Feel free to share your thoughts here or in the pull request comments,
but I think it shouldn't be a problem to merge the fix. It is, however,
a breaking change.
The PR: https://github.com/apache/nuttx/pull/16280
Best regards,
Michal
Re: Setlogmask behavior not in compliance with POSIX
Posted by Tomek CEDRO <to...@cedro.info>.
Thank you Michal good catch! :-)
As this is breaking change for NuttX and may change existing
applications/projects, but aligns with POSIX, please start a vote on
the mailing list, and if the votes approve we can merge it :-) Until
then please switch PR to Draft mode. Thanks! :-)
Also if current NuttX behavior of providing mask 0 disables logging,
it would be nice to provide hint directly in the git commit message
what would be new correct behavior to disable logging if someone needs
to update their code :-)
Thank you :-)
Tomek
On Mon, Apr 28, 2025 at 8:22 PM Michal Lenc <mi...@seznam.cz> wrote:
>
> Hi all,
>
> just bringing the attention to the mailing list as well. I have
> submitted a pull request that fixes the behavior of setlogmask function.
> POSIX standard states passing zero mask as an argument should not modify
> the current logging mask and just return it. However, our NuttX
> implementation uses 0 to disable the logging. This is in a violation
> with POSIX standard and thus with The Inviolable Principles of NuttX
> (strict POSIX compliance part). It also makes Linux <-> NuttX
> application porting harder as the behavior is different compared to
> other POSIX systems.
>
> Feel free to share your thoughts here or in the pull request comments,
> but I think it shouldn't be a problem to merge the fix. It is, however,
> a breaking change.
>
> The PR: https://github.com/apache/nuttx/pull/16280
>
> Best regards,
>
> Michal
>
--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info