From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA00830; Fri, 19 Jul 2002 15:08:12 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA00825 for ; Fri, 19 Jul 2002 15:08:12 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6JD8Bv16048; Fri, 19 Jul 2002 15:08:11 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA00822; Fri, 19 Jul 2002 15:08:10 +0200 (MET DST) Date: Fri, 19 Jul 2002 15:08:10 +0200 From: Xavier Leroy To: Basile STARYNKEVITCH Cc: caml-list@inria.fr Subject: Re: [Caml-list] Unix subdaemon, channels, filedescriptors.... Message-ID: <20020719150810.B265@pauillac.inria.fr> References: <15669.31207.415691.386109@is002254.saclay.cea.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <15669.31207.415691.386109@is002254.saclay.cea.fr>; from basile.starynkevitch@cea.fr on Wed, Jul 17, 2002 at 04:06:31PM +0200 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > I am coding in Ocaml a daemon program (the Poesia monitor - see > http://www.poesia-filter.org/) which happens to launch daemon > subprocesses, i.e. it fork and execs processes which do not use their > stdin stdout and stderr. Basically I would need something like a > Unix.process_none which forks a command without any stdin stdout and > stderr (which are technically redirected to /dev/null). This can easily be written in terms of Unix.fork and Unix.exec; you can use the sources for the Unix.process_* functions as a starting point. > Also, Unix.open_process_in and related seems to forget closing the > file descriptors in the child process, as this example (running only > on Linux) demonstrates: This is standard Unix behavior: file descriptors are preserved across "exec", unless they were set to "close on exec" mode before the exec (see Unix.set_close_on_exec). - Xavier Leroy ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners