What will happen when a daemon process with no controlling terminal tries to print to its stdout? More specifically, consider the following pseudo code:
int main(void) { pid_t pid; /* Assume that at this point stdin, stdout and stderr are open * because the process was created by the shell. */ if( (pid = fork()) < 0 ) return FORK_FAILED; else { /* Child Process - Continue Execution */ fclose(stdin); fclose(stderr); setsid(); /* become session leader */ chdir("/"); /* change working directory */ umask(0); /* clear the file mode creation mask */ printf("No controlling terminal. What will happen here?") return OK; } else { /* Parent Process - Exit & Return Control */ exit(0); } ================================================================= To unsubscribe, send mail to [EMAIL PROTECTED] with the word "unsubscribe" in the message body, e.g., run the command echo unsubscribe | mail [EMAIL PROTECTED]