Skip to content

Commit

Permalink
erts: Fix highest POSIX signal definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jhogberg committed May 22, 2023
1 parent 5e084ee commit 4ab57f7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion erts/emulator/sys/unix/sys_signal_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@

#if (defined(BEAMASM) && defined(NATIVE_ERLANG_STACK))

#if defined(NSIG)
# define HIGHEST_SIGNAL NSIG
#elif defined(_NSIG)
# define HIGHEST_SIGNAL _NSIG
#endif

/*
* Set alternate signal stack for the invoking thread.
*/
Expand Down Expand Up @@ -115,7 +121,7 @@ void sys_init_signal_stack(void) {

sys_thread_init_signal_stack();

for (i = 1; i < _NSIG; ++i) {
for (i = 1; i < HIGHEST_SIGNAL; ++i) {
if (sigaction(i, NULL, &sa)) {
/* This will fail with EINVAL on Solaris if 'i' is one of the
thread library's private signals. We DO catch the initial
Expand Down

0 comments on commit 4ab57f7

Please sign in to comment.