Back to index

glibc  2.9
Defines | Functions | Variables
vismain.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "vismod.h"
#include <test-skeleton.c>

Go to the source code of this file.


#define TEST_FUNCTION   do_test ()


int do_test (void)
int protlocal (void)


const char * protvarlocal = __FILE__
const char * protvarinmod
const char * protvaritcpt

Define Documentation

#define TEST_FUNCTION   do_test ()

Definition at line 28 of file vismain.c.

Function Documentation

int do_test ( void  )

Definition at line 41 of file glrefmain.c.

  void *d1;
  void *d2;
  int (*f) (void);

  d1 = load ("");
  d2 = load ("");

  f = dlsym (d2, "ref2");
  if (f == NULL)
    error (EXIT_FAILURE, errno, "cannot get pointer to `%s'", "ref2");

  if (f () != 42)
    error (EXIT_FAILURE, 0, "wrong result from `%s'", "ref2");

  puts ("Correct result in first call");
  fflush (stdout);

  /* Now unload the first file.  */
  dlclose (d1);

  puts ("About to call the second time");
  fflush (stdout);

  /* Try calling the function again.  */
  if (f () != 42)
    error (EXIT_FAILURE, 0, "wrong result from `%s' (second call)", "ref2");

  puts ("Second call succeeded!");
  fflush (stdout);

  dlclose (d2);

  puts ("glreflib2 also closed");
  fflush (stdout);

  return 0;
int protlocal ( void  )

Definition at line 254 of file vismain.c.

  return 0x1;

Here is the caller graph for this function:

Variable Documentation

Definition at line 88 of file vismod1.c.

Definition at line 97 of file vismod1.c.

const char* protvarlocal = __FILE__

Definition at line 37 of file vismain.c.