dup.c 230 B

1234567891011
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. int main(int argc, char** argv) {
  4. dup2(1, 255);
  5. close(1);
  6. FILE* new_stdout = fdopen(255, "a");
  7. fprintf(new_stdout, "Hello World!\n");
  8. fflush(new_stdout);
  9. return 0;
  10. }