root/dmtcp_nocheckpoint.c
/* [<][>][^][v][top][bottom][index][help] */
DEFINITIONS
This source file includes following definitions.
- main
1 /****************************************************************************
2 * Copyright (C) 2006-2010 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 DMTCP. *
6 * *
7 * DMTCP 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 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 //compile with: gcc -o dmtcp_nocheckpoint -static dmtcp_nocheckpoint.cpp
23 #include <stdio.h>
24 #include <errno.h>
25 #include <stdlib.h>
26 #include <unistd.h>
27 #include "protectedfds.h"
28
29 int main(int argc, char** argv) {
30 unsetenv("LD_PRELOAD");
31 if(argc==1){
32 fprintf(stderr, "USAGE: %s cmd ...\n", argv[0]);
33 return 1;
34 }
35 size_t fd;
36 for (fd = PROTECTED_FD_START; fd < PROTECTED_FD_END; fd++) {
37 close(fd);
38 }
39 execvp(argv[1], argv+1);
40 perror("execvp:");
41 return 2;
42 }