46 sigemptyset(&sa.sa_mask);
47 sa.sa_handler = SIG_IGN;
49 return (sigaction(SIGTTIN, &sa,
nullptr) == 0);
76 rd_flags = fcntl(
_rd_fd, F_GETFL, 0);
77 wr_flags = fcntl(
_wr_fd, F_GETFL, 0);
80 rd_flags = rd_flags & ~O_NONBLOCK;
81 wr_flags = wr_flags & ~O_NONBLOCK;
83 rd_flags = rd_flags | O_NONBLOCK;
84 wr_flags = wr_flags | O_NONBLOCK;
87 if (fcntl(
_rd_fd, F_SETFL, rd_flags) < 0) {
91 if (fcntl(
_wr_fd, F_SETFL, wr_flags) < 0) {
virtual void set_speed(uint32_t speed) override
virtual void set_blocking(bool blocking) override
char * strerror(int errnum)
POSIX strerror() - convert POSIX errno to text with user message.
ssize_t write(int fd, const void *buf, size_t count)
POSIX Write count bytes from *buf to fileno fd.
ssize_t read(int fd, void *buf, size_t count)
POSIX read count bytes from *buf to fileno fd.
bool _set_signal_handlers(void) const
virtual bool close() override
int errno
Note: fdevopen assigns stdin,stdout,stderr.
int fprintf(FILE *fp, const char *fmt,...)
fprintf character write function
virtual ssize_t write(const uint8_t *buf, uint16_t n) override
virtual bool open() override
virtual ssize_t read(uint8_t *buf, uint16_t n) override