unw_getcontext.tex 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. \documentclass{article}
  2. \usepackage[fancyhdr,pdf]{latex2man}
  3. \input{common.tex}
  4. \begin{document}
  5. \begin{Name}{3}{unw\_getcontext}{David Mosberger-Tang}{Programming Library}{unw\_getcontext}unw\_getcontext -- get initial machine-state
  6. \end{Name}
  7. \section{Synopsis}
  8. \File{\#include $<$libunwind.h$>$}\\
  9. \Type{int} \Func{unw\_getcontext}(\Type{unw\_context\_t~*}\Var{ucp});\\
  10. \section{Description}
  11. The \Func{unw\_getcontext}() routine initializes the context structure
  12. pointed to by \Var{ucp} with the machine-state of the call-site. The
  13. exact set of registers stored by \Func{unw\_getcontext}() is
  14. platform-specific, but, in general, at least all preserved
  15. (``callee-saved'') and all frame-related registers, such as the
  16. stack-pointer, will be stored.
  17. This routine is normally implemented as a macro and applications
  18. should not attempt to take its address.
  19. \section{Platform-specific Notes}
  20. On IA-64, \Type{unw\_context\_t} has a layout that is compatible with
  21. that of \Type{ucontext\_t} and such structures can be initialized with
  22. \Func{getcontext}() instead of \Func{unw\_getcontext}(). However, the
  23. reverse is \emph{not} true and it is \emph{not} safe to use structures
  24. initialized by \Func{unw\_getcontext()} in places where a structure
  25. initialized by \Func{getcontext()} is expected. The reason for this
  26. asymmetry is that \Func{unw\_getcontext()} is optimized for maximum
  27. performance and does not, for example, save the signal mask.
  28. \section{Return Value}
  29. On successful completion, \Func{unw\_getcontext}() returns 0.
  30. Otherwise, a value of -1 is returned.
  31. \section{Thread and Signal Safety}
  32. \Func{unw\_getcontext}() is thread-safe as well as safe to use
  33. from a signal handler.
  34. \section{See Also}
  35. \SeeAlso{libunwind(3)},
  36. \SeeAlso{unw\_init\_local(3)}
  37. \section{Author}
  38. \noindent
  39. David Mosberger-Tang\\
  40. Email: \Email{dmosberger@gmail.com}\\
  41. WWW: \URL{http://www.nongnu.org/libunwind/}.
  42. \LatexManEnd
  43. \end{document}