終端 I/O 處理分立為兩種不同的風格:一種是系統Ⅲ的風格,由 System V 沿續下來,另一種是 V7 的風格,它成為 BSD 派生的系統終端 I/O 處理的標準
終端 I/O 有兩種不同的工作模式:規范模式輸入處理;非規范模式輸入處理
比如通常的shell就是規范模式,而vim編輯器就是非規范模式
獲得和設置終端屬性
#include <termios.h>
int tcgetattr(int fd,struct *termptr);
int tcseetattr(int fd,int opt,const struct termios *termptr);
stty命令
波特率函數
#include <termios.h>
speed_t cfgetispeed
speed_t cfsetispeed
speed_t cfgetospeed
speed_t cfsetospeed