[SOLVED] CS #include

$25

File Name: CS_#include.zip
File Size: 103.62 KB

5/5 - (1 vote)

#include
#include
#include

void alarm_handler(int signum)
{
printf(
Beep, beep, beep!
);
}

int main(void)
{
struct sigaction sa;
sigset_t ss;

/* Ignore Ctrl-C */
sigemptyset(&ss);
sigaddset(&ss, SIGINT);
sigprocmask(SIG_BLOCK, &ss, NULL);

/* Set up handler for alarm */
sa.sa_handler = alarm_handler;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGALRM, &sa, NULL);

/* Configure alarm */
printf(Alarm in 5 seconds
);
alarm(5);

/* Wait until signal is received */
pause();

/* Bye, ungrateful world */
raise(SIGKILL);

return 0;
}

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] CS #include
$25