Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8252248: __SIGRTMAX is not declared in musl libc
Reviewed-by: alanb, vtewari, stuefe
  • Loading branch information
Alexander Scherbatiy committed Aug 31, 2020
1 parent 3746ed3 commit fe0c2ad9034fd3581f12a83801a6255288ea44bb
Showing with 6 additions and 8 deletions.
  1. +4 −4 src/java.base/linux/native/libnet/linux_close.c
  2. +2 −4 src/java.base/unix/native/libnio/ch/NativeThread.c
@@ -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
@@ -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);
}

@@ -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;
}
}
@@ -32,17 +32,15 @@
#include "sun_nio_ch_NativeThread.h"
#include "nio_util.h"
#include <signal.h>
#include <pthread.h>

#ifdef __linux__
#include <pthread.h>
/* Also defined in net/linux_close.c */
#define INTERRUPT_SIGNAL (__SIGRTMAX - 2)
#define INTERRUPT_SIGNAL (SIGRTMAX - 2)
#elif defined(_AIX)
#include <pthread.h>
/* Also defined in net/aix_close.c */
#define INTERRUPT_SIGNAL (SIGRTMAX - 1)
#elif defined(_ALLBSD_SOURCE)
#include <pthread.h>
/* Also defined in net/bsd_close.c */
#define INTERRUPT_SIGNAL SIGIO
#else

0 comments on commit fe0c2ad

Please sign in to comment.