root/orte/test/system/spin.c

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

DEFINITIONS

This source file includes following definitions.
  1. main

   1 /* -*- C -*-
   2  *
   3  * $HEADER$
   4  *
   5  * A program that just spins - provides mechanism for testing user-driven
   6  * abnormal program termination
   7  */
   8 
   9 #include <stdio.h>
  10 #include <unistd.h>
  11 
  12 int main(int argc, char* argv[])
  13 {
  14 
  15     int i, j=0;
  16     double pi;
  17     pid_t pid;
  18 
  19     pid = getpid();
  20 
  21     printf("spin: Pid %ld\n", (long)pid);
  22 
  23     i = 0;
  24     while (0 == j) {
  25         i++;
  26         pi = i / 3.14159256;
  27         if (i > 100) i = 0;
  28     }
  29 
  30     return 0;
  31 }

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