From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10975 invoked by alias); 13 Feb 2007 14:22:01 -0000 Received: (qmail 10968 invoked by uid 22791); 13 Feb 2007 14:22:00 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 13 Feb 2007 14:21:50 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.1/8.13.1) with ESMTP id l1DELkAi006868 for ; Tue, 13 Feb 2007 09:21:46 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [10.11.255.20]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l1DELjx4016443 for ; Tue, 13 Feb 2007 09:21:45 -0500 Received: from [127.0.0.1] (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l1DELimZ012355 for ; Tue, 13 Feb 2007 09:21:44 -0500 Message-ID: <45D1C970.1020501@redhat.com> Date: Tue, 13 Feb 2007 14:22:00 -0000 From: Andrew Cagney User-Agent: Thunderbird 1.5.0.9 (X11/20070102) MIME-Version: 1.0 To: frysk@sourceware.org Subject: Creating test children and daemons Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact frysk-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: frysk-owner@sourceware.org X-SW-Source: 2007-q1/txt/msg00117.txt.bz2 FYI, I've committed new code for creating test child (direct decendant of TestRunner) and daemon (descendant of process 1, a.k.a. init) processes. The processes can either run code linked in code, or a separate process (started via exec). For instance, and off the top of my head, to create a daemon that just exits: frysk.sys.ProcessIdentifier pid = new frysk.sys.Daemon (new frysk.sys.Execute () { public void execute () { // This as the main and only thread of the daemon. // Beware, there is no java runtime so // you really want to implement this as a native // method in either C or assembler. } }); Redirection to a pipe pair is also possible, instead of frysk.sys.Daemon, call frysk.sys.DaemonPipePair. See frysk.sys.TestPipePair for more examples. Andrew