diff options
Diffstat (limited to 'elf/dl-tunables.h')
-rw-r--r-- | elf/dl-tunables.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/elf/dl-tunables.h b/elf/dl-tunables.h index 6c49dcbf47..c92882acba 100644 --- a/elf/dl-tunables.h +++ b/elf/dl-tunables.h @@ -111,5 +111,22 @@ rtld_hidden_proto (__tunable_get_val) # define TUNABLES_FRONTEND_valstring 1 /* The default value for TUNABLES_FRONTEND. */ # define TUNABLES_FRONTEND_yes TUNABLES_FRONTEND_valstring + +/* Compare two name strings, bounded by the name hardcoded in glibc. */ +static inline bool +__always_inline +tunable_is_name (const char *orig, const char *envname) +{ + for (;*orig != '\0' && *envname != '\0'; envname++, orig++) + if (*orig != *envname) + break; + + /* The ENVNAME is immediately followed by a value. */ + if (*orig == '\0' && *envname == '=') + return true; + else + return false; +} + #endif #endif |