diff options
author | pxinwr <peixing.xin@windriver.com> | 2019-03-13 17:18:25 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2019-03-13 17:18:25 (GMT) |
commit | 8b5bdda5b4c418c4a858f183763d0a497170977c (patch) | |
tree | 80a575182fe29a56488e7d1e99bd75d270e8f464 | |
parent | 9776b0636ae39668d3ce1c006d4be01dad01bf9f (diff) | |
download | cpython-8b5bdda5b4c418c4a858f183763d0a497170977c.zip cpython-8b5bdda5b4c418c4a858f183763d0a497170977c.tar.gz cpython-8b5bdda5b4c418c4a858f183763d0a497170977c.tar.bz2 |
bpo-31904: Adapt the _signal module to VxWorks RTOS (GH-12304)
Limited signal fields in VxWorks.
-rw-r--r-- | Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst | 1 | ||||
-rw-r--r-- | Modules/signalmodule.c | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst b/Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst new file mode 100644 index 0000000..d859446 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2019-03-13-14-55-02.bpo-31904.834kfY.rst @@ -0,0 +1 @@ +Add _signal module support for VxWorks. diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index f29720b..4590017 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -1079,11 +1079,18 @@ fill_siginfo(siginfo_t *si) PyStructSequence_SET_ITEM(result, 0, PyLong_FromLong((long)(si->si_signo))); PyStructSequence_SET_ITEM(result, 1, PyLong_FromLong((long)(si->si_code))); +#ifdef __VXWORKS__ + PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(0L)); + PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(0L)); + PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(0L)); + PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(0L)); +#else PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong((long)(si->si_errno))); PyStructSequence_SET_ITEM(result, 3, PyLong_FromPid(si->si_pid)); PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid)); PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong((long)(si->si_status))); +#endif #ifdef HAVE_SIGINFO_T_SI_BAND PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band)); #else |