[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] Re: ANNOUNCE: New versions of ALL the monadic regions

Subject: Re: [Haskell-cafe] Re: ANNOUNCE: New versions of ALL the monadic regions packages
From: "Brandon S. Allbery KF8NH"
Date: Fri, 8 Jan 2010 00:03:51 -0500
On Jan 7, 2010, at 14:44 , Bas van Dijk wrote:
On Thu, Jan 7, 2010 at 5:18 PM, Bulat Ziganshin
<[email protected]> wrote:
Thursday, January 7, 2010, 6:25:34 PM, you wrote:
So now I'm confused... are these standard file handles always open on program startup or are there abnormal situations when they are closed?
afaik, parent process may close them before executing your program,
it's used in particular for running daemons
Thanks Bulat for explaining.
POSIX actually discourages that, because it's so common for library
routines to assume they can write error messages to stderr; the
approved way to handle daemons is to open the standard file handles
on /dev/null, *not* to close them. There are systems that violate
this, however (the most "fun" one I've encountered is Applications
menu commands in Mac OS X 10.4's X11.app; bash partially works around
it, but not entirely).
So the correct thing to do is to check if they are open on startup,
and if not open /dev/null.
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [email protected]
system administrator [openafs,heimdal,too many hats] [email protected]
electrical and computer engineering, carnegie mellon university    KF8NH

Haskell-Cafe mailing list
[email protected]
<Prev in Thread] Current Thread [Next in Thread>