#include <ws2tcpip.h>
#endif
-#if __QNX__
-#include <sys/iomgr.h>
-#endif /* __QNX__ */
-
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
#ifndef IN_PROCESS_AGENT
-#if USE_WIN32API
-# define INVALID_DESCRIPTOR INVALID_SOCKET
-#else
-# define INVALID_DESCRIPTOR -1
-#endif
-
/* Extra value for readchar_callback. */
enum {
/* The callback is currently not scheduled. */
static int remote_is_stdio = 0;
-static gdb_fildes_t remote_desc = INVALID_DESCRIPTOR;
-static gdb_fildes_t listen_desc = INVALID_DESCRIPTOR;
+static int remote_desc = -1;
+static int listen_desc = -1;
#ifdef USE_WIN32API
# define read(fd, buf, len) recv (fd, (char *) buf, len, 0)
int
gdb_connected (void)
{
- return remote_desc != INVALID_DESCRIPTOR;
+ return remote_desc != -1;
}
/* Return true if the remote connection is over stdio. */
if (! remote_connection_is_stdio ())
close (remote_desc);
#endif
- remote_desc = INVALID_DESCRIPTOR;
+ remote_desc = -1;
reset_readchar ();
}
/* This function may be called before establishing communications,
therefore we need to validate the remote descriptor. */
- if (remote_desc == INVALID_DESCRIPTOR)
+ if (remote_desc == -1)
return;
input_interrupt (0);
#endif
}
-#ifdef __QNX__
-static void
-nto_comctrl (int enable)
-{
- struct sigevent event;
-
- if (enable)
- {
- event.sigev_notify = SIGEV_SIGNAL_THREAD;
- event.sigev_signo = SIGIO;
- event.sigev_code = 0;
- event.sigev_value.sival_ptr = NULL;
- event.sigev_priority = -1;
- ionotify (remote_desc, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_INPUT,
- &event);
- }
- else
- ionotify (remote_desc, _NOTIFY_ACTION_POLL, _NOTIFY_COND_INPUT, NULL);
-}
-#endif /* __QNX__ */
-
-
/* Current state of asynchronous I/O. */
static int async_io_enabled;
block_unblock_async_io (0);
async_io_enabled = 1;
-#ifdef __QNX__
- nto_comctrl (1);
-#endif /* __QNX__ */
}
/* Disable asynchronous I/O. */
block_unblock_async_io (1);
async_io_enabled = 0;
-#ifdef __QNX__
- nto_comctrl (0);
-#endif /* __QNX__ */
-
}
void