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 561d3b618e6efba239ed698d68bfb3b1702c43b4
Author: guoshichao <[email protected]>
AuthorDate: Tue Aug 26 20:02:09 2025 +0800

    signal: make sigqueue() and siginfo_t POSIX-compliant
    
    POSIX requires the sigqueue() prototype int sigqueue(pid_t, int,
    const union sigval) and that the siginfo_t members si_signo and
    si_code have type int.  Widen the two siginfo_t fields from uint8_t
    and add the const qualifier to the value parameter of sigqueue() and
    nxsig_queue().  The syscall table type string keeps the unqualified
    union form: tools/mksyscall matches union parameters by the strict
    "union " prefix, and a const prefix would break proxy/stub generation.
    
    Signed-off-by: guoshichao <[email protected]>
    Signed-off-by: zhangyuan29 <[email protected]>
---
 include/nuttx/signal.h   | 2 +-
 include/signal.h         | 6 +++---
 sched/signal/sig_queue.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h
index 94db03d0afc..5d078bf743e 100644
--- a/include/nuttx/signal.h
+++ b/include/nuttx/signal.h
@@ -416,7 +416,7 @@ int nxsig_action(int signo, FAR const struct sigaction *act,
  *
  ****************************************************************************/
 
-int nxsig_queue(int pid, int signo, union sigval value);
+int nxsig_queue(int pid, int signo, const union sigval value);
 
 /****************************************************************************
  * Name: nxsig_kill
diff --git a/include/signal.h b/include/signal.h
index 22121fb4526..ba7b13f99aa 100644
--- a/include/signal.h
+++ b/include/signal.h
@@ -377,8 +377,8 @@ typedef struct sigevent
 
 struct siginfo
 {
-  uint8_t      si_signo;     /* Identifies signal */
-  uint8_t      si_code;      /* Source: SI_USER, SI_QUEUE, SI_TIMER, 
SI_ASYNCIO, or SI_MESGQ */
+  int          si_signo;     /* Identifies signal */
+  int          si_code;      /* Source: SI_USER, SI_QUEUE, SI_TIMER, 
SI_ASYNCIO, or SI_MESGQ */
   uint8_t      si_errno;     /* Zero or errno value associated with signal */
   union sigval si_value;     /* Data passed with signal */
 #ifdef CONFIG_SCHED_HAVE_PARENT
@@ -473,7 +473,7 @@ int  sigorset(FAR sigset_t *dest, FAR const sigset_t *left,
 int  sigpause(int signo);
 int  sigpending(FAR sigset_t *set);
 int  sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset);
-int  sigqueue(int pid, int signo, union sigval value);
+int  sigqueue(int pid, int signo, const union sigval value);
 int  sigrelse(int signo);
 _sa_handler_t sigset(int signo, _sa_handler_t func);
 int  sigwait(FAR const sigset_t *set, FAR int *sig);
diff --git a/sched/signal/sig_queue.c b/sched/signal/sig_queue.c
index 98b13a4161e..b52b3d5fa62 100644
--- a/sched/signal/sig_queue.c
+++ b/sched/signal/sig_queue.c
@@ -126,7 +126,7 @@ static int nxsig_queue_send(int pid, int signo, union 
sigval value,
  *
  ****************************************************************************/
 
-int nxsig_queue(int pid, int signo, union sigval value)
+int nxsig_queue(int pid, int signo, const union sigval value)
 {
   return nxsig_queue_send(pid, signo, value, false);
 }
@@ -163,7 +163,7 @@ int nxsig_queue(int pid, int signo, union sigval value)
  *
  ****************************************************************************/
 
-int sigqueue(int pid, int signo, union sigval value)
+int sigqueue(int pid, int signo, const union sigval value)
 {
   int ret;
 

Reply via email to