161 else if (scb->
bufcnt == 0)
172 while (nr < 0 && errno == EINTR);
220 fd_set readfds, exceptfds;
231 FD_ZERO (&exceptfds);
232 FD_SET (scb->
fd, &readfds);
233 FD_SET (scb->
fd, &exceptfds);
247 else if (errno == EINTR)
279 to_read = (num_bytes < to_read) ? num_bytes : to_read;
285 if ((s == -1) || (s == 0 && !close_fd))
288 if (s == 0 && close_fd)
305 while ((newline = strstr (current,
"\n")) != NULL)
310 current = newline + 1;
348 delta = (timeout == 0 ? 0 : 1);
375 else if (timeout == 0)
394 while (
status < 0 && errno == EINTR);
427 int (do_readchar) (
struct serial *scb,
int timeout))
443 ch = do_readchar (scb, timeout);
476 const char *str = (
const char *) buf;
ssize_t read(int fd, void *buf, size_t count)
int serial_is_async_p(struct serial *scb)
int generic_readchar(struct serial *scb, int timeout, int(do_readchar)(struct serial *scb, int timeout))
serial_event_ftype * async_handler
int ser_base_set_tty_state(struct serial *scb, serial_ttystate ttystate)
void() handler_func(int, gdb_client_data)
void fputs_unfiltered(const char *buf, struct ui_file *file)
int ser_base_flush_output(struct serial *scb)
static timer_handler_func push_event
int ser_base_setbaudrate(struct serial *scb, int rate)
int create_timer(int ms, timer_handler_func *proc, gdb_client_data client_data)
int ser_base_setstopbits(struct serial *scb, int num)
static void reschedule(struct serial *scb)
int(* read_prim)(struct serial *scb, size_t count)
int serial_debug_p(struct serial *scb)
void add_file_handler(int fd, handler_func *proc, gdb_client_data client_data)
static void ser_base_read_error_fd(struct serial *scb, int close_fd)
void ser_base_raw(struct serial *scb)
void ser_base_async(struct serial *scb, int async_p)
static void handle_error_fd(int error, gdb_client_data client_data)
void serial_unref(struct serial *scb)
void fprintf_unfiltered(struct ui_file *stream, const char *format,...)
int(* write_prim)(struct serial *scb, const void *buf, size_t count)
void() timer_handler_func(gdb_client_data)
static handler_func fd_event
static const char * parity
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
int ser_base_drain_output(struct serial *scb)
unsigned char buf[BUFSIZ]
void ser_base_print_tty_state(struct serial *scb, serial_ttystate ttystate, struct ui_file *stream)
int ser_base_setparity(struct serial *scb, int parity)
int(* avail)(struct serial *scb, int fd)
int ser_base_flush_input(struct serial *scb)
int ser_base_readchar(struct serial *scb, int timeout)
int ser_base_send_break(struct serial *scb)
int ser_base_write(struct serial *scb, const void *buf, size_t count)
void delete_timer(int id)
static void run_async_handler_and_reschedule(struct serial *scb)
void serial_ref(struct serial *scb)
serial_ttystate ser_base_copy_tty_state(struct serial *scb, serial_ttystate ttystate)
int interruptible_select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout)
int serial_is_open(struct serial *scb)
static int do_ser_base_readchar(struct serial *scb, int timeout)
const struct serial_ops * ops
void error(const char *fmt,...)
void delete_file_handler(int fd)
static int ser_base_wait_for(struct serial *scb, int timeout)
int(* deprecated_ui_loop_hook)(int signo)
serial_ttystate ser_base_get_tty_state(struct serial *scb)