root/plugin/ipc/event/eventconnlist.cpp

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. dmtcp_EventConnList_EventHook
  2. dmtcp_EventConn_ProcessFdEvent
  3. instance
  4. createDummyConnection

   1 #include <unistd.h>
   2 #include <sys/syscall.h>
   3 #include "eventconnection.h"
   4 #include "eventconnlist.h"
   5 
   6 using namespace dmtcp;
   7 void dmtcp_EventConnList_EventHook(DmtcpEvent_t event, DmtcpEventData_t *data)
   8 {
   9   EventConnList::instance().eventHook(event, data);
  10 }
  11 
  12 void dmtcp_EventConn_ProcessFdEvent(int event, int arg1, int arg2)
  13 {
  14   if (event == SYS_close) {
  15     EventConnList::instance().processClose(arg1);
  16   } else if (event == SYS_dup) {
  17     EventConnList::instance().processDup(arg1, arg2);
  18   } else {
  19     JASSERT(false);
  20   }
  21 }
  22 
  23 
  24 static EventConnList *eventConnList = NULL;
  25 EventConnList& EventConnList::instance()
  26 {
  27   if (eventConnList == NULL) {
  28     eventConnList = new EventConnList();
  29   }
  30   return *eventConnList;
  31 }
  32 
  33 Connection *EventConnList::createDummyConnection(int type)
  34 {
  35   switch (type) {
  36 #ifdef HAVE_SYS_EPOLL_H
  37     case Connection::EPOLL:
  38       return new EpollConnection(5); //dummy val
  39       break;
  40 #endif
  41 
  42 #ifdef HAVE_SYS_EVENTFD_H
  43     case Connection::EVENTFD:
  44       return new EventFdConnection(0, 0); //dummy val
  45       break;
  46 #endif
  47 
  48 #ifdef HAVE_SYS_SIGNALFD_H
  49     case Connection::SIGNALFD:
  50       return new SignalFdConnection(0, NULL, 0); //dummy val
  51       break;
  52 #endif
  53 
  54 #ifdef HAVE_SYS_INOTIFY_H
  55 #ifdef DMTCP_USE_INOTIFY
  56     case Connection::INOTIFY:
  57       return new InotifyConnection(0);
  58       break;
  59 #endif
  60 #endif
  61   }
  62   return NULL;
  63 }

/* [<][>][^][v][top][bottom][index][help] */