LibC: Implement gethostbyname() by talking to the DNSLookupServer.

We now talk to the lookup server over a local socket and it does the lookup
on our behalf. Including some retry logic, which is nice, because it seems
like DNS requests disappear in the ether pretty damn often where I am.
This commit is contained in:
Andreas Kling 2019-03-20 01:15:22 +01:00
commit 0e4a1936ca
Notes: sideshowbarker 2024-07-19 15:00:09 +09:00
7 changed files with 213 additions and 36 deletions

View file

@ -85,9 +85,15 @@ VFS* vfs;
int error;
auto* dns_lookup_server_process = Process::create_user_process("/bin/DNSLookupServer", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0);
if (error != 0) {
dbgprintf("error spawning DNSLookupServer: %d\n", error);
hang();
}
auto* window_server_process = Process::create_user_process("/bin/WindowServer", (uid_t)100, (gid_t)100, (pid_t)0, error, { }, { }, tty0);
if (error != 0) {
dbgprintf("error: %d\n", error);
dbgprintf("error spawning WindowServer: %d\n", error);
hang();
}
window_server_process->set_priority(Process::HighPriority);