3 #include <sys/socket.h>
11 s.sin_family = AF_INET;
13 s.sin_addr.s_addr = INADDR_LOOPBACK;
14 int r = getnameinfo((struct sockaddr *) &s, sizeof (s), NULL, 0, NULL, 0,
15 NI_NUMERICHOST | NI_NUMERICSERV);
16 printf("r = %d\n", r);
19 puts ("failed without NI_NAMEREQD");
23 r = getnameinfo((struct sockaddr *) &s, sizeof (s), NULL, 0, NULL, 0,
24 NI_NUMERICHOST | NI_NUMERICSERV | NI_NAMEREQD);
25 printf("r = %d\n", r);
28 puts ("did not fail with EAI_NONAME with NI_NAMEREQD set");
35 #define TEST_FUNCTION do_test ()
36 #include "../test-skeleton.c"