[Ilugc] C pgm - Recursive -segmentation fault

  • From: lug@xxxxxxxxxxxxxxxxxx (Chandrashekar Babu)
  • Date: Mon Sep 13 23:50:41 2004

void R()
{
    static int i =0;
    i++;
    printf("%d\n",i); 
}

int main()
{
  while(1)
    R();
}

This is what a daemon is.

What has daemons got to do with recursive/iterative constructs ? For all I 
know, this code isn't designed to run in the background on its own, it doesn't 
detached from the controlling terminal, and it also doesn't have any form of 
event-loop mechanism (which I believe are minimal requirements for calling a 
program a daemon).

Cheers,
Chandrashekar Babu.

Other related posts: