mirror of https://github.com/mkerrisk/man-pages
backtrace.3: Minor reworking in example program
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
bf92bef9c9
commit
cefcfd92d5
|
@ -211,15 +211,16 @@ backtrace() returned 8 addresses
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define BT_BUF_SIZE 100
|
||||
|
||||
void
|
||||
myfunc3(void)
|
||||
{
|
||||
int j, nptrs;
|
||||
const int SIZE = 100;
|
||||
void *buffer[SIZE];
|
||||
void *buffer[BT_BUF_SIZE];
|
||||
char **strings;
|
||||
|
||||
nptrs = backtrace(buffer, SIZE);
|
||||
nptrs = backtrace(buffer, BT_BUF_SIZE);
|
||||
printf("backtrace() returned %d addresses\\n", nptrs);
|
||||
|
||||
/* The call backtrace_symbols_fd(buffer, nptrs, STDOUT_FILENO)
|
||||
|
|
Loading…
Reference in New Issue