Skip to content

Commit

Permalink
8252248: __SIGRTMAX is not declared in musl libc
Browse files Browse the repository at this point in the history
Reviewed-by: stuefe
Backport-of: 5490b03
  • Loading branch information
Aleksei Voitylov authored and Alexander Scherbatiy committed Mar 10, 2022
1 parent 49f9105 commit e18126a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/java.base/linux/native/libnet/linux_close.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ typedef struct {
/*
* Signal to unblock thread
*/
static int sigWakeup = (__SIGRTMAX - 2);
#define WAKEUP_SIGNAL (SIGRTMAX - 2)

/*
* fdTable holds one entry per file descriptor, up to a certain
Expand Down Expand Up @@ -152,10 +152,10 @@ static void __attribute((constructor)) init() {
sa.sa_handler = sig_wakeup;
sa.sa_flags = 0;
sigemptyset(&sa.sa_mask);
sigaction(sigWakeup, &sa, NULL);
sigaction(WAKEUP_SIGNAL, &sa, NULL);

sigemptyset(&sigset);
sigaddset(&sigset, sigWakeup);
sigaddset(&sigset, WAKEUP_SIGNAL);
sigprocmask(SIG_UNBLOCK, &sigset, NULL);
}

Expand Down Expand Up @@ -305,7 +305,7 @@ static int closefd(int fd1, int fd2) {
threadEntry_t *curr = fdEntry->threads;
while (curr != NULL) {
curr->intr = 1;
pthread_kill( curr->thr, sigWakeup );
pthread_kill( curr->thr, WAKEUP_SIGNAL);
curr = curr->next;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/java.base/unix/native/libnio/ch/NativeThread.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif _AIX
#include <pthread.h>
/* Also defined in net/aix_close.c */
Expand Down

1 comment on commit e18126a

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.