LIB_PRIVATE
void *_real_dlsym ( void *handle, const char *symbol ) {
  static dlsym_fnptr_t _libc_dlsym_fnptr = NULL;
  if (_libc_dlsym_fnptr == NULL) {
    _libc_dlsym_fnptr = (dlsym_fnptr_t) dmtcp_get_libc_dlsym_addr();
  }

  return (void*) (*_libc_dlsym_fnptr) ( handle, symbol );
}
Exemplo n.º 2
0
LIB_PRIVATE
void *_real_dlsym ( void *handle, const char *symbol ) {
  typedef void* ( *fncptr ) (void *handle, const char *symbol);
  fncptr dlsym_fptr = NULL;

  if (dlsym_fptr == 0) {
    dlsym_fptr = dmtcp_get_libc_dlsym_addr();
    if (dlsym_fptr == NULL) {
      fprintf(stderr, "DMTCP: Internal Error: Not Reached\n");
      abort();
    }
  }

  return (*dlsym_fptr) ( handle, symbol );
}
Exemplo n.º 3
0
LIB_PRIVATE
void *_real_dlsym (void *handle, const char *symbol) {
  static dlsym_fnptr_t _libc_dlsym_fnptr = NULL;
  if (_libc_dlsym_fnptr == NULL) {
    _libc_dlsym_fnptr = dmtcp_get_libc_dlsym_addr();
  }

#if TRACK_DLOPEN_DLSYM_FOR_LOCKS
  // Avoid calling WRAPPER_EXECUTION_DISABLE_CKPT() in calloc() wrapper. See
  // comment in miscwrappers for more details.
  // EDIT: Now that we are using pthread_getspecific trick, calloc will not be
  // called and so we do not need to disable locking for calloc.
  dmtcp_setThreadPerformingDlopenDlsym();
#endif
  void *res = (*_libc_dlsym_fnptr) (handle, symbol);
#if TRACK_DLOPEN_DLSYM_FOR_LOCKS
  dmtcp_unsetThreadPerformingDlopenDlsym();
#endif
  return res;
}