Home Corporate Contacts

TETware Java API Overview


Products
Solutions

Information

Datasheet
Documentation
FAQ
Knowledgebase

11. Generating and Executing Processes


Introduction

These methods enable API-conforming sub-programs to be created and administered.


tet_spawn() and tet_jspawn()

Synopsis


      // public class TestSession
      public long tet_spawn(String file, String[] argv, String[] envp)
                 throws TetException
      public long tet_jspawn(String classname, String[] args, String[] envp)
                 throws TetException

Description

A call to tet_spawn() creates a new sub-program that will use the C API. A call to tet_jspawn() creates a new sub-program that will use the Java API. The interface between these methods and the sub-program launched by them has been designed to enable the sub-program to use a TETware API. Therefore, a sub-program launched by a call to tet_spawn() must be built with the C API's child process controller. Likewise, the class specified by classname in a call to tet_jspawn() must be a subclass of ChildTestCase and must use the Java API's child process controller.

Return value

Both tet_spawn() and tet_jspawn() return the process identifier of the newly created process.

Exceptions

tet_spawn() and tet_jspawn() each throw a TetException object if the API encounters an error while creating the new sub-program.

Application notes

The implementation of tet_jspawn() uses a helper program called jet-spawn which resides in tet-root/bin in the TETware distribution. If this program cannot be executed for any reason, a call to tet_jspawn() will fail.

Portability

Refer to the corresponding section in the chapter entitled "The C API" in the TETware Programmers Guide.


tet_wait()

Synopsis


      // public class TestSession
      public int tet_wait(long pid) throws TetException

Description

A call to tet_wait() waits for the process identified by pid to terminate. pid is the process identifier returned by a previous successful call to tet_spawn() or tet_jspawn().

Return value

A call to tet_wait() returns the exit status of the process identified by pid.

Exceptions

tet_wait() throws a TetException object if the API encounters an error while waiting for the process to terminate.

Portability

Refer to the corresponding section in the chapter entitled "The C API" in the TETware Programmers Guide.


tet_kill()

Synopsis


      // public class TestSession
      public void tet_kill(long pid, int sig) throws TetException

Description

A call to tet_kill() sends the signal specified by sig to the process specified by pid, which should be the process identifier returned by a previous successful call to tet_spawn() or tet_jspawn().

Return value

This method does not return a value.

Exceptions

tet_kill() throws a TetException object if the API encounters an error while sending the signal to the process.

Portability

Refer to the corresponding section in the chapter entitled "The C API'' in the TETware Programmers Guide.

Application notes

Refer to the corresponding section in the chapter entitled "The C API'' in the TETware Programmers Guide.

Return to Contents



Home Contacts Legal Copyright Corporate News

Copyright © The Open Group 1995-2012, All Rights Reserved