unw_getcontext.man 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. '\" t
  2. .\" Manual page created with latex2man on Thu Aug 16 09:44:45 MDT 2007
  3. .\" NOTE: This file is generated, DO NOT EDIT.
  4. .de Vb
  5. .ft CW
  6. .nf
  7. ..
  8. .de Ve
  9. .ft R
  10. .fi
  11. ..
  12. .TH "UNW\\_GETCONTEXT" "3" "16 August 2007" "Programming Library " "Programming Library "
  13. .SH NAME
  14. unw_getcontext
  15. \-\- get initial machine\-state
  16. .PP
  17. .SH SYNOPSIS
  18. .PP
  19. #include <libunwind.h>
  20. .br
  21. .PP
  22. int
  23. unw_getcontext(unw_context_t *ucp);
  24. .br
  25. .PP
  26. .SH DESCRIPTION
  27. .PP
  28. The unw_getcontext()
  29. routine initializes the context structure
  30. pointed to by ucp
  31. with the machine\-state of the call\-site. The
  32. exact set of registers stored by unw_getcontext()
  33. is
  34. platform\-specific, but, in general, at least all preserved
  35. (``callee\-saved\&'') and all frame\-related registers, such as the
  36. stack\-pointer, will be stored.
  37. .PP
  38. This routine is normally implemented as a macro and applications
  39. should not attempt to take its address.
  40. .PP
  41. .SH PLATFORM\-SPECIFIC NOTES
  42. .PP
  43. On IA\-64, unw_context_t
  44. has a layout that is compatible with
  45. that of ucontext_t
  46. and such structures can be initialized with
  47. getcontext()
  48. instead of unw_getcontext().
  49. However, the
  50. reverse is \fInot\fP
  51. true and it is \fInot\fP
  52. safe to use structures
  53. initialized by unw_getcontext()
  54. in places where a structure
  55. initialized by getcontext()
  56. is expected. The reason for this
  57. asymmetry is that unw_getcontext()
  58. is optimized for maximum
  59. performance and does not, for example, save the signal mask.
  60. .PP
  61. .SH RETURN VALUE
  62. .PP
  63. On successful completion, unw_getcontext()
  64. returns 0.
  65. Otherwise, a value of \-1 is returned.
  66. .PP
  67. .SH THREAD AND SIGNAL SAFETY
  68. .PP
  69. unw_getcontext()
  70. is thread\-safe as well as safe to use
  71. from a signal handler.
  72. .PP
  73. .SH SEE ALSO
  74. .PP
  75. libunwind(3),
  76. unw_init_local(3)
  77. .PP
  78. .SH AUTHOR
  79. .PP
  80. David Mosberger\-Tang
  81. .br
  82. Email: \fBdmosberger@gmail.com\fP
  83. .br
  84. WWW: \fBhttp://www.nongnu.org/libunwind/\fP\&.
  85. .\" NOTE: This file is generated, DO NOT EDIT.