File: bug-ga2.c

package info (click to toggle)
glibc 2.42-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 312,844 kB
  • sloc: ansic: 1,061,027; asm: 238,416; makefile: 20,970; python: 13,509; sh: 11,828; cpp: 5,188; awk: 1,794; perl: 317; yacc: 292; pascal: 182; sed: 19
file content (30 lines) | stat: -rw-r--r-- 546 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <mcheck.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <support/check.h>

static int
do_test (void)
{
  struct addrinfo hints, *res;
  int i, ret;

  mtrace ();
  for (i = 0; i < 100; i++)
    {
      memset (&hints, 0, sizeof (hints));
      hints.ai_family = PF_UNSPEC;
      hints.ai_socktype = SOCK_STREAM;

      ret = getaddrinfo ("www.gnu.org", "http", &hints, &res);

      if (ret)
	FAIL_EXIT1 ("%s\n", gai_strerror (ret));

      freeaddrinfo (res);
    }
  return 0;
}

#include <support/test-driver.c>