Skip to content

Instantly share code, notes, and snippets.

@stouset
Created November 5, 2009 18:07
Show Gist options
  • Save stouset/227252 to your computer and use it in GitHub Desktop.
Save stouset/227252 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main(void) {
int fd = dup2(1, 3);
FILE *stdout2 = fdopen(fd, "w");
fprintf(stdout, "stdout\n");
fprintf(stdout2, "stdout2\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment