unw_set_caching_policy.tex 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. \documentclass{article}
  2. \usepackage[fancyhdr,pdf]{latex2man}
  3. \input{common.tex}
  4. \begin{document}
  5. \begin{Name}{3}{unw\_set\_caching\_policy}{David Mosberger-Tang}{Programming Library}{unw\_set\_caching\_policy}unw\_set\_caching\_policy -- set unwind caching policy
  6. \end{Name}
  7. \section{Synopsis}
  8. \File{\#include $<$libunwind.h$>$}\\
  9. \Type{int} \Func{unw\_set\_caching\_policy}(\Type{unw\_addr\_space\_t} \Var{as}, \Type{unw\_caching\_policy\_t} \Var{policy});\\
  10. \section{Description}
  11. The \Func{unw\_set\_caching\_policy}() routine sets the caching policy
  12. of address space \Var{as} to the policy specified by argument
  13. \Var{policy}. The \Var{policy} argument can take one of three
  14. possible values:
  15. \begin{description}
  16. \item[\Const{UNW\_CACHE\_NONE}] Turns off caching completely. This
  17. also implicitly flushes the contents of all caches as if
  18. \Func{unw\_flush\_cache}() had been called.
  19. \item[\Const{UNW\_CACHE\_GLOBAL}] Enables caching using a global cache
  20. that is shared by all threads. If global caching is unavailable or
  21. unsupported, \Prog{libunwind} may fall back on using a per-thread
  22. cache, as if \Const{UNW\_CACHE\_PER\_THREAD} had been specified.
  23. \item[\Const{UNW\_CACHE\_PER\_THREAD}] Enables caching using
  24. thread-local caches. If a thread-local caching are unavailable or
  25. unsupported, \Prog{libunwind} may fall back on using a global cache,
  26. as if \Const{UNW\_CACHE\_GLOBAL} had been specified.
  27. \end{description}
  28. If caching is enabled, an application must be prepared to make
  29. appropriate calls to \Func{unw\_flush\_cache}() whenever the target
  30. changes in a way that could affect the validity of cached information.
  31. For example, after unloading (removing) a shared library,
  32. \Func{unw\_flush\_cache}() would have to be called (at least) for the
  33. address-range that was covered by the shared library.
  34. For address spaces created via \Func{unw\_create\_addr\_space}(3),
  35. caching is turned off by default. For the local address space
  36. \Func{unw\_local\_addr\_space}, caching is turned on by default.
  37. \section{Return Value}
  38. On successful completion, \Func{unw\_set\_caching\_policy}() returns 0.
  39. Otherwise the negative value of one of the error-codes below is
  40. returned.
  41. \section{Thread and Signal Safety}
  42. \Func{unw\_set\_caching\_policy}() is thread-safe but \emph{not} safe
  43. to use from a signal handler.
  44. \section{Errors}
  45. \begin{Description}
  46. \item[\Const{UNW\_ENOMEM}] The desired caching policy could not be
  47. established because the application is out of memory.
  48. \end{Description}
  49. \section{See Also}
  50. \SeeAlso{libunwind(3)},
  51. \SeeAlso{unw\_create\_addr\_space(3)},
  52. \SeeAlso{unw\_flush\_cache(3)}
  53. \section{Author}
  54. \noindent
  55. David Mosberger-Tang\\
  56. Email: \Email{dmosberger@gmail.com}\\
  57. WWW: \URL{http://www.nongnu.org/libunwind/}.
  58. \LatexManEnd
  59. \end{document}