Esempio n. 1
0
void *_dmtcp_pthread_getspecific(pthread_key_t key)
{
  if (!dmtcp_wrappers_initializing) {
    fprintf(stderr, "DMTCP INTERNAL ERROR\n\n");
    abort();
  }
  pthread_setspecific(key, wrapper_init_buf);
  UNINSTALL_TRAMPOLINE(pthread_getspecific_trampoline_info);
  return pthread_getspecific(key);
}
Esempio n. 2
0
/* Calls to mmap will land here. */
static void *mmap_trampoline(void *addr, size_t length, int prot,
                             int flags, int fd, off_t offset)
{
  /* Interesting note: we get the arguments set up for free, since mmap is
     patched to jump directly to this function. */
  /* Unpatch mmap. */
  UNINSTALL_TRAMPOLINE(mmap_trampoline_info);
  /* Call mmap mini trampoline, which will eventually call _real_mmap. */
  void *retval = mmap_wrapper(addr,length,prot,flags,fd,offset);
  /* Repatch mmap. */
  INSTALL_TRAMPOLINE(mmap_trampoline_info);
  return retval;
}