From ad2f35cb396d24391150675fb55311c98d1e1592 Mon Sep 17 00:00:00 2001 From: Siddhesh Poyarekar Date: Wed, 17 May 2017 13:11:55 +0530 Subject: tunables: Add support for tunables of uint64_t type Recognize the uint64_t type in addition to the current int32_t and size_t. This allows addition of tunables of uint64_t types. In addition to adding the uint64_t type, this patch also consolidates validation and reading of integer types in tunables. One notable change is that of overflow computation in tunables_strtoul. The function was lifted from __internal_strtoul, but it does not need the boundary condition check (i.e. result == ULONG_MAX) since it does not need to set errno. As a result the check can be simplified, which I have now done. * elf/dl-tunable-types.h (tunable_type_code_t): New type TUNABLE_TYPE_UINT_64. * elf/dl-tunables.c (tunables_strtoul): Return uint64_t. Simplify computation of overflow. (tunable_set_val_if_valid_range_signed, tunable_set_val_if_valid_range_unsigned): Remove and replace with this... (TUNABLE_SET_VAL_IF_VALID_RANGE): ... New macro. (tunable_initialize): Adjust. Add uint64_t support. (__tunable_set_val): Add uint64_t support. * README.tunables: Document it. --- README.tunables | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'README.tunables') diff --git a/README.tunables b/README.tunables index 3f16b5d..0e9b0d7 100644 --- a/README.tunables +++ b/README.tunables @@ -48,7 +48,8 @@ TOP_NAMESPACE { The list of allowed attributes are: - type: Data type. Defaults to STRING. Allowed types are: - INT_32, SIZE_T and STRING. + INT_32, UINT_64, SIZE_T and STRING. Numeric types may + be in octal or hexadecimal format too. - minval: Optional minimum acceptable value. For a string type this is the minimum length of the value. -- cgit v1.1