[PATCH v5 1/4] Add system-wide tunables: ldconfig part

DJ Delorie dj@redhat.com
Wed Feb 18 03:21:05 GMT 2026


Yury Khrustalev <yury.khrustalev@arm.com> writes:
> On Mon, Dec 04, 2023 at 08:48:18PM -0500, DJ Delorie wrote:
>> 
>> Adds support for reading /etc/tunables.conf
>
> Overall I think this commit should be preceded with a refactoring of
> reading ld config files to allow for also reading other types of
> configs. The size of duplicated code is huge, IMO.

I posted a proposal seperately.  I can rebase this set if that patch
looks OK.

> However, it's good that we have this version now as we can see what
> might be required of the generalised version of existing code.

Yeah, I'm trying to resist perfection because the core needs to get in
so folks can start using it and poking around its use case edges.

>> !glibc.foo=0
>>    ^ May be made more secure
>> +glibc.foo=0
>>    ^ May be overridden
>> -glibc.foo=0
>>    ^ May not be overridden
>
> We need tests for all this. Let me know if you don't have time for
> writing them, I think I can help with that, though I don't know how to
> combine two patch series when one depends on the other.

We do, but those restrictions have not actually been implemented yet...
(they'd go in part 3/4 anyway).  Unless you mean testing the parser?
Still, the part 3 tests cover that anyway.

Part of the problem is that each tunable needs its own check for what
"more restrictive" means.  I didn't have a good answer for that so I
deferred it.

And yes there are a LOT of tests we could write.  So far I have one, for
the basic functionality I've implemented.

>> +      printf("%s:%d: syntax error, line ignored: `%s' (missing '=')\n",
>> +	     filename, lineno, orig_line);
>
> I think ldconfig.c uses error(...) function from error.h rather than
> printf.

Yup, I changed them to error_at_line ().

>> ...
>>
>> +  for (i=0; i<TUNABLE_NAME_MAX; i++)
>> +    if (strcmp (tunable_list[i].name, name) == 0)
>
> The TUNABLE_NAME_MAX is not the length of tunable_list, you should use
> something like
>
>   enum { tunables_list_size = array_length (tunable_list) };
>
> from elf/dl-tunables.c.

Fixed.



More information about the Libc-alpha mailing list