Add si_errno to siginfo_t

This commit is contained in:
Gregory Nutt 2015-08-14 10:10:32 -06:00
parent 6df94096ca
commit 768d892188
10 changed files with 16 additions and 5 deletions

View file

@ -216,6 +216,7 @@ struct siginfo
{
uint8_t si_signo; /* Identifies signal */
uint8_t 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
pid_t si_pid; /* Sending task ID */

View file

@ -1,7 +1,7 @@
/****************************************************************************
* sched/pthread/pthread_condtimedwait.c
*
* Copyright (C) 2007-2009, 2013-2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2013-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -119,6 +119,7 @@ static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo)
info.si_signo = signo;
info.si_code = SI_QUEUE;
info.si_errno = ETIMEDOUT;
info.si_value.sival_ptr = NULL;
#ifdef CONFIG_SCHED_HAVE_PARENT
info.si_pid = (pid_t)pid;

View file

@ -116,6 +116,7 @@ int pthread_kill(pthread_t thread, int signo)
info.si_signo = signo;
info.si_code = SI_USER;
info.si_errno = EINTR;
info.si_value.sival_ptr = NULL;
#ifdef CONFIG_SCHED_HAVE_PARENT
info.si_pid = rtcb->pid;

View file

@ -68,11 +68,12 @@ static void exited_child(FAR struct tcb_s *rtcb, FAR struct child_status_s *chil
FAR siginfo_t *info)
{
/* The child has exited. Return the saved exit status (and some fudged
* information.
* information).
*/
info->si_signo = SIGCHLD;
info->si_code = CLD_EXITED;
info->si_errno = OK;
info->si_value.sival_ptr = NULL;
info->si_pid = child->ch_pid;
info->si_status = child->ch_status;

View file

@ -1,7 +1,7 @@
/************************************************************************
* sched/signal/sig_kill.c
*
* Copyright (C) 2007, 2009, 2011, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2011, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -114,6 +114,7 @@ int kill(pid_t pid, int signo)
info.si_signo = signo;
info.si_code = SI_USER;
info.si_errno = EINTR;
info.si_value.sival_ptr = NULL;
#ifdef CONFIG_SCHED_HAVE_PARENT
info.si_pid = rtcb->pid;

View file

@ -1,7 +1,7 @@
/****************************************************************************
* sched/signal/sig_mqnotempty.c
*
* Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -112,6 +112,7 @@ int sig_mqnotempty(int pid, int signo, void *sival_ptr)
info.si_signo = signo;
info.si_code = SI_MESGQ;
info.si_errno = OK;
#ifdef CONFIG_CAN_PASS_STRUCTS
info.si_value = value;
#else

View file

@ -135,6 +135,7 @@ int sigqueue(int pid, int signo, void *sival_ptr)
info.si_signo = signo;
info.si_code = SI_QUEUE;
info.si_errno = OK;
#ifdef CONFIG_CAN_PASS_STRUCTS
info.si_value = value;
#else

View file

@ -115,6 +115,7 @@ static void sig_timeout(int argc, wdparm_t itcb)
{
u.wtcb->sigunbinfo.si_signo = SIG_WAIT_TIMEOUT;
u.wtcb->sigunbinfo.si_code = SI_TIMER;
u.wtcb->sigunbinfo.si_errno = ETIMEDOUT;
u.wtcb->sigunbinfo.si_value.sival_int = 0;
#ifdef CONFIG_SCHED_HAVE_PARENT
u.wtcb->sigunbinfo.si_pid = 0; /* Not applicable */

View file

@ -1,7 +1,7 @@
/****************************************************************************
* sched/task/task_exithook.c
*
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -343,6 +343,7 @@ static inline void task_sigchild(gid_t pgid, FAR struct tcb_s *ctcb, int status)
info.si_signo = SIGCHLD;
info.si_code = CLD_EXITED;
info.si_errno = OK;
info.si_value.sival_ptr = NULL;
#ifndef CONFIG_DISABLE_PTHREAD
info.si_pid = chgrp->tg_task;
@ -394,6 +395,7 @@ static inline void task_sigchild(FAR struct tcb_s *ptcb,
info.si_signo = SIGCHLD;
info.si_code = CLD_EXITED;
info.si_errno = OK;
info.si_value.sival_ptr = NULL;
#ifndef CONFIG_DISABLE_PTHREAD
info.si_pid = ctcb->group->tg_task;

View file

@ -100,6 +100,7 @@ static inline void timer_sigqueue(FAR struct posix_timer_s *timer)
info.si_signo = timer->pt_signo;
info.si_code = SI_TIMER;
info.si_errno = OK;
#ifdef CONFIG_CAN_PASS_STRUCTS
info.si_value = timer->pt_value;
#else