From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BEE18BC69 for ; Sat, 15 Sep 2007 19:44:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIO260bAXQInmWdsb2JhbACOEgEBAQEHBAYHCBY X-IronPort-AV: E=Sophos;i="4.20,259,1186351200"; d="scan'208";a="2745060" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 15 Sep 2007 19:44:43 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8FHiJ00009426 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 15 Sep 2007 19:44:20 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIO260bLENaMjGdsb2JhbACOEgEBAQgEBgcGGg X-IronPort-AV: E=Sophos;i="4.20,259,1186351200"; d="scan'208";a="822443" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail1-smtp-roc.national.inria.fr with ESMTP; 15 Sep 2007 19:44:41 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABu160Z5LHvc/2dsb2JhbAAM X-IronPort-AV: E=Sophos;i="4.20,259,1186324200"; d="scan'208";a="191871275" Received: from ppp121-44-123-220.lns10.syd6.internode.on.net (HELO [192.168.1.201]) ([121.44.123.220]) by ipmail01.adl2.internode.on.net with ESMTP; 16 Sep 2007 03:14:35 +0930 Subject: Re: [Caml-list] Closing all open file descriptors From: skaller To: Markus E L Cc: caml-list@inria.fr In-Reply-To: <5fps0k9fp4.fsf@hod.lan.m-e-leypold.de> References: <006b01c7f699$275fd6d0$017ca8c0@countertenor> <200709141000.l8EA04x12648@virtutech.se> <1189806728.46eb0288d38b8@webmail.in-berlin.de> <1189847741.46eba2bd9d121@webmail.in-berlin.de> <20070915192631.2384ae5a.mle+ocaml@mega-nerd.com> <1189852990.46ebb73e7edc3@webmail.in-berlin.de> <5fps0k9fp4.fsf@hod.lan.m-e-leypold.de> Content-Type: text/plain Date: Sun, 16 Sep 2007 03:44:34 +1000 Message-Id: <1189878274.17723.37.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46EC19F3.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; descriptors:01 0200,:01 markus:01 descriptors:01 indirection:01 sourceforge:01 wrote:01 caml-list:01 inherited:04 tcl:05 executing:07 background:91 john:08 i'm:09 felix:09 On Sat, 2007-09-15 at 16:16 +0200, Markus E L wrote: > Let's assume (as an example) I'm starting a demon / background process > by clicking on an icon in a desktop environment. Which file > descriptors are open when the demon starts executing? The solution to all problems in Computer Science is already known: "add another level of indirection". [Tcl and Perl version .. double the quotes and escape characters .. :] In this case: a) the Desktop must keep track of its file descriptors F b) it starts Helper which is passed F and closes them c) Helper then starts Plugin with no open file descriptors: --> Plugin doesn't need to close inherited file descriptors If Desktop doesn't do that, Desktop is screwed. -- John Skaller Felix, successor to C++: http://felix.sf.net