Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ほとんどの Unix システムでは、ctrl-d と入力すると、標準入力で EOF が示されます。select の呼び出しでブロックされているときにプログラムに ctrl-d を入力するとどうなりますか? ここでの Select は、C でのイベント ベースのソケット プログラミングを参照しています。
select(maxfd+1, &readfds, NULL, NULL, NULL);
ファイル記述子が閉じられている場合、select は戻り、ファイル記述子を読み取る準備ができていることを示します。その後の読み取りでは 0 が返され、ファイルの終わりの状態を示します。