/* Sig alarm */

20/10/2010 22:48

/* signals calls the alaram every 3 s */
#include <stdio.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<fcntl.h>
#include<signal.h>
int main()
{
void ex();
alarm(3);
signal(SIGALRM,ex);
while(1)
{
}
}
void ex()
{
printf("\n auto save in progress ");
alarm(3);
signal(SIGALRM,ex);
}

Bookmark and Share

Done by Aarya