blob: 9f37c135400e66266ba0ec7bb9289646299748cc [file] [log] [blame]
Viet-Trung Luu96b05c12016-01-11 11:26:36 -08001#include <resolv.h>
2#include <netdb.h>
3#include "libc.h"
4
George Kulakowski17e3b042016-02-18 15:59:50 -08005int __res_mkquery(int,
6 const char*,
7 int,
8 int,
9 const unsigned char*,
10 int,
11 const unsigned char*,
12 unsigned char*,
13 int);
14int __res_send(const unsigned char*, int, unsigned char*, int);
Viet-Trung Luu96b05c12016-01-11 11:26:36 -080015
George Kulakowski17e3b042016-02-18 15:59:50 -080016int __res_query(const char* name,
17 int class,
18 int type,
19 unsigned char* dest,
20 int len) {
21 unsigned char q[280];
22 int ql = __res_mkquery(0, name, class, type, 0, 0, 0, q, sizeof q);
23 if (ql < 0)
24 return ql;
25 return __res_send(q, ql, dest, len);
Viet-Trung Luu96b05c12016-01-11 11:26:36 -080026}
27
28weak_alias(__res_query, res_query);
29weak_alias(__res_query, res_search);