私はコマンドラインで入力を待っているループにselect()を配置しました。 STDINにプログラムで書き込んだり、select()にそれを取り込ませてもらえますか?Select()のプログラムでSTDINに書き込み
私はwrite()、fputs()をSTDINにしようとしましたが、select()はまだSTDINの変更を見ることができません。
while(1){
....
rt = select(fdmax+1, &readfds, NULL, NULL, &time_out);
if (rt == 0) // if it timesout, write to STDIN for the next loop
{
char message[20] = "hihihihi\n";
write(STDIN, message, strlen(message));
printf("wrote\n");
continue;
}
}
[文字列をttyに入れてコマンドを作成する](http://unix.stackexchange.com/questions/48103/construct-a-command-by-putting-a-string-into-a)の可能な複製-tty) – Scott