Forcing a child task to terminateΒΆ

end_process()

Forcing a child task to terminate


SYNTAX

end_process(server_name, child_handle, exitcode)

Forces the child process whose handle is child_handle to terminate. The child process is executed by means of the execute() function.

server_name

The name of the server on which the task was run. This value should be set to NULL or to a null string if the task was a local process.

child_handle

A field containing the handle. The handle is the return value from the execute() function call that started the child process, and should be stored in an i4 type field.

exitcode

Under Windows, the process exits with the exitcode specified.

Under UNIX, exitcode is the interrupt to be sent to the process. The value 0 (zero) means the the default, SIGTERM, should be sent.


Note

Child processes can also be executed by the exec command, but in this case no handle is returned and end_process() is irrelevant.


EXAMPLE

!temp Handle,,i4

    tmp.Handle4 = execute("server2", "-srepwc prog4", NULL, 0, AA_SHOWNORMAL)
    ...
    end_process("server2", tmp.Handle4, 2)

RELATED TOPICS

close_handle()

execute()

exitcode()

exec()

exit