65 "creating serial event pipe failed.");
67 fcntl (fds[0], F_SETFL, O_NONBLOCK);
68 fcntl (fds[1], F_SETFL, O_NONBLOCK);
81 state->event = CreateEvent (0, TRUE, FALSE, 0);
85 dummy_file = CreateFile (
"nul", 0, 0, NULL, OPEN_EXISTING, 0, NULL);
86 scb->
fd = _open_osfhandle ((intptr_t) dummy_file, 0);
102 CloseHandle (state->event);
117 serial_event_wait_handle (
struct serial *scb, HANDLE *
read, HANDLE *except)
121 *
read = state->event;
156 serial_event_wait_handle,
162 struct serial_event *
193 while (r < 0 && errno == EINTR);
195 SetEvent (state->event);
212 r =
read (ser->
fd, &c, 1);
214 while (r > 0 || (r < 0 && errno == EINTR));
217 ResetEvent (state->event);
ssize_t read(int fd, void *buf, size_t count)
int gdb_pipe_cloexec(int filedes[2])
void internal_error(const char *file, int line, const char *fmt,...)
struct serial * serial_open_ops(const struct serial_ops *ops)
int serial_event_fd(struct serial_event *event)
static void serial_event_close(struct serial *scb)
static const struct serial_ops serial_event_ops
void serial_event_clear(struct serial_event *event)
struct serial_event * make_serial_event(void)
void serial_event_set(struct serial_event *event)
static int serial_event_open(struct serial *scb, const char *name)