Back to index

glibc  2.9
Classes | Defines | Functions
dlopen.c File Reference
#include <dlfcn.h>
#include <libintl.h>
#include <stddef.h>
#include <unistd.h>
#include <ldsodefs.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dlopen_args

Defines

#define NS   LM_ID_BASE

Functions

static void dlopen_doit (void *a)
void * __dlopen (const char *file, int mode DL_CALLER_DECL)

Class Documentation

struct dlopen_args

Definition at line 37 of file dlopen.c.

Class Members
const void * caller
const char * file
int mode
void * new

Define Documentation

#define NS   LM_ID_BASE

Definition at line 53 of file dlopen.c.


Function Documentation

void* __dlopen ( const char *  file,
int mode  DL_CALLER_DECL 
)

Definition at line 75 of file dlopen.c.

{
# ifdef SHARED
  if (__builtin_expect (_dlfcn_hook != NULL, 0))
    return _dlfcn_hook->dlopen (file, mode, DL_CALLER);
# endif

  struct dlopen_args args;
  args.file = file;
  args.mode = mode;
  args.caller = DL_CALLER;

# ifdef SHARED
  return _dlerror_run (dlopen_doit, &args) ? NULL : args.new;
# else
  if (_dlerror_run (dlopen_doit, &args))
    return NULL;

  __libc_register_dl_open_hook ((struct link_map *) args.new);
  __libc_register_dlfcn_hook ((struct link_map *) args.new);

  return args.new;
# endif
}

Here is the call graph for this function:

static void dlopen_doit ( void *  a) [static]

Definition at line 58 of file dlopen.c.

{
  struct dlopen_args *args = (struct dlopen_args *) a;

  if (args->mode & ~(RTLD_BINDING_MASK | RTLD_NOLOAD | RTLD_DEEPBIND
                   | RTLD_GLOBAL | RTLD_LOCAL | RTLD_NODELETE
                   | __RTLD_SPROF))
    GLRO(dl_signal_error) (0, NULL, NULL, _("invalid mode parameter"));

  args->new = GLRO(dl_open) (args->file ?: "", args->mode | __RTLD_DLOPEN,
                          args->caller,
                          args->file == NULL ? LM_ID_BASE : NS,
                          __dlfcn_argc, __dlfcn_argv, __environ);
}

Here is the caller graph for this function: