On Mon, Aug 24, 2020 at 06:09:23PM -0400, Rich Felker wrote: > On Mon, Aug 24, 2020 at 11:51:52PM +0200, Daniel Neri wrote: > > On 24 Aug 2020, at 23:32, Rich Felker wrote: > > > > > > Does such a distinction exist? I thought res_query was just equivalent > > > to res_mkquery+res_send and that calling res_send directly would get > > > you the same errors. > > > > I thought so too, but I’ve been reading the musl implementation. ;-) > > > > After looking more at the other implementations, I think Florian is > > correct though: it’s more like res_mkquery+res_send+setting h_errno > > and the return value based on the RCODE of the response. > > If this is indeed the case and the right behavior can be obtained > reliably by ignoring res_query and using res_mkquery+res_send, I have > no fundamental objection to changing this. However we should have a > plan for moving h_errno to be thread-local and figuring out what > breakage if any there could be for apps built with it global. > > Thankfully, it looks like we're already using (*__h_errno_location()) > even though it was not thread-local, so existing apps built against > current musl headers should be immediately compatible with changing it > to be thread-local. I have the attached patches queued now. Rich