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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 6D7ACBC69 for ; Sat, 15 Sep 2007 20:03:23 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAOe760bLENaMjGdsb2JhbACOEgEBAQgEBgcGGg X-IronPort-AV: E=Sophos;i="4.20,259,1186351200"; d="scan'208";a="1239390" Received: from discorde.inria.fr ([192.93.2.38]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Sep 2007 20:04:06 +0200 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l8FI3fkO026780 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Sat, 15 Sep 2007 20:03:42 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAOe760bLENaMjGdsb2JhbACOEgEBAQgEBgcGGg X-IronPort-AV: E=Sophos;i="4.20,259,1186351200"; d="scan'208";a="1239387" Received: from ipmail01.adl2.internode.on.net ([203.16.214.140]) by mail2-smtp-roc.national.inria.fr with ESMTP; 15 Sep 2007 20:04:04 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAKW460Z5LHvc/2dsb2JhbAAM X-IronPort-AV: E=Sophos;i="4.20,259,1186324200"; d="scan'208";a="191877424" 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:34:02 +0930 Subject: Re: [Caml-list] Closing all open file descriptors From: skaller To: Markus E L Cc: caml-list@inria.fr In-Reply-To: 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> <200709151136.l8FBaH813458@virtutech.se> <1189858565.46ebcd05317b8@webmail.in-berlin.de> Content-Type: text/plain Date: Sun, 16 Sep 2007 04:04:01 +1000 Message-Id: <1189879441.17723.45.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46EC1E7D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; descriptors:01 0200,:01 markus:01 gtk:01 descriptors:01 gtk:01 raf:01 raf:01 sourceforge:01 wrote:01 caml-list:01 handler:03 handler:03 library:03 fork:05 On Sat, 2007-09-15 at 16:29 +0200, Markus E L wrote: > GTK and the X11 library without doubt open a plethora of file > descriptors. If now you fork() in a gtk event handler -- can you tell > me what happens to those file descriptors? No, so don't do it. Instead, start a separate process, and send it a message from the GTK event handler. Then THAT process does the fork/exec to start the daemon. If you want to spawn a demon, get another demon to do it for you:) I suggest OP examine: DAEMON.C(1) and libslack(3) [which was written by one of my friends ] -- John Skaller Felix, successor to C++: http://felix.sf.net