// // Written for Computer Networks and Systems lab classes // AUTHOR : Sergiusz Warga #include #include int main() { char msg_write[] = "write() to dup(1)\n"; int soutfd = dup(STDOUT_FILENO); write(soutfd, msg_write, sizeof(msg_write)); FILE *fakeout = fdopen(soutfd, "w"); fprintf(fakeout, "using fprintf() on fakeout\n"); return 0; }