1UNW_SET_CACHING_POLICY(3)    Programming Library     UNW_SET_CACHING_POLICY(3)
2
3
4

NAME

6       unw_set_caching_policy -- set unwind caching policy
7

SYNOPSIS

9       #include <libunwind.h>
10
11       int  unw_set_caching_policy(unw_addr_space_t  as,  unw_caching_policy_t
12       policy);
13

DESCRIPTION

15       The unw_set_caching_policy() routine sets the caching policy of address
16       space  as to the policy specified by argument policy.  The policy argu‐
17       ment can take one of three possible values:
18
19       UNW_CACHE_NONE
20               Turns off caching completely. This also implicitly flushes  the
21              contents of all caches as if unw_flush_cache() had been called.
22
23       UNW_CACHE_GLOBAL
24               Enables  caching  using  a  global  cache that is shared by all
25              threads. If global caching is unavailable or unsupported, libun‐
26              wind   may  fall  back  on  using  a  per-thread  cache,  as  if
27              UNW_CACHE_PER_THREAD had been specified.
28
29       UNW_CACHE_PER_THREAD
30               Enables caching using thread-local caches.  If  a  thread-local
31              caching  are unavailable or unsupported, libunwind may fall back
32              on using a global cache, as if UNW_CACHE_GLOBAL had been  speci‐
33              fied.
34
35       If  caching  is enabled, an application must be prepared to make appro‐
36       priate calls to unw_flush_cache() whenever the target changes in a  way
37       that  could  affect  the  validity of cached information.  For example,
38       after unloading (removing) a shared  library,  unw_flush_cache()  would
39       have  to be called (at least) for the address-range that was covered by
40       the shared library.
41
42       For address spaces created  via  unw_create_addr_space(3),  caching  is
43       turned    off    by    default.    For    the   local   address   space
44       unw_local_addr_space, caching is turned on by default.
45

RETURN VALUE

47       On successful completion, unw_set_caching_policy() returns  0.   Other‐
48       wise the negative value of one of the error-codes below is returned.
49

THREAD AND SIGNAL SAFETY

51       unw_set_caching_policy() is thread-safe but not safe to use from a sig‐
52       nal handler.
53

ERRORS

55       UNW_ENOMEM
56               The desired caching policy could not be established because the
57              application is out of memory.
58

SEE ALSO

60       libunwind(3), unw_create_addr_space(3), unw_flush_cache(3)
61

AUTHOR

63       David Mosberger-Tang
64       Hewlett-Packard Labs
65       Palo-Alto, CA 94304
66       Email: davidm@hpl.hp.com
67       WWW: http://www.hpl.hp.com/research/linux/libunwind/.
68
69
70
71Programming Library             05 August 2004       UNW_SET_CACHING_POLICY(3)
Impressum