1、tcflush() 函數包含於頭文件#include <termios.h>;
2、函數原型:int tcflush(int fd, int queue_selector);
#include <termios.h> //頭文件
/*
* fd // 終端I/O打開的句柄
* queue_selector // 控制tcflush的操作,取值為下面三個常數中的一個
* TCIFLUSH // 清除正收到的數據,且不會讀取出來。
* TCOFLUSH // 清除正寫入的數據,且不會發送至終端。
* TCIOFLUSH // 清除所有的緩存數據。
*
* 返回值: 0成功; -1失敗,並且為 errno 置值來指示錯誤
*/
int tcflush(int fd, int queue_selector);