1\documentclass{article} 2\usepackage[fancyhdr,pdf]{latex2man} 3 4\input{common.tex} 5 6\begin{document} 7 8\begin{Name}{3}{unw\_backtrace}{David Mosberger-Tang}{Programming Library}{unw\_backtrace}unw\_backtrace -- return backtrace for the calling program 9\end{Name} 10 11\section{Synopsis} 12 13\File{\#include $<$libunwind.h$>$}\\ 14 15\Type{int} \Func{unw\_backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\ 16 17\File{\#include $<$execinfo.h$>$}\\ 18 19\Type{int} \Func{backtrace}(\Type{void~**}\Var{buffer}, \Type{int}~\Var{size});\\ 20 21\section{Description} 22 23\Func{unw\_backtrace}() is a convenient routine for obtaining the backtrace for 24the calling program. The routine fills up to \Var{size} addresses in the array 25pointed by \Var{buffer}. The routine is only available for local unwinding. 26 27Note that many (but not all) systems provide practically identical function 28called \Func{backtrace}(). The prototype for this function is usually obtained 29by including the \File{$<$execinfo.h$>$} header file -- a prototype for 30\Func{backtrace}() is not provided by \Prog{libunwind}. \Prog{libunwind} weakly 31aliases \Func{backtrace}() to \Func{unw\_backtrace}(), so when a program 32calling \Func{backtrace}() is linked against \Prog{libunwind}, it may end up 33calling \Func{unw\_backtrace}(). 34 35\section{Return Value} 36 37The routine returns the number of addresses stored in the array pointed by 38\Var{buffer}. The return value may be zero to indicate that no addresses were 39stored. 40 41\section{See Also} 42 43\SeeAlso{libunwind(3)}, 44\SeeAlso{unw\_step(3)} 45 46\section{Author} 47 48\noindent 49David Mosberger-Tang\\ 50Email: \Email{dmosberger@gmail.com}\\ 51WWW: \URL{http://www.nongnu.org/libunwind/}. 52\LatexManEnd 53 54\end{document} 55