RFR: 8309475: Test java/foreign/TestByteBuffer.java fails: a problem with msync (aix) [v4]

Alan Bateman alanb at openjdk.org
Thu Aug 17 10:34:39 UTC 2023


On Mon, 14 Aug 2023 23:39:45 GMT, Tyler Steele <tsteele at openjdk.org> wrote:

>> This change adds additional support to MappedByteBuffer::force which delegates to msync on AIX. Specifically, it checks whether and error with errno set to EINVAL is the cause of a msync call to an address mmapped with the MAP_PRIVATE flag set. If this flag is set, then the msync call EINVAL is expected, and can be ignored as per the Java documentation of the force method.
>> 
>>> In particular, the method has no effect for buffers mapped in read-only or private mapping modes. [1]
>> 
>> Separated into separate file as per recommendation by @AlanBateman.
>> 
>> [1] https://download.java.net/java/early_access/jdk21/docs/api/java.base/java/nio/MappedByteBuffer.html#force()
>
> Tyler Steele has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Cast other void*

The removal of the AIX specific code from the Unix version of MappedMemoryUtils.c look fine. At some point I think we should re-visit this as the force method should be a no-op for the read-only or private mapping cases so this code should not be needed.

-------------

Marked as reviewed by alanb (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14964#pullrequestreview-1582323048


More information about the nio-dev mailing list