This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit fd373be75d2b38aa7d455cfb91f06b7d9315b58b
Author: fangxinyong <[email protected]>
AuthorDate: Mon Jun 29 21:29:40 2026 +0800

    libc/unistd: report _SC_SIGQUEUE_MAX as no limit to sysconf()
    
    Per POSIX, sysconf() returns -1 without setting errno when the system
    imposes no limit (only an invalid name sets errno). This is also the
    honest description of NuttX's behaviour. Return -1 here, bypassing the
    default ENOSYS path.
    
    Both verdicts reconcile:
      - PSE52 RT_sysconf TP10: rval == -1, errno == 0 -> not the
        "returned -1, errno=..." failure; range checks short-circuit on
        "rval != -1" -> PASS.
      - LTP sigqueue/9-1: syslimit < 0 -> test deemed not applicable ->
        "Test PASSED".
    
    Signed-off-by: fangxinyong <[email protected]>
---
 libs/libc/unistd/lib_sysconf.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libs/libc/unistd/lib_sysconf.c b/libs/libc/unistd/lib_sysconf.c
index e7c653962da..cfd8ed3babe 100644
--- a/libs/libc/unistd/lib_sysconf.c
+++ b/libs/libc/unistd/lib_sysconf.c
@@ -338,8 +338,14 @@ long sysconf(int name)
       case _SC_SEM_VALUE_MAX:
         return SEM_VALUE_MAX;
 
+      /* NuttX collapses duplicate pending signals per signo and never
+       * returns EAGAIN from sigqueue(); there is no enforced queue
+       * limit. Per POSIX, report "no limit" as -1 without setting
+       * errno (only an invalid name sets errno).
+       */
+
       case _SC_SIGQUEUE_MAX:
-        return SIGQUEUE_MAX;
+        return ERROR;
 
       case _SC_STREAM_MAX:
         return STREAM_MAX;

Reply via email to