File tree Expand file tree Collapse file tree 7 files changed +99
-6
lines changed
closed/src/java.base/share/classes/sun/net/util Expand file tree Collapse file tree 7 files changed +99
-6
lines changed Original file line number Diff line number Diff line change
1
+ /*
2
+ * ===========================================================================
3
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
4
+ * ===========================================================================
5
+ *
6
+ * This code is free software; you can redistribute it and/or modify it
7
+ * under the terms of the GNU General Public License version 2 only, as
8
+ * published by the Free Software Foundation.
9
+ *
10
+ * IBM designates this particular file as subject to the "Classpath" exception
11
+ * as provided by IBM in the LICENSE file that accompanied this code.
12
+ *
13
+ * This code is distributed in the hope that it will be useful, but WITHOUT
14
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16
+ * version 2 for more details (a copy is included in the LICENSE file that
17
+ * accompanied this code).
18
+ *
19
+ * You should have received a copy of the GNU General Public License version
20
+ * 2 along with this work; if not, see <http://www.gnu.org/licenses/>.
21
+ *
22
+ * ===========================================================================
23
+ */
24
+ package sun .net .util ;
25
+
26
+ import sun .security .action .GetPropertyAction ;
27
+
28
+ public final class AIX {
29
+ // Flag indicating whether the operating system is AIX.
30
+ public static final boolean isAIX = "AIX" .equals (GetPropertyAction .privilegedGetProperty ("os.name" ));
31
+ }
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
72
78
import jdk .internal .ref .CleanerFactory ;
73
79
import sun .net .ResourceManager ;
74
80
import sun .net .ext .ExtendedSocketOptions ;
81
+ import sun .net .util .AIX ;
75
82
import sun .net .util .IPAddressUtil ;
76
83
77
84
/**
@@ -1732,11 +1739,14 @@ private void implCloseBlockingMode() throws IOException {
1732
1739
long reader = readerThread ;
1733
1740
long writer = writerThread ;
1734
1741
if (reader != 0 || writer != 0 ) {
1735
- nd .preClose (fd );
1742
+ if (!AIX .isAIX )
1743
+ nd .preClose (fd );
1736
1744
if (reader != 0 )
1737
1745
NativeThread .signal (reader );
1738
1746
if (writer != 0 )
1739
1747
NativeThread .signal (writer );
1748
+ if (AIX .isAIX )
1749
+ nd .preClose (fd );
1740
1750
}
1741
1751
}
1742
1752
}
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
56
62
import sun .net .PlatformSocketImpl ;
57
63
import sun .net .ResourceManager ;
58
64
import sun .net .ext .ExtendedSocketOptions ;
65
+ import sun .net .util .AIX ;
59
66
import sun .net .util .SocketExceptions ;
60
67
61
68
import static java .util .concurrent .TimeUnit .MILLISECONDS ;
@@ -909,13 +916,16 @@ protected void close() throws IOException {
909
916
// then the socket is pre-closed and the thread(s) signalled. The
910
917
// last thread will close the file descriptor.
911
918
if (!tryClose ()) {
912
- nd .preClose (fd );
919
+ if (!AIX .isAIX )
920
+ nd .preClose (fd );
913
921
long reader = readerThread ;
914
922
if (reader != 0 )
915
923
NativeThread .signal (reader );
916
924
long writer = writerThread ;
917
925
if (writer != 0 )
918
926
NativeThread .signal (writer );
927
+ if (AIX .isAIX )
928
+ nd .preClose (fd );
919
929
}
920
930
}
921
931
}
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
57
63
58
64
import sun .net .NetHooks ;
59
65
import sun .net .ext .ExtendedSocketOptions ;
66
+ import sun .net .util .AIX ;
60
67
61
68
/**
62
69
* An implementation of ServerSocketChannels
@@ -583,8 +590,11 @@ private void implCloseBlockingMode() throws IOException {
583
590
if (!tryClose ()) {
584
591
long th = thread ;
585
592
if (th != 0 ) {
586
- nd .preClose (fd );
593
+ if (!AIX .isAIX )
594
+ nd .preClose (fd );
587
595
NativeThread .signal (th );
596
+ if (AIX .isAIX )
597
+ nd .preClose (fd );
588
598
}
589
599
}
590
600
}
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
62
68
import sun .net .ConnectionResetException ;
63
69
import sun .net .NetHooks ;
64
70
import sun .net .ext .ExtendedSocketOptions ;
71
+ import sun .net .util .AIX ;
65
72
import sun .net .util .SocketExceptions ;
66
73
67
74
/**
@@ -1014,11 +1021,14 @@ private void implCloseBlockingMode() throws IOException {
1014
1021
long reader = readerThread ;
1015
1022
long writer = writerThread ;
1016
1023
if (reader != 0 || writer != 0 ) {
1017
- nd .preClose (fd );
1024
+ if (!AIX .isAIX )
1025
+ nd .preClose (fd );
1018
1026
if (reader != 0 )
1019
1027
NativeThread .signal (reader );
1020
1028
if (writer != 0 )
1021
1029
NativeThread .signal (writer );
1030
+ if (AIX .isAIX )
1031
+ nd .preClose (fd );
1022
1032
}
1023
1033
}
1024
1034
}
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
37
43
import java .util .Objects ;
38
44
import java .util .concurrent .locks .ReentrantLock ;
39
45
46
+ import sun .net .util .AIX ;
47
+
40
48
class SinkChannelImpl
41
49
extends Pipe .SinkChannel
42
50
implements SelChImpl
@@ -123,8 +131,11 @@ private void implCloseBlockingMode() throws IOException {
123
131
if (!tryClose ()) {
124
132
long th = thread ;
125
133
if (th != 0 ) {
126
- nd .preClose (fd );
134
+ if (!AIX .isAIX )
135
+ nd .preClose (fd );
127
136
NativeThread .signal (th );
137
+ if (AIX .isAIX )
138
+ nd .preClose (fd );
128
139
}
129
140
}
130
141
}
Original file line number Diff line number Diff line change 23
23
* questions.
24
24
*/
25
25
26
+ /*
27
+ * ===========================================================================
28
+ * (c) Copyright IBM Corp. 2024, 2024 All Rights Reserved
29
+ * ===========================================================================
30
+ */
31
+
26
32
package sun .nio .ch ;
27
33
28
34
import java .io .FileDescriptor ;
37
43
import java .util .Objects ;
38
44
import java .util .concurrent .locks .ReentrantLock ;
39
45
46
+ import sun .net .util .AIX ;
47
+
40
48
class SourceChannelImpl
41
49
extends Pipe .SourceChannel
42
50
implements SelChImpl
@@ -123,8 +131,11 @@ private void implCloseBlockingMode() throws IOException {
123
131
if (!tryClose ()) {
124
132
long th = thread ;
125
133
if (th != 0 ) {
126
- nd .preClose (fd );
134
+ if (!AIX .isAIX )
135
+ nd .preClose (fd );
127
136
NativeThread .signal (th );
137
+ if (AIX .isAIX )
138
+ nd .preClose (fd );
128
139
}
129
140
}
130
141
}
You can’t perform that action at this time.
0 commit comments