Re: Fork, session leader and printing to stdout
From: Henrique de Moraes Holschuh (hmh_at_debian.org)
Date: 11/23/04
- Previous message: David Baron: "/var/mail/mail"
- In reply to: Shaul Karl: "Fork, session leader and printing to stdout"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Nov 2004 09:27:04 -0200 To: Shaul Karl <shaulk@013.net>
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 check for them
when printing out messages, so nothing weird happens.
> More specifically, consider the following pseudo code:
It won't work, it is full of errors :P and you want to fclose(stdout), too.
-- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: David Baron: "/var/mail/mail"
- In reply to: Shaul Karl: "Fork, session leader and printing to stdout"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|