JDK-8031997 : PPC64: Make the various POLL constants system dependant
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: port-stage-ppc-aix
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-01-16
  • Updated: 2014-07-29
  • Resolved: 2014-01-20
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9 Other
8u20Fixed 9Fixed port-stage-ppc-aixFixed
Description
Currently, various constants used for the poll/epoll/pollset system calls are defined multple times as public static final short constants in various Java files:

src/share/classes/sun/nio/ch/AbstractPollArrayWrapper.java:
src/solaris/classes/sun/nio/ch/Port.java

Until now, this has not been a problem because on Linux, Solaris and MacOSX these constants have the same values. However on Windows and AIX they are different. 

While this hasn't been a problem on Windows either, because as far as I can see, we don't directly use WSAPoll() until now and the POLL constants are only used 'symbolically' on Windows, it became a real problem for the AIX port.

To avoid a mapping of the Java constants to the native ones every time we go from Java to Native and back, it has been suggested to make these constants platform dependant (see http://mail.openjdk.java.net/pipermail/core-libs-dev/2014-January/024426.html).

This would also make it possible to directly used the WSAPoll() functionality on Windows which is available since Windows Vista / Windows Server 2008 (see http://msdn.microsoft.com/en-us/library/windows/desktop/ms741669%28v=vs.85%29.aspx).

Comments
After consulting Alan, I've changed the summary back to "PPC64: Make the various POLL constants system dependant". Altough Alan is right that this change isn't AIX-Port specific it will be nevertheless checked in into the ppc-aix-port/stage repository first and the "PPC64" prefix is a marker to help with the integration of the port into the main code line.
17-01-2014

I've changed the summary line to make it clear that this is not specific to the AIX port, it an oversight that wasn't previously reported or noticed and helps the general portability of the code.
16-01-2014