/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*/
/* Maximum number of sockets per select() */
/* This number should be equal to WindowsSelectorImpl.MAX_SELECTABLE_FDS */
/* This definition MUST precede the inclusion of winsock2.h */
#include <stdlib.h>
#include "jvm.h"
#include "jni.h"
#include "jni_util.h"
#include "sun_nio_ch_WindowsSelectorImpl.h"
#include "sun_nio_ch_PollArrayWrapper.h"
#include "winsock2.h"
typedef struct {
} pollfd;
{
int i;
#ifdef _WIN64
#endif
if (timeout == 0) {
} else if (timeout < 0) {
} else {
}
/* Set FD_SET structures required for select */
for (i = 0; i < numfds; i++) {
read_count++;
}
{
write_count++;
}
except_count++;
}
/* Call select */
== SOCKET_ERROR) {
/* Bad error - this should not happen frequently */
/* Iterate over sockets and call select() on each separately */
for (i = 0; i < numfds; i++) {
/* prepare select structures for the i-th socket */
errreadfds.fd_count = 0;
errwritefds.fd_count = 0;
}
{
}
/* call select on the i-th socket */
== SOCKET_ERROR) {
/* This socket causes an error. Add it to exceptfds set */
} else {
/* This socket does not cause an error. Process result */
}
}
}
}
}
}
/* Return selected sockets. */
/* Each Java array consists of sockets count followed by sockets list */
#ifdef _WIN64
}
}
}
#else
#endif
return 0;
}
{
/* Write one byte into the pipe */
}
{
long bytesToRead;
/* Drain socket */
/* Find out how many bytes available for read */
if (bytesToRead == 0) {
return;
}
/* Prepare corresponding buffer if needed, and then read */
if (bytesToRead > WAKEUP_SOCKET_BUF_SIZE) {
} else {
}
}
jint s)
{
int n;
do {
if (n > 0) {
}
} while (n > 0);
return discarded;
}