Add libresolv from Musl Libc

Locally modified to get nameservers from Windows Registry when
`\etc\resolv.conf` isn't defined.
This commit is contained in:
Justine Tunney 2023-12-08 20:03:03 -08:00
parent 8874a37abc
commit 1a96de6eda
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
36 changed files with 2313 additions and 73 deletions

View file

@ -23,6 +23,10 @@
#include "libc/calls/struct/iovec.h"
#include "libc/calls/struct/iovec.internal.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/intrin/kprintf.h"
#include "libc/intrin/strace.internal.h"
#include "libc/runtime/runtime.h"
#include "libc/sock/sock.h"
#include "libc/sock/struct/msghdr.h"
#include "libc/sock/struct/msghdr.internal.h"
@ -99,12 +103,12 @@ ssize_t recvmsg(int fd, struct msghdr *msg, int flags) {
}
END_CANCELATION_POINT;
#if defined(SYSDEBUG) && _DATATRACE
#if SYSDEBUG && _DATATRACE
if (__strace > 0 && strace_enabled(0) > 0) {
if (!msg || (rc == -1 && errno == EFAULT)) {
DATATRACE("recvmsg(%d, %p, %#x) → %'ld% m", fd, msg, flags, rc);
} else {
kprintf(STRACE_PROLOGUE "recvmsg(%d, [{");
kprintf(STRACE_PROLOGUE "recvmsg(%d, [{", fd);
if (msg->msg_namelen)
kprintf(".name=%#.*hhs, ", msg->msg_namelen, msg->msg_name);
if (msg->msg_controllen)