http://man7.org/tlpi/code/online/book/altio/t_select.c.html
功能: 用select() 觀察fd 0 是否ready。
然後一定要按enter , fd 0 才會ready。
Beej's Guide to Network Programming 7.2. select():同步 I/O 多工
也有提到"如果你用一行緩衝區(buffer)的終端機,那麼你從鍵盤輸入資料後應該要盡快按下
Enter,否則程式就會發生 timeout。"
1.請教什麼是一行緩衝區?
2.為什麼程序起來後,還需要按enter, stdin才會ready? stdin 緩衝區裏面是還有東西
沒清空?
3.
https://imgur.com/Mua5xCJ
為什麼程序不會read newline?
請問有人能解答嗎 ?
謝謝