/* Copyright (c) 2001-2009 by SoftIntegration, Inc. All Rights Reserved */
/* this is a sample that use alarm */
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
void alarmHandler();

int main()
{
    unsigned int sec = 5; 

    signal(SIGALRM, alarmHandler);
    alarm(sec);
    sleep(sec*2);
}

void alarmHandler()
{
    printf("Alarm 5 seconds\n");
    exit(0);
}
   

