MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / tcflush

Function tcflush

components/libc/posix/io/termios/termios.c:197–200  ·  view source on GitHub ↗

* @brief Flushes data from a terminal input or output queue. * @param fd File descriptor of the terminal device. * @param queue Queue to be flushed (TCIFLUSH, TCOFLUSH, or TCIOFLUSH). * @return Upon successful completion, returns 0; otherwise, returns -1 and sets errno to indicate the error. * * @note This function flushes data from the input or output queue of the terminal device s

Source from the content-addressed store, hash-verified

195 * If the ioctl operation fails, errno is set to indicate the error, and the function returns -1.
196 */
197int tcflush(int fd, int queue)
198{
199 return ioctl(fd, TCFLSH, (void*)(rt_ubase_t)queue);
200}
201
202/**
203 * @brief Controls the terminal flow control.

Callers 2

config_commFunction · 0.85
flush_commFunction · 0.85

Calls 1

ioctlFunction · 0.50

Tested by 2

config_commFunction · 0.68
flush_commFunction · 0.68