Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

bt_init_accessor()

Initialize a backtrace accessor


Note: The backtrace library is an unsupported feature, due to its fragility. For more information, see Backtraces in the QNX Neutrino technotes.

Synopsis:

#include <backtrace.h>

int bt_init_accessor( bt_accessor_t *acc,
                      bt_acc_type_t type, ...);

Arguments:

acc
A pointer to a bt_accessor_t structure. This is an opaque structure that holds the identity of the thread to backtrace.
type
The type of backtrace to perform; one of:

Additional arguments are required for BT_THREAD and BT_PROCESS, as described below.

Library:

libbacktrace

Use the -l backtrace option to qcc to link against this library.

Description:

The bt_init_accessor() function initializes the accessor with the identity of the thread to backtrace:


Note: The bt_acc_self global variable is a preinitialized accessor used to backtrace the current thread. Don't call bt_init_accessor() or bt_release_accessor() for this variable.

Returns:

0
Success.
-1
An error occurred (errno is set).

Errors:

EINVAL
The acc argument is NULL, or the type is invalid.

Classification:

QNX Neutrino

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

bt_get_backtrace(), bt_load_memmap(), bt_release_accessor(), bt_set_flags(), bt_sprn_memmap(), bt_sprnf_addrs(), bt_translate_addrs(), bt_unload_memmap()

Backtraces in the QNX Neutrino technotes

pidin backtrace in the Utilities Reference