3 #include <sys/socket.h>
10 struct sockaddr_in6 s
;
11 s
.sin6_family
= AF_INET6
;
12 s
.sin6_port
= htons (80);
14 s
.sin6_addr
= (struct in6_addr
) IN6ADDR_ANY_INIT
;
18 int r
= getnameinfo((struct sockaddr
*) &s
, sizeof (s
), buf
, sizeof (buf
),
19 NULL
, 0, NI_NUMERICSERV
);
20 printf("r = %d, buf = \"%s\"\n", r
, buf
);
23 puts ("failed without NI_NAMEREQD");
28 r
= getnameinfo((struct sockaddr
*) &s
, sizeof (s
), buf
, sizeof (buf
),
29 NULL
, 0, NI_NUMERICSERV
| NI_NAMEREQD
);
30 printf("r = %d, buf = \"%s\"\n", r
, buf
);
33 puts ("did not fail with EAI_NONAME with NI_NAMEREQD set");
40 #define TEST_FUNCTION do_test ()
41 #include "../test-skeleton.c"