public inbox for frysk@sourceware.org
 help / color / mirror / Atom feed
* Creating test children and daemons
@ 2007-02-13 14:22 Andrew Cagney
  0 siblings, 0 replies; only message in thread
From: Andrew Cagney @ 2007-02-13 14:22 UTC (permalink / raw)
  To: frysk

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-13 14:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-13 14:22 Creating test children and daemons Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).