SYS_atexit
Application Program Interface
2-455
C Interface
Syntax
success = SYS_atexit(handler);
Parameters
Fxn
handler
/* exit handler function */
Return Value
Bool
success
/* handler successfully stacked */
Description
SYS_atexit pushes handler onto an internal stack of functions to be
executed when SYS_exit is called. Up to SYS_NUMHANDLERS(8)
functions can be specified in this manner. SYS_exit pops the internal
stack until empty and calls each function as follows, where status is the
parameter passed to SYS_exit:
(*handler)(status)
SYS_atexit returns TRUE if handler has been successfully stacked;
FALSE if the internal stack is full.
The handlers on the stack are called only if either of the following
happens:
❏
SYS_exit is called.
❏
All tasks for which the Don’t shut down system while this task is still
running property is TRUE have exited. (By default, this includes the
TSK_idle task, which manages communication between the target
and analysis tools.)
Constraints and
Calling Context
❏
handler cannot be NULL.
SYS_atexit
Stack an exit handler