File: environ.c

package info (click to toggle)
dmtcp 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,496 kB
  • sloc: cpp: 33,592; ansic: 28,099; sh: 6,735; makefile: 1,950; perl: 1,690; python: 1,241; asm: 138; java: 13
file content (18 lines) | stat: -rw-r--r-- 372 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

int main() {
  int counter = 0;
  setenv("ABC", "abc", 1);
  while (1) {
    if (counter++ % 1000000 == 0) {
      printf("b"); fflush(stdout);
    }
    if (strcmp(getenv("ABC"), "abc") != 0) {
      printf("\nEnvironment was not preserved across checkpoint/restart.\n");
      exit(1);
    }
  }
  return 0;
}