Back to index

cell-binutils  2.17cvs20070401
Functions | Variables
dl6cmain.c File Reference
#include <stdio.h>
#include <dlfcn.h>

Go to the source code of this file.

Functions

int main (void)

Variables

int bar = -20

Function Documentation

int main ( void  )

Definition at line 7 of file dl6cmain.c.

{
  int ret = 0;
  void *handle;
  void (*fcn) (void);

  handle = dlopen("./tmpdir/libdl6c.so", RTLD_GLOBAL|RTLD_LAZY);
  if (!handle)
    {
      printf("dlopen ./tmpdir/libdl6c.so: %s\n", dlerror ());
      return 1;
    }

  fcn = (void (*)(void)) dlsym(handle, "foo");
  if (!fcn)
    {
      printf("dlsym foo: %s\n", dlerror ());
      ret += 1;
    }
  else
    {
      (*fcn) ();
    }

  dlclose (handle);
  return ret;
}

Here is the call graph for this function:


Variable Documentation

int bar = -20

Definition at line 4 of file dl6cmain.c.