Last change
on this file was 2036, checked in by bird, 20 years ago |
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
552 bytes
|
Line | |
---|
1 | /* Test case by Sam Varshavchik <mrsam@courier-mta.com>. */
|
---|
2 | #include <mcheck.h>
|
---|
3 | #include <netdb.h>
|
---|
4 | #include <stdio.h>
|
---|
5 | #include <string.h>
|
---|
6 |
|
---|
7 | int
|
---|
8 | main (void)
|
---|
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)
|
---|
23 | {
|
---|
24 | printf ("%s\n", gai_strerror (ret));
|
---|
25 | return 1;
|
---|
26 | }
|
---|
27 | freeaddrinfo (res);
|
---|
28 | }
|
---|
29 | return 0;
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.