]>
Commit | Line | Data |
---|---|---|
5605e117 UD |
1 | #include <mcheck.h> |
2 | #include <netdb.h> | |
3 | #include <stdio.h> | |
4 | #include <string.h> | |
29fddfc7 | 5 | #include <support/check.h> |
5605e117 | 6 | |
29fddfc7 SL |
7 | static int |
8 | do_test (void) | |
5605e117 UD |
9 | { |
10 | struct addrinfo hints, *res; | |
11 | int i, ret; | |
12 | ||
13 | mtrace (); | |
14 | for (i = 0; i < 100; i++) | |
15 | { | |
16 | memset (&hints, 0, sizeof (hints)); | |
17 | hints.ai_family = PF_UNSPEC; | |
18 | hints.ai_socktype = SOCK_STREAM; | |
19 | ||
20 | ret = getaddrinfo ("www.gnu.org", "http", &hints, &res); | |
21 | ||
22 | if (ret) | |
29fddfc7 SL |
23 | FAIL_EXIT1 ("%s\n", gai_strerror (ret)); |
24 | ||
5605e117 UD |
25 | freeaddrinfo (res); |
26 | } | |
27 | return 0; | |
28 | } | |
29fddfc7 SL |
29 | |
30 | #include <support/test-driver.c> |