1516
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
|
|
4 |
New code and modifications done at SWING Research Group [1]:
|
|
5 |
|
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
[1] Code written at SWING Research Group contains a signature
|
|
17 |
of one of the above copright owners. For exact set of such code,
|
|
18 |
see the differences between this version and version stx:libjava
|
|
19 |
as of 1.9.2010
|
|
20 |
"
|
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
Object subclass:#JavaNioSupport
|
|
24 |
instanceVariableNames:''
|
|
25 |
classVariableNames:''
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Support-Native'
|
|
28 |
!
|
|
29 |
|
|
30 |
!JavaNioSupport class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
35 |
|
|
36 |
New code and modifications done at SWING Research Group [1]:
|
|
37 |
|
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
39 |
SWING Research Group, Czech Technical University in Prague
|
|
40 |
|
|
41 |
This software is furnished under a license and may be used
|
|
42 |
only in accordance with the terms of that license and with the
|
|
43 |
inclusion of the above copyright notice. This software may not
|
|
44 |
be provided or otherwise made available to, or used by, any
|
|
45 |
other person. No title to or ownership of the software is
|
|
46 |
hereby transferred.
|
|
47 |
|
|
48 |
[1] Code written at SWING Research Group contains a signature
|
|
49 |
of one of the above copright owners. For exact set of such code,
|
|
50 |
see the differences between this version and version stx:libjava
|
|
51 |
as of 1.9.2010
|
|
52 |
|
|
53 |
"
|
|
54 |
! !
|
|
55 |
|
|
56 |
!JavaNioSupport class methodsFor:'sun.nio.ch.FileDispatcher'!
|
|
57 |
|
|
58 |
_sun_nio_ch_FileDispatcher_init
|
|
59 |
"JDK 7 native impl:
|
|
60 |
JNIEXPORT void JNICALL
|
|
61 |
Java_sun_nio_ch_FileDispatcherImpl_init(JNIEnv *env, jclass cl)
|
|
62 |
{
|
|
63 |
int sp[2];
|
|
64 |
if (socketpair(PF_UNIX, SOCK_STREAM, 0, sp) < 0) {
|
|
65 |
JNU_ThrowIOExceptionWithLastError(env, 'socketpair failed');
|
|
66 |
return;
|
|
67 |
}
|
|
68 |
preCloseFD = sp[0];
|
|
69 |
close(sp[1]);
|
|
70 |
}
|
|
71 |
"
|
|
72 |
|
|
73 |
"Nothing to do"
|
|
74 |
|
|
75 |
"Created: / 06-07-2012 / 22:35:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
76 |
! !
|
|
77 |
|
|
78 |
!JavaNioSupport class methodsFor:'sun.nio.ch.NativeThread'!
|
|
79 |
|
|
80 |
_sun_nio_ch_NativeThread_current
|
|
81 |
"JDK 7 native impl:
|
|
82 |
JNIEXPORT jlong JNICALL
|
|
83 |
Java_sun_nio_ch_NativeThread_current(JNIEnv *env, jclass cl)
|
|
84 |
{
|
|
85 |
#ifdef __linux__
|
|
86 |
return (long)pthread_self();
|
|
87 |
#else
|
|
88 |
return -1;
|
|
89 |
#endif
|
|
90 |
}
|
|
91 |
"
|
|
92 |
|
|
93 |
^ -1
|
|
94 |
|
|
95 |
"Created: / 06-07-2012 / 22:39:35 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
96 |
!
|
|
97 |
|
|
98 |
_sun_nio_ch_NativeThread_init
|
|
99 |
"JDK 7 native impl:
|
|
100 |
JNIEXPORT void JNICALL
|
|
101 |
Java_sun_nio_ch_NativeThread_init(JNIEnv *env, jclass cl)
|
|
102 |
{
|
|
103 |
#ifdef __linux__
|
|
104 |
|
|
105 |
/* Install the null handler for INTERRUPT_SIGNAL. This might overwrite the
|
|
106 |
* handler previously installed by java/net/linux_close.c, but that's okay
|
|
107 |
* since neither handler actually does anything. We install our own
|
|
108 |
* handler here simply out of paranoia; ultimately the two mechanisms
|
|
109 |
* should somehow be unified, perhaps within the VM.
|
|
110 |
*/
|
|
111 |
|
|
112 |
sigset_t ss;
|
|
113 |
struct sigaction sa, osa;
|
|
114 |
sa.sa_handler = nullHandler;
|
|
115 |
sa.sa_flags = 0;
|
|
116 |
sigemptyset(&sa.sa_mask);
|
|
117 |
if (sigaction(INTERRUPT_SIGNAL, &sa, &osa) < 0)
|
|
118 |
JNU_ThrowIOExceptionWithLastError(env, 'sigaction');
|
|
119 |
|
|
120 |
#endif
|
|
121 |
}
|
|
122 |
"
|
|
123 |
"Nothing to do here"
|
|
124 |
|
|
125 |
"Created: / 06-07-2012 / 22:37:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
126 |
! !
|
|
127 |
|
|
128 |
!JavaNioSupport class methodsFor:'documentation'!
|
|
129 |
|
|
130 |
version_SVN
|
|
131 |
^ '$Id:: $'
|
|
132 |
! !
|