Back to index

glibc  2.9
Functions
tst-_res1.c File Reference
#include <pthread.h>
#include <resolv.h>
#include <stdlib.h>
#include <stdio.h>

Go to the source code of this file.

Functions

void * tf (void *resp)
void do_test (struct __res_state *resp)
int main (void)

Function Documentation

void do_test ( struct __res_state resp)

Definition at line 37 of file tst-_res1.c.

{
  if (resp != &_res || resp != __res_state ())
    abort ();
  if (_res.retry != 12)
    abort ();
}

Here is the call graph for this function:

int main ( void  )

Definition at line 45 of file tst-_res1.c.

{
#undef _res
  extern struct __res_state _res;
  pthread_t th;

  _res.retry = 12;
  if (pthread_create (&th, NULL, tf, &_res) != 0)
    {
      puts ("create failed");
      exit (1);
    }

  do_test (&_res);

  if (pthread_join (th, NULL) != 0)
    {
      puts ("join failed");
      exit (1);
    }

  do_test (&_res);

  exit (0);
}

Here is the call graph for this function:

void* tf ( void *  resp)

Definition at line 29 of file tst-_res1.c.

{
  if (resp == &_res || resp == __res_state ())
    abort ();
  _res.retry = 24;
  return NULL;
}

Here is the call graph for this function: