extern "C" pid_t getpid()
{
  if (_dmtcp_pid == -1) {
    dmtcpResetPidPpid();
  }
  return _dmtcp_pid;
}
extern "C" pid_t getppid()
{
  if (_dmtcp_ppid == -1) {
    dmtcpResetPidPpid();
  }
  if (_real_getppid() == 1) {
    _dmtcp_ppid = 1;
  }
  return _dmtcp_ppid;
}
static void pidVirt_pthread_atfork_child()
{
  dmtcpResetPidPpid();
  dmtcpResetTid(getpid());
  dmtcp::VirtualPidTable::instance().resetOnFork();
}