22#include "gdbsupport/filestuff.h"
63 if (gdb_pipe_cloexec (fds) == -1)
64 internal_error (
"creating serial event pipe failed.");
66 fcntl (fds[0], F_SETFL, O_NONBLOCK);
67 fcntl (fds[1], F_SETFL, O_NONBLOCK);
80 state->event = CreateEvent (0, TRUE, FALSE, 0);
84 dummy_file = CreateFile (
"nul", 0, 0, NULL, OPEN_EXISTING, 0, NULL);
85 scb->
fd = _open_osfhandle ((intptr_t) dummy_file, 0);
101 CloseHandle (state->event);
116serial_event_wait_handle (
struct serial *scb, HANDLE *
read, HANDLE *except)
120 *
read = state->event;
155 serial_event_wait_handle,
192 while (r < 0 && errno == EINTR);
194 SetEvent (state->event);
211 r =
read (ser->
fd, &c, 1);
213 while (r > 0 || (r < 0 && errno == EINTR));
216 ResetEvent (state->event);
ssize_t read(int fd, void *buf, size_t count)
static void serial_event_close(struct serial *scb)
static int serial_event_open(struct serial *scb, const char *name)
static const struct serial_ops serial_event_ops
void serial_event_set(struct serial_event *event)
void serial_event_clear(struct serial_event *event)
struct serial_event * make_serial_event(void)
int serial_event_fd(struct serial_event *event)
struct serial * serial_open_ops(const struct serial_ops *ops)