Files
zig/lib/libc/musl/src/network/res_querydomain.c
Andrew Kelley 49d1a4c562 move lib dirs to lib subdir
also start prefering NtDll API. so far:
 * NtQueryInformationFile
 * NtClose

adds a performance workaround for windows unicode conversion. but that
should probably be removed before merging
2019-07-15 17:54:50 -04:00

15 lines
390 B
C
Vendored

#include <resolv.h>
#include <string.h>
int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len)
{
char tmp[255];
size_t nl = strnlen(name, 255);
size_t dl = strnlen(domain, 255);
if (nl+dl+1 > 254) return -1;
memcpy(tmp, name, nl);
tmp[nl] = '.';
memcpy(tmp+nl+1, domain, dl+1);
return res_query(tmp, class, type, dest, len);
}