root/plugin/ipc/file/fileconnlist.h

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

INCLUDED FROM


   1 /****************************************************************************
   2  *   Copyright (C) 2006-2013 by Jason Ansel, Kapil Arya, and Gene Cooperman *
   3  *   jansel@csail.mit.edu, kapil@ccs.neu.edu, and gene@ccs.neu.edu          *
   4  *                                                                          *
   5  *   This file is part of the dmtcp/src module of DMTCP (DMTCP:dmtcp/src).  *
   6  *                                                                          *
   7  *  DMTCP:dmtcp/src is free software: you can redistribute it and/or        *
   8  *  modify it under the terms of the GNU Lesser General Public License as   *
   9  *  published by the Free Software Foundation, either version 3 of the      *
  10  *  License, or (at your option) any later version.                         *
  11  *                                                                          *
  12  *  DMTCP:dmtcp/src is distributed in the hope that it will be useful,      *
  13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of          *
  14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
  15  *  GNU Lesser General Public License for more details.                     *
  16  *                                                                          *
  17  *  You should have received a copy of the GNU Lesser General Public        *
  18  *  License along with DMTCP:dmtcp/src.  If not, see                        *
  19  *  <http://www.gnu.org/licenses/>.                                         *
  20  ****************************************************************************/
  21 
  22 #pragma once
  23 #ifndef FILECONNLIST_H
  24 #define FILECONNLIST_H
  25 
  26 // THESE INCLUDES ARE IN RANDOM ORDER.  LET'S CLEAN IT UP AFTER RELEASE. - Gene
  27 #include <sys/types.h>
  28 #include <sys/stat.h>
  29 #include <sys/types.h>
  30 #include <sys/socket.h>
  31 #include <unistd.h>
  32 #include <mqueue.h>
  33 #include <stdint.h>
  34 #include <signal.h>
  35 #include "jfilesystem.h"
  36 #include "jbuffer.h"
  37 #include "jconvert.h"
  38 #include "connectionlist.h"
  39 #include "fileconnection.h"
  40 
  41 namespace dmtcp
  42 {
  43   class FileConnList : public ConnectionList
  44   {
  45     public:
  46       static FileConnList& instance();
  47 
  48       virtual void preLockSaveOptions();
  49       virtual void drain();
  50       virtual void refill(bool isRestart);
  51       virtual void resume(bool isRestart);
  52       virtual void postRestart();
  53       virtual int protectedFd() { return PROTECTED_FILE_FDREWIRER_FD; }
  54       //examine /proc/self/fd for unknown connections
  55       virtual void scanForPreExisting();
  56       virtual Connection *createDummyConnection(int type);
  57 
  58       Connection *findDuplication(int fd, const char *path);
  59       void processFileConnection(int fd, const char *path, int flags, mode_t mode);
  60 
  61       void prepareShmList();
  62       void remapShmMaps();
  63       void recreateShmFileAndMap(const ProcMapsArea& area);
  64       void restoreShmArea(const ProcMapsArea& area, int fd = -1);
  65 
  66   };
  67 }
  68 #endif

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