sched/signal: update nxsig_clockwait() to support disable all signals

Update nxsig_clockwait() to handle the case where all signals functions
are disabled.

Signed-off-by: Chengdong Wang <wangchengdong@lixiang.com>
This commit is contained in:
wangchengdong
2026-02-26 11:18:00 +08:00
committed by Xiang Xiao
parent 8514e9978f
commit 9c80011c53
3 changed files with 32 additions and 23 deletions
+18 -18
View File
@@ -20,25 +20,25 @@
#
# ##############################################################################
set(SRCS sig_nanosleep.c sig_usleep.c sig_sleep.c sig_clockwait.c)
if(NOT CONFIG_DISABLE_ALL_SIGNALS)
set(SRCS
sig_procmask.c
sig_suspend.c
sig_kill.c
sig_tgkill.c
sig_queue.c
sig_waitinfo.c
sig_timedwait.c
sig_lowest.c
sig_notification.c
sig_dispatch.c
sig_pause.c
sig_clockwait.c
sig_nanosleep.c
sig_usleep.c
sig_sleep.c
sig_ppoll.c
sig_pselect.c)
list(
APPEND
SRCS
sig_procmask.c
sig_suspend.c
sig_kill.c
sig_tgkill.c
sig_queue.c
sig_waitinfo.c
sig_timedwait.c
sig_lowest.c
sig_notification.c
sig_dispatch.c
sig_pause.c
sig_ppoll.c
sig_pselect.c)
endif()
if(CONFIG_ENABLE_ALL_SIGNALS)
+6 -3
View File
@@ -19,11 +19,14 @@
# under the License.
#
############################################################################
CSRCS += sig_nanosleep.c sig_sleep.c sig_usleep.c sig_clockwait.c
ifneq ($(CONFIG_DISABLE_ALL_SIGNALS),y)
CSRCS += sig_dispatch.c sig_kill.c sig_lowest.c sig_nanosleep.c
CSRCS += sig_dispatch.c sig_kill.c sig_lowest.c
CSRCS += sig_notification.c sig_pause.c sig_ppoll.c sig_procmask.c
CSRCS += sig_pselect.c sig_queue.c sig_sleep.c sig_suspend.c sig_tgkill.c
CSRCS += sig_timedwait.c sig_usleep.c sig_waitinfo.c sig_clockwait.c
CSRCS += sig_pselect.c sig_queue.c sig_suspend.c sig_tgkill.c
CSRCS += sig_timedwait.c sig_waitinfo.c
endif
ifeq ($(CONFIG_ENABLE_ALL_SIGNALS),y)
+8 -2
View File
@@ -109,17 +109,23 @@ void nxsig_wait_irq(FAR struct tcb_s *wtcb, uint8_t signo,
{
FAR struct tcb_s *rtcb = this_task();
#ifdef CONFIG_DISABLE_ALL_SIGNALS
UNUSED(signo);
UNUSED(code);
UNUSED(errcode);
#else
if (wtcb->sigunbinfo != NULL)
{
wtcb->sigunbinfo->si_signo = signo;
wtcb->sigunbinfo->si_code = code;
wtcb->sigunbinfo->si_errno = errcode;
wtcb->sigunbinfo->si_value.sival_int = 0;
#ifdef CONFIG_SCHED_HAVE_PARENT
# ifdef CONFIG_SCHED_HAVE_PARENT
wtcb->sigunbinfo->si_pid = 0; /* Not applicable */
wtcb->sigunbinfo->si_status = OK;
#endif
# endif
}
#endif
/* Remove the task from waiting list */