This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3] Implement strlcpy [BZ #178]
- From: Zack Weinberg <zackw at panix dot com>
- To: libc-alpha at sourceware dot org
- Date: Tue, 10 Nov 2015 21:20:10 -0500
- Subject: Re: [PATCH v3] Implement strlcpy [BZ #178]
- Authentication-results: sourceware.org; auth=none
- References: <56326B79 dot 8070804 at redhat dot com> <20151105211104 dot D10932C3B22 at topped-with-meat dot com> <20151106040125 dot GY8645 at brightrain dot aerifal dot cx> <563C9871 dot 9090700 at linaro dot org> <563E9BE6 dot 40508 at googlemail dot com> <20151108010732 dot GH3818 at brightrain dot aerifal dot cx> <alpine dot DEB dot 2 dot 10 dot 1511091256260 dot 26853 at digraph dot polyomino dot org dot uk> <20151109181635 dot GP3818 at brightrain dot aerifal dot cx>
On 11/09/2015 01:16 PM, Rich Felker wrote:
> On Mon, Nov 09, 2015 at 12:59:25PM +0000, Joseph Myers wrote:
>> On Sat, 7 Nov 2015, Rich Felker wrote:
>>
>>> Anyway, in general, if adding a function to glibc is a bad idea,
>>> adding it in its own separate .so file shipped with glibc is an even
>>> worse idea. There are no advantages and lots of disadvantages.
>>
>> While it's trivially true that "adding a function to glibc is a bad idea"
>> means it's bad to add it to any library in glibc, existing or new, there
>> may well be cases where the conclusion is "it's a good idea to add this
>> function to glibc, but in a new library (which might be might not be
>> linked in automatically via AS_NEEDED in a .so linker script)". Cf.
>> libmvec or the libinux-syscalls.so.1 discussion. It's just that I don't
>> see strlcpy, strlcat or explicit_bzero as such cases - I see them as cases
>> that belong in libc.
>
> Could you elaborate on when/how there would ever be a technical (not
> ideologically-motivated) reason to add additional .so's as part of
> glibc? I see all the ones we have (esp. libpthread and librt) as
> historical mistakes that have been a perpetual source of problems
> (like programs sticking with the deprecated gettimeofday instead of
> clock_gettime because the latter needed -lrt, and broken weak symbol
> hacks for pthreads like gcc pr57740, pr60662, or libxml2 pr704904)
> that we should aim to eliminate, not duplicate.
FWIW, I tend to agree with this.
zw