Review Request: JDK-8001334 - Remove use of JVM_* functions from code

Alan Bateman Alan.Bateman at
Fri Jan 25 14:53:10 UTC 2013


I've taken a pass over this and overall this is good clean-up and 
something that was just not possible before jdk8 because of the need to 
keep -XX:+UseVMInterruptibleIO working on Solaris.

A few comments:

- I don't understand why these changes require the make file changes to 
link io_util_md and canonicalize_md into nio.dll.

- In the definition of ISNANF on Solaris it uses isnand. I'll bet the 
comment in globalDefinitions_xxx dates back to the original port and 
might not be true anymore (I'm not suggesting you change it without 
intensive testing, just a comment that I'll bet it is not an issue now).

- "FD" is probably okay, I just wonder about how easy it might be to get 
a conflict.

- src/solaris/native/java/io/UnixFileSystem_md.c, did you test access to 
"/", I just wonder if it would be better to keep the existing test.

- handleClose in src/solaris/native/java/io/io_util_md.c, close is not 
restartable (I think we have this wrong in a few places).

- handleOpen - looks like a bug where it should use "mode" instead of 
the 0666.

- I don't think the O_CLOEXEC code is needed in handleOpen, was this 
copied from HotSpot?

- handleAvailable - assume the file is changing, in which case this 
could return a negative available. I see the existing code lseeks to the 
end whereas you are using the size from the stat, I think that is okay, 
just need to properly handle the case that the file is truncated between 

- getLastErrorString => I wonder if we should move to strerror_r (less 
ambiguity as to whether it is thread-safe). Probably best to use strncpy 

- src/solaris/native/java/io/io_util_md.h - minor nit, alignment of 

- src/windows/native/java/io/io_util_md.h - it's not obvious to me why 
these need JNIEXPORT but this might be tied into my first question about 
the make changes.

That's all I have. I assume you will run all tests on all platforms 
before this is pushed.


> :
> -------- Original Message --------
> Subject:     Review Request: JDK-8001334 - Remove use of JVM_* 
> functions from code
> Date:     Mon, 21 Jan 2013 23:25:25 -0800
> From:     Dan Xu <dan.xu at>
> To:     nio-dev <nio-dev at>
> Hi,
> Interruptible I/O on Solaris has been highly problematicand undercut 
> portability. And the long term plan is to remove it completely from 
> JDK. In JDK6, the VM option, UseVMInterruptibleIO, was introduced as 
> part of a phase-out plan to allow developers/customers to disable it. 
> In JDK7, the default value of UseVMInterruptibleIO flag was changed 
> to"false" to make Solaris blockingI/O operations uninterruptible by 
> Java thread interruptsby default.
> The last stepof this phase-out plan is to remove the feature 
> completely. And it is good to do it now in JDK8. In this fix, I 
> removed all related codes in IO area by replacing JVM_* functions with 
> direct system calls. Please help review the proposed fix. Similar 
> changes in networking area will be done via a different bug.
> Bug:
> webrev: 
> <>
> Best,
> -Dan

More information about the core-libs-dev mailing list