这个程序是是测试select()操作,当输入“stop”时,程序结束退出。
1、fgets()参数里,stdin用0代替,会出现 'Segmentation fault' 。对stdout stdin stderr 不了解。
2、当敲入键盘,但没有按下回车键时,程序还是会阻塞在select()里。
3、用memcpy()代替strcmp()做字符串比较。且注意比较字符数是strlen()减 1 。
这个程序是是测试select()操作,当输入“stop”时,程序结束退出。
1、fgets()参数里,stdin用0代替,会出现 'Segmentation fault' 。对stdout stdin stderr 不了解。
2、当敲入键盘,但没有按下回车键时,程序还是会阻塞在select()里。
3、用memcpy()代替strcmp()做字符串比较。且注意比较字符数是strlen()减 1 。