util: Update os_get_option* comments to match os_set_option

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38640>
This commit is contained in:
Yonggang Luo 2025-11-25 18:03:30 +08:00 committed by Marge Bot
parent 2771eb39fd
commit 5ab8148f23

View file

@ -83,7 +83,8 @@ os_log_message(const char *message);
/*
* Get an option. Should return NULL if specified option is not set.
* Get an option(environment variable or os property) in a platform independent way.
* Should return NULL if specified option for @name is not set.
* It has the same disadvantage as getenv, see
* https://wiki.sei.cmu.edu/confluence/display/c/ENV34-C.+Do+not+store+pointers+returned+by+certain+functions
*/
@ -101,7 +102,8 @@ char *
os_get_option_dup(const char *name);
/*
* Get an option. Should return NULL if specified option is not set.
* Get an option(environment variable or os property) in a platform independent way.
* Should return NULL if specified option for @name is not set.
* Same as `os_get_option()` but uses `secure_getenv()` instead of `getenv()`
*/
const char *
@ -118,12 +120,13 @@ char *
os_get_option_secure_dup(const char *name);
/*
* Get an option. Should return NULL if specified option is not set.
* Get an option(environment variable or os property) in a platform independent way.
* Should return NULL if specified option for @name is not set.
* It's will save the option into hash table for the first time, and
* for latter calling, it's will return the value comes from hash table
* directly, and the returned value will always be valid before program exit
* The disadvantage is that setenv, unsetenv, putenv won't take effect
* after this function is called
* The disadvantage is that os_set_option won't take effect after this
* function is called
*/
const char *
os_get_option_cached(const char *name);