#include #include #include #include int main() { int rc; close( 1 ); close( 2 ); printf( "HI\n" ); fflush( NULL ); /* FLUSH EVERYTHING? */ fprintf( stderr, "ERROR\n" ); open( "newfile.txt", O_WRONLY | O_CREAT | O_TRUNC, 0600 ); printf( "WHAT?\n" ); fprintf( stderr, "I SAID ERROR\n" ); rc = fork(); if ( rc == 0 ) { printf( "SAY AGAIN?\n" ); fprintf( stderr, "ERROR ERROR\n" ); } else { wait( NULL ); } printf( "BYE\n" ); fprintf( stderr, "HI\n" ); return 0; }