SysSetAbortCallback

Table of Contents

SysSetAbortCallback

Description

Set a custom callback function for SysAbort. If no callback is set, SysAbort will call the standard abort() function.

Parameters

NameDirectionDescription
callbackinFunction to call when SysAbort is invoked, or NULL to reset to default.

Success

Callback is set.

Failure

Function cannot fail.

Usage example (Cross-references)

    static SysAbortCallback g_abort_callback = NULL;
    
    void SysSetAbortCallback(SysAbortCallback callback) {
    g_abort_callback = callback;
    }
    
    // Set our custom abort handler
    SysSetAbortCallback(test_abort_handler);
    
    // For non-deadend tests, run normally
    
    // Reset abort handler to default
    SysSetAbortCallback(NULL);
    
    return test_result;

Share :

Related Posts

void

void Description Type-specific write callback signature

Read More

test_deadend

test_deadend Description Run a specific test function using setjmp/longjmp to capture aborts. This is used for deadend tests that are expected to call LOG_FATAL.

Read More

bool

bool Description Function pointer type for test functions.

Read More