Back to index

glibc  2.9
Functions
errmsg1.c File Reference
#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Functions

int main (void)

Function Documentation

int main ( void  )

Definition at line 25 of file errmsg1.c.

{
  void *h;
  const char *s;

  /* Test that dlerror works initially.  */
  s = dlerror ();
  printf ("dlerror() without prior dl*() call returned: %s\n", s);
  if (s != NULL)
    return 1;

  h = dlopen ("errmsg1mod.so", RTLD_NOW);
  if (h != NULL)
    {
      dlclose (h);
      puts ("errmsg1mod.so could be loaded !?");
      exit (1);
    }

  s = dlerror ();
  puts (s);

  return strstr (s, "errmsg1mod.so") == NULL;
}

Here is the call graph for this function: