assert_action

Sets the behavior of assert.

Library:LibC
Service:General C Services

Syntax

  #include <assert.h> 
  
  int assert_action (
     enum   action_code);
  

Parameters

action_code

(IN) Indicates the action to be taken as a result of the assert by specifying one of the following flags:

Flag

Value

Description

_IGNORE

-1

Causes assert to print the error and to return -1, which does not interrupt execution.

_NOERR

0

Causes assert to ignore all errors.

_ABORT

1

Causes assert to print the error and then to abort.

_DEBUGGER

2

Causes assert to print the error and to enter the debugger.

Return Values

If successful in setting the action code, returns 0. Otherwise, returns one of the following errors:

Decimal

Constant

Description

9

EINVAL

The value of the mode parameter is invalid.

105

ENOCONTEXT

No thread context is present.

Remarks

For the virtual machine (NLM) as a whole, assert_action can cause assert to abort, which is the normal, default action. It also can cause assert to print and return (which does not interrupt its execution), or to print and then drop into the system debugger.

See Also