rciAbort(3)

NAME
rciAbort, rciAbortErrors -- abort an RCI control session.

USAGE
rciAbort(code, format, [arg1] ... [,argn])
   int code;
   char *format;

rciAbortErrors()

ARGUMENTS

code --
    Error code.

format --
    printf() style format string.

args --
    Values to be printed in the message.

DESCRIPTION
rciAbort() is a routine that may be called from any part of an RCI program to cause an RCI abort. Upon an abort condition, all tasks are released, and an abort handler (bound the to signal SIGHUP) is called in the planning task. An abort is associated with an integer code and a message, which are passed as arguments to the abort handler along with information about which control task and CPU originated the abort. The maximum size of the message produced should not exceed EMSG_MAX (defined in h/errlog.h).

Once an abort condition has been asserted, subsequent calls to rciAbort() are ignored until all tasks are released.

rciAbortErrors() is similar to rciAbort(), except that instead of taking code and message arguments, it uses the current contents of the task's error stack (see errorStack(3)). The code is taken to be the most recently placed error code, and the message is taken to be the current list of error messages.

The abort routine works by setting abort flags in the control blocks of all the active tasks, and then sending a SIGHUP signal to the planning task. The system catches the signal and then waits for all active tasks to acknowledge the abort and release themselves before calling the abort handler. If this does not happen in a reasonable length of time, a fatal condition is raised and the program exits.

The default abort handler simply prints out task information and the abort message, and calls exit(2). The programmer can set up his/her own abort handler with the call rciAbortHandler() (q.v.).

DIAGNOSTICS
rciAbort() returns 1 normally, or 0 if an abort condition has already been asserted.

SEE ALSO
errorStack(3), rciAbortHandler(3).

"Standard" error codes for rciAbort() are defined in h/errorCodes.h.