FACT++  1.0
int main ( int  ,
char **   
)

Definition at line 44 of file dim_fork.cxx.

References dis_add_service, dis_start_serving, fork_em(), and run.

44  {
45  id = ::dis_add_service((char*)"Parent/run",(char*)"I",&run,sizeof(run),0,0);
46  // id_cmd = :: dis_add_cmnd((char *)"Parent/cmd",(char*)"C",handle_cmd,0);
47  ::dis_start_serving((char*)"Parent");
48  ::sleep(5);
49  pid_t child = 0;
50 
51  Again:
52  child = fork_em();
53  if ( child > 0 ) {
54  int status;
55  sleep(5);
56  kill(child,SIGTERM);
57  wait(&status);
58  sleep(1);
59  goto Again;
60  }
61 
62  while(1)
63  {
64  /*
65  if(doForkNow)
66  {
67  int status;
68  doForkNow = 0;
69  if(child > 0)
70  {
71  kill(child,SIGTERM);
72  wait(&status);
73  sleep(1);
74  }
75  child = fork_em();
76  }
77  */
78  ::sleep(1);
79  }
80  return 1;
81 }
static pid_t fork_em()
Definition: dim_fork.cxx:17
#define dis_start_serving
Definition: dis.h:8
static int run
Definition: dim_fork.cxx:9
#define dis_add_service
Definition: dis.h:12

+ Here is the call graph for this function: