RFR: [8u] JDK-8035949: Remove unused macro USE_SELECT and clean up Unix version of net_util_md.{c,h}

Severin Gehwolf sgehwolf at redhat.com
Mon May 4 13:58:23 UTC 2020


On Thu, 2020-04-30 at 03:00 +0100, Andrew John Hughes wrote:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8035949
> Webrev: https://cr.openjdk.java.net/~andrew/openjdk8/8035949/webrev.01/
> 
> This is the first of two backports to cleanup unused #include directives
> and dead code in the networking stack. The initial motivation was to
> resolve build breakage due to the upcoming release of glibc 2.32, which
> removes the long deprecated sys/sysctl.h [0].

I agree we should fix build issues due to removal of sys/sysctl.h on
Linux in newer glibc releases. However, rather than backporting two
patches, I'd suggest to point-fix it. After all, sys/sysctl.h are
unused includes on Linux:

diff --git a/src/solaris/native/java/net/PlainDatagramSocketImpl.c b/src/solaris/native/java/net/PlainDatagramSocketImpl.c
--- a/src/solaris/native/java/net/PlainDatagramSocketImpl.c
+++ b/src/solaris/native/java/net/PlainDatagramSocketImpl.c
@@ -41,7 +41,6 @@
 #endif
 #ifdef __linux__
 #include <unistd.h>
-#include <sys/sysctl.h>
 #include <sys/utsname.h>
 #include <netinet/ip.h>
 
diff --git a/src/solaris/native/java/net/PlainSocketImpl.c b/src/solaris/native/java/net/PlainSocketImpl.c
--- a/src/solaris/native/java/net/PlainSocketImpl.c
+++ b/src/solaris/native/java/net/PlainSocketImpl.c
@@ -43,7 +43,6 @@
 #endif
 #ifdef __linux__
 #include <unistd.h>
-#include <sys/sysctl.h>
 #endif
 
 #include "jvm.h"

This builds fine for me with a glibc which no longer provides
sys/sysctl.h and risk seems significantly lower going down this route.

Thoughts?

Thanks,
Severin



More information about the jdk8u-dev mailing list