sorry friends i forgot to give u the rest of the code where i have used a wait .
i had given wait with a parameter ie wait();
there ocured a segmentation fault because of this .
then i tried wait(NULL); it worked
but tell me what is the difference btw these .
anyway thanks for ur effort .
if u would like to see the whole code here it is :
CODE
-----
#include<stdio.h>
#include<signal.h>
#include<time.h>
#include<unistd.h>
#include<errno.h>
#include<stdlib.h>
#include "/home/ipcpe/process/lib/ERR_logerror.c"
#define CONFIG "/home/ipcpe/process/config.ini"
#define YES 1
#define NO 0
#define TRUE 1
#define FALSE 0
/*********Global Variables ***********/
int CDRcoll_pid = -1; /* pid of the get process */
int CDRdaemon_pid; /* pid of this daemon */
FILE *fp1;
/******************Function Declaration *******************/
int collt();
void sigtrap();
void sigcld();
void sigalrm();
main()
{
char *ptr,*getenv();
char c;
int sig,i;
/********** Change to the root ************/
chdir("/"

;
/************ Mask the file permissions*******/
umask(0);
/**************** set the effective gid and pid *************/
setpgrp();
/**********The Following Signals are ignored *********/
signal(SIGHUP,SIG_IGN);
signal(SIGINT,SIG_IGN);
signal(SIGQUIT,SIG_IGN);
/***********For the following Signals execute sigtrap ************/
signal(SIGILL,sigtrap);
signal(SIGIO,sigtrap);
signal(SIGIOT,sigtrap);
signal(SIGPOLL,sigtrap);
signal(SIGCLD,sigcld);
signal(SIGALRM,sigalrm);
while(1)
{
/*
fp1=fopen("/home/ipcpe/process/test","r"

;
if(fp1==NULL)
{
printf("Error opening file \n"

;
exit(1);
}
rewind(fp1);
for(c=fgetc(fp1); !feof(fp1) && c != '=';c=fgetc(fp1));
fscanf(fp1,"%d",&i);
fclose(fp1);
*/
if( ( ptr = getenv("TIME"

) == (char *) 0)
{
printf("TIME is not defined \n"

;
}
else
{
i=atoi(ptr);
printf("%d\n",i);
}
alarm(i);
sleep(i);
}
}
void sigtrap(int sig )
{
}
void sigcld()
{
}
void sigalrm(int sig)
{
static int k=0;
if((CDRcoll_pid = fork()) == -1)
{
ERR_LOGERROR("7000",errno,""

;
exit(1);
}
if(CDRcoll_pid == 0)
{
execl("/home/ipcpe/process/get",(char *)0,(char *)0);
ERR_LOGERROR("7001",errno,""

;
exit(1);
}
k=k+1;
printf("waiting for child to die for %d time \n",k);
wait(NULL);
printf(" child is dead for %d time \n",k);
return;
}