Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6a6967e

Browse files
committed
Issue #21085: add configure check for siginfo_t.si_band
Patch by Masayuki Yamamoto, reviewed and rebased by Erik Bray. This is a first step on the long road toward resupporting Cygwin, which does not provide siginfo_t.si_band.
1 parent efd1bf4 commit 6a6967e

6 files changed

Lines changed: 25 additions & 0 deletions

File tree

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,6 +1671,7 @@ Florent Xicluna
16711671
Arnon Yaari
16721672
Alakshendra Yadav
16731673
Hirokazu Yamamoto
1674+
Masayuki Yamamoto
16741675
Ka-Ping Yee
16751676
Chi Hsuan Yen
16761677
Jason Yeo

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ Windows
173173
Build
174174
-----
175175

176+
- Issue #21085: Add configure check for siginfo_t.si_band, which Cygwin does
177+
not provide. Patch by Masayuki Yamamoto with review and rebase by Erik Bray.
178+
176179
- Issue #28258: Fixed build with Estonian locale (python-config and distclean
177180
targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
178181

Modules/signalmodule.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,11 @@ fill_siginfo(siginfo_t *si)
957957
PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
958958
PyStructSequence_SET_ITEM(result, 5,
959959
PyLong_FromLong((long)(si->si_status)));
960+
#ifdef HAVE_SIGINFO_T_SI_BAND
960961
PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
962+
#else
963+
PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(0L));
964+
#endif
961965
if (PyErr_Occurred()) {
962966
Py_DECREF(result);
963967
return NULL;

configure

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13087,6 +13087,18 @@ cat >>confdefs.h <<_ACEOF
1308713087
_ACEOF
1308813088

1308913089

13090+
fi
13091+
13092+
# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
13093+
ac_fn_c_check_member "$LINENO" "siginfo_t" "si_band" "ac_cv_member_siginfo_t_si_band" "#include <signal.h>
13094+
"
13095+
if test "x$ac_cv_member_siginfo_t_si_band" = xyes; then :
13096+
13097+
cat >>confdefs.h <<_ACEOF
13098+
#define HAVE_SIGINFO_T_SI_BAND 1
13099+
_ACEOF
13100+
13101+
1309013102
fi
1309113103

1309213104

configure.ac

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3907,6 +3907,8 @@ AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
39073907
#include <sys/types.h>
39083908
#include <pwd.h>
39093909
]])
3910+
+# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
3911+
+AC_CHECK_MEMBERS([siginfo_t.si_band], [], [], [[#include <signal.h>]])
39103912

39113913
AC_MSG_CHECKING(for time.h that defines altzone)
39123914
AC_CACHE_VAL(ac_cv_header_time_altzone,[

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,9 @@
856856
/* Define to 1 if you have the `sigaltstack' function. */
857857
#undef HAVE_SIGALTSTACK
858858

859+
/* Define to 1 if `si_band' is a member of `siginfo_t'. */
860+
#undef HAVE_SIGINFO_T_SI_BAND
861+
859862
/* Define to 1 if you have the `siginterrupt' function. */
860863
#undef HAVE_SIGINTERRUPT
861864

0 commit comments

Comments
 (0)