Squashed commit of the following:

Replace all calls to sigqueue() in the OS proper with calls to nxsig_queue() to avoid accessing the errno variable.

    sched/signal:  Add nxsig_queue() which is functionally equivalent to sigqueue() except that it does not modify the errno variable.
This commit is contained in:
Gregory Nutt
2017-10-07 10:57:09 -06:00
parent 2318f895df
commit 4810499d3a
18 changed files with 220 additions and 112 deletions
+7 -4
View File
@@ -58,9 +58,10 @@
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/signal.h>
#include <nuttx/random.h>
#include <nuttx/fs/fs.h>
#include <nuttx/input/ajoystick.h>
#include <nuttx/random.h>
#include <nuttx/irq.h>
@@ -376,10 +377,12 @@ static void ajoy_sample(FAR struct ajoy_upperhalf_s *priv)
#ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;
value.sival_int = (int)sample;
(void)sigqueue(opriv->ao_pid, opriv->ao_notify.an_signo, value);
(void)nxsig_queue(opriv->ao_pid, opriv->ao_notify.an_signo,
value);
#else
(void)sigqueue(opriv->ao_pid, opriv->ao_notify.dn.signo,
(FAR void *)sample);
(void)nxsig_queue(opriv->ao_pid, opriv->ao_notify.dn.signo,
(FAR void *)sample);
#endif
}
#endif
+6 -4
View File
@@ -54,9 +54,10 @@
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/signal.h>
#include <nuttx/random.h>
#include <nuttx/fs/fs.h>
#include <nuttx/input/buttons.h>
#include <nuttx/random.h>
#include <nuttx/irq.h>
@@ -358,10 +359,11 @@ static void btn_sample(FAR struct btn_upperhalf_s *priv)
#ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;
value.sival_int = (int)sample;
(void)sigqueue(opriv->bo_pid, opriv->bo_notify.bn_signo, value);
(void)nxsig_queue(opriv->bo_pid, opriv->bo_notify.bn_signo,
value);
#else
(void)sigqueue(opriv->bo_pid, opriv->bo_notify.dn.signo,
(FAR void *)sample);
(void)nxsig_queue(opriv->bo_pid, opriv->bo_notify.dn.signo,
(FAR void *)sample);
#endif
}
#endif
+6 -4
View File
@@ -58,9 +58,10 @@
#include <debug.h>
#include <nuttx/kmalloc.h>
#include <nuttx/signal.h>
#include <nuttx/random.h>
#include <nuttx/fs/fs.h>
#include <nuttx/input/djoystick.h>
#include <nuttx/random.h>
#include <nuttx/irq.h>
@@ -376,10 +377,11 @@ static void djoy_sample(FAR struct djoy_upperhalf_s *priv)
#ifdef CONFIG_CAN_PASS_STRUCTS
union sigval value;
value.sival_int = (int)sample;
(void)sigqueue(opriv->do_pid, opriv->do_notify.dn_signo, value);
(void)nxsig_queue(opriv->do_pid, opriv->do_notify.dn_signo,
value);
#else
(void)sigqueue(opriv->do_pid, opriv->do_notify.dn.signo,
(FAR void *)sample);
(void)nxsig_queue(opriv->do_pid, opriv->do_notify.dn.signo,
(FAR void *)sample);
#endif
}
#endif