>> 664
こんな感じですか?↓
string tty = ttyname(1);
fclose(stdout);
dup2(1, open(tty.c_str(), O_WRONLY));

駄目でした...