Back to index

glibc  2.9
Functions
tst-pathopt.c File Reference
#include <dlfcn.h>
#include <mcheck.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 8 of file tst-pathopt.c.

{
  void *h;
  int (*fp) (int);
  int result;

  mtrace ();

  h = dlopen ("renamed.so", RTLD_LAZY);
  if (h == NULL)
    {
      printf ("failed to load \"%s\": %s\n", "renamed.so", dlerror ());
      exit (1);
    }

  fp = dlsym (h, "in_renamed");
  if (fp == NULL)
    {
      printf ("lookup of \"%s\" failed: %s\n", "in_renamed", dlerror ());
      exit (1);
    }

  result = fp (10);

  if (dlclose (h) != 0)
    {
      printf ("failed to close \"%s\": %s\n", "renamed.so", dlerror ());
      exit (1);
    }

  return result;
}

Here is the call graph for this function: