▲ | Someone 3 days ago | |||||||||||||||||||||||||||||||
> Then it needs to sort them if there is more than one address. And in order to do that it needs to read /etc/gai.conf I don’t see why glibc would have to do that inside a call to getaddrinfo. can’t it do that once at library initialization? If it has to react to changes to that file while a process is running, couldn’t it have a separate thread for polling that file for changes, or use inotify for a separate thread to be called when it changes? Swapping in the new config atomically might be problematic, but I would think that is solvable. Even ignoring the issue mentioned it seems wasteful to open, parse, and close that file repeatedly. | ||||||||||||||||||||||||||||||||
▲ | loeg 3 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
I think the libc people might argue this level of functionality is just outside the scope of libc. (Arguably, it is a mistake for DNS to be part of libc, given how complicated it is.) | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | cesarb 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
> I don’t see why glibc would have to do that inside a call to getaddrinfo. can’t it do that once at library initialization? If it were a library dedicated to DNS, sure, but glibc is used by nearly every process in the system, including many which will never call getaddrinfo. | ||||||||||||||||||||||||||||||||
▲ | NewJazz 3 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
You want libc to start a thread whenever it is loaded? | ||||||||||||||||||||||||||||||||
|