synccall: add separate exit_sem to fix thread release logic bug
[musl.git] / src / network / res_send.c
blob9593164db0df4f0ee095f6677e95844217812248
1 #include <resolv.h>
2 #include <string.h>
4 int __res_send(const unsigned char *msg, int msglen, unsigned char *answer, int anslen)
6 int r;
7 if (anslen < 512) {
8 unsigned char buf[512];
9 r = __res_send(msg, msglen, buf, sizeof buf);
10 if (r >= 0) memcpy(answer, buf, r < anslen ? r : anslen);
11 return r;
13 r = __res_msend(1, &msg, &msglen, &answer, &anslen, anslen);
14 return r<0 || !anslen ? -1 : anslen;
17 weak_alias(__res_send, res_send);