github.com/afumu/libc@v0.0.6/musl/src/network/res_querydomain.c (about) 1 #include <resolv.h> 2 #include <string.h> 3 4 int res_querydomain(const char *name, const char *domain, int class, int type, unsigned char *dest, int len) 5 { 6 char tmp[255]; 7 size_t nl = strnlen(name, 255); 8 size_t dl = strnlen(domain, 255); 9 if (nl+dl+1 > 254) return -1; 10 memcpy(tmp, name, nl); 11 tmp[nl] = '.'; 12 memcpy(tmp+nl+1, domain, dl+1); 13 return res_query(tmp, class, type, dest, len); 14 }