RFR [9]: 8034174 Remove use of JVM_* functions from java.net code
Chris Hegarty
chris.hegarty at oracle.com
Sun Feb 23 00:55:17 PST 2014
On 22 Feb 2014, at 17:23, Dmitry Samersoff <dmitry.samersoff at oracle.com> wrote:
> Chris,
>
> Didn't look to windows part. Unix part looks good for me. See also below.
>
> I'm a bit concerned because of mixing NET_* abstractions and direct call
> to OS functions. It might be better to create NET_socket etc.
Me too. It is already a mess. System calls should be used directly, unless there is a reason not to do so.
> We use NET_GetSockOpt/NET_SetSockOpt in one places and plain os
> functions in other ones it have to be unified.
If there is no reason to call the NET_ variant, then the system call should be used.
> (not to your changes, but as far as you touched it)
>
> Doing socklen_t n = sizeof(m) it's better cast to socklen_t explicitly -
> on some platform socklen_t expands to int but sizeof to unsigned so it
> can cause a compiler warning.
The code compiles on all platforms warning free, but I understand your concern. I’ll make the change.
> It's better to unify check of return value of os functions either as ==
> -1 or as < 0
I agree. Let me see if I can clean up some of these, but I’m reluctant to do much under this JIRA issue.
> 1. net_util.c
> Do we really need to check JNI_VERSION ?
Nope. Just need the JNIEnv.
> 2. Inet4AddressImpl.c
>
> 73, 335 it's better to use NI_MAXHOST in both places
>
> 784 optlen should be socklen_t
>
> 3. Inet6AddressImpl.c
>
> 73, 143 it's better to use NI_MAXHOST in both places
>
> 4. net_util_md.c
>
> 235 gettimeofday is obsoleted and might be not available on all
> platforms. So it's better to try clock_gettime first
I’ll take a look at these, but if there are any potential behavioural changes, desirable or otherwise, then they should come under a separate JIRA issue.
-Chris.
>
> -Dmitry
>
>
> On 2014-02-22 12:29, Chris Hegarty wrote:
>> Interruptible I/O on Solaris has been highly problematic and the long standing plan has been to remove it from the JDK. In JDK6 the VM option UseVMInterruptibleIO was introduced to allow developers/customers experiment with disabling it. In JDK7 the default value of UseVMInterruptibleIO was changed to be "false" so that it is disabled by default. It is now finally being removed.
>>
>> This bug tracks changing the native in src/share/native/java/net and src/solaris/native/java/net so that the system calls are used directly rather than going through the JVM_* functions.
>>
>> http://cr.openjdk.java.net/~chegar/8034174/webrev.00/webrev/
>>
>> -Chris.
>>
>
>
> --
> Dmitry Samersoff
> Oracle Java development team, Saint Petersburg, Russia
> * I would love to change the world, but they won't give me the sources.
More information about the net-dev
mailing list