/* [<][>][^][v][top][bottom][index][help] */
1 /****************************************************************************
2 * Copyright (C) 2006-2013 by Jason Ansel, Kapil Arya, and Gene Cooperman *
3 * jansel@csail.mit.edu, kapil@ccs.neu.edu, 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 DMTCP_IPC_H
24 #define DMTCP_IPC_H
25
26 #include <dirent.h>
27 #include <sys/types.h>
28 #include <linux/version.h>
29 #include "dmtcp.h"
30
31 #define HANDSHAKE_SIGNATURE_MSG "DMTCP_SOCK_HANDSHAKE_V0\n"
32 #define CONNECTION_ID_START 99000
33
34 #define DEV_ZERO_DELETED_STR "/dev/zero (deleted)"
35 #define DEV_NULL_DELETED_STR "/dev/null (deleted)"
36
37 #define DRAINER_CHECK_FREQ 0.1
38 #define DRAINER_WARNING_FREQ 10
39
40 //at least one of these must be enabled:
41 #define HANDSHAKE_ON_CONNECT 0
42 #define HANDSHAKE_ON_CHECKPOINT 1
43
44 #define _real_socket NEXT_FNC(socket)
45 #define _real_bind NEXT_FNC(bind)
46 #define _real_close NEXT_FNC(close)
47 #define _real_fclose NEXT_FNC(fclose)
48 #define _real_closedir NEXT_FNC(closedir)
49 #define _real_dup NEXT_FNC(dup)
50 #define _real_dup2 NEXT_FNC(dup2)
51 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)) && __GLIBC_PREREQ(2,9)
52 #define _real_dup3 NEXT_FNC(dup3)
53 #endif
54
55 #define _real_fcntl NEXT_FNC(fcntl)
56 #define _real_select NEXT_FNC(select)
57 #define _real_pthread_mutex_lock NEXT_FNC(pthread_mutex_lock)
58 #define _real_pthread_mutex_unlock NEXT_FNC(pthread_mutex_unlock)
59
60 #endif