[9] RFR of 8074821: Resolve disabled warnings for libnio
Brian Burkhalter
brian.burkhalter at oracle.com
Tue Aug 18 00:55:00 UTC 2015
I would like to reprise this thread
http://mail.openjdk.java.net/pipermail/nio-dev/2015-May/003126.html
concerning https://bugs.openjdk.java.net/browse/JDK-8074821 starting from the message included below.
Please review this new patch at your convenience:
http://cr.openjdk.java.net/~bpb/8074821/webrev.01/
It differs from the prior one in the addition of the lines
+// GetVersionEx is deprecated; disable the warning until a replacement is found
+#pragma warning(disable : 4996)
just before the functions in which GetVersionEx() is invoked in the Windows source code of Iocp.c and Net.c. There is precedence elsewhere in the source for using this approach. I don’t think that in the Net.c source it is necessary to repeat the pragma directive [1] but it does serve to emphasize the functions which call GetVersionEx().
For lack of a fully functional Solaris VM image I have not run the Selector tests as suggested below. I an unsure as to how important that is to the purpose of this issue.
Thanks,
Brian
[1] https://msdn.microsoft.com/en-us/library/2c8f766e.aspx
On May 8, 2015, at 12:01 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> On 07/05/2015 19:15, Brian Burkhalter wrote:
>> :
>>
>> Would something like this make more sense?
>>
>> --- a/src/java.base/unix/native/libnio/ch/IOUtil.c
>> +++ b/src/java.base/unix/native/libnio/ch/IOUtil.c
>> @@ -1,5 +1,5 @@
>> /*
>> - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
>> + * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
>> * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>> *
>> * This code is free software; you can redistribute it and/or modify it
>> @@ -129,7 +129,8 @@
>> JNU_ThrowIOExceptionWithLastError(env, "getrlimit failed");
>> return -1;
>> }
>> - if (rlp.rlim_max < 0 || rlp.rlim_max > java_lang_Integer_MAX_VALUE) {
>> + if (rlp.rlim_max == RLIM_INFINITY ||
>> + rlp.rlim_max > (rlim_t)java_lang_Integer_MAX_VALUE) {
>> return java_lang_Integer_MAX_VALUE;
>> } else {
>> return (jint)rlp.rlim_max;
>>
> This looks good as it doesn't make any assumption on the value of RLIM_INFINITY. If you have VM images with Solaris then it's easy to edit /etc/system, reboot, and then attempt to run the Selector tests.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20150817/d62e6695/attachment.html>
More information about the nio-dev
mailing list