Re: Fork, session leader and printing to stdout

2004-11-23 Thread Henrique de Moraes Holschuh
On Tue, 23 Nov 2004, Shaul Karl wrote: > What will happen when a daemon process with no controlling terminal > tries to print to its stdout? It depends. Many daemons guard against this by opening /dev/null on descriptors 0, 1 and 2. Otherwise, they will get a write error. Most code doesn't ch

Fork, session leader and printing to stdout

2004-11-22 Thread Shaul Karl
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 s