Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
wiki1351: Cached_Confstr (Version 1)

Cached confstr() values#

The confstr() function fetches system configuration strings, such as CS_TIMEZONE.

In Trinity 2, there is a new option to cache these values locally, making use of the procmgr_event_notify() API to be notified of any change to a configuration string.

You can enable default handling of confstr caching by calling confstr_cache_attach().

NOTE - each application can only have one procmgr_event_notify() event registered (although that event may be triggered by multiple flags). If you are already using procmgr_event_notify() elsewhere in your application, and wish to make use of confstr caching, simply add PROCMGR_EVENT_CONFSTR to your set of notification flags, and enable confstr caching by calling confstr_cache_enable().

Upon receipt of the registered event, invalidate the cache with confstr_cache_invalidate().

You can also disable caching by calling confstr_cache_disable().