This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Can getaddrinfo() be extended to return the record TTL


* Eric Wong:

> Florian Weimer <fweimer@redhat.com> wrote:
>> * David Howells:
>> > If it's not possible to extend getaddrinfo() in this way, would it be possible
>> > to provide a getaddrinfo2() that returns this information through an
>> > additional parameter?
>> 
>> That definitely would be a new ABI.
>> 
>> New ABIs have a lead time of around three years before productization.
>> Is this something you could work with?
>
> Fwiw, gaicb has an "int __glibc_reserved[5]" field; so it's
> probably possible to extend the already-glibc-specific getaddrinfo_a(3)
> to return the TTL.
>
> I was looking into getting the TTL the other week for something
> else, but settled on using a dedicated thread to call
> getaddrinfo(3) every few seconds and publishing updates to other
> threads via URCU.

You could perform the request directly over DNS and if you get back the
same addresses as via getaddrinfo, you can use the TTL you see on DNS.

It's not really nice as far as a programming interface goes, but it
should give you accurate TTL information in most cases.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]