Commit d0149fe8 authored by Matthias Braun's avatar Matthias Braun
Browse files

more tricky endless loop stuff

[r21822]
parent b597c7fd
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <unistd.h>
int foo(int x)
{
while(x == 0)
;
return x;
}
int k;
void handler(int sig)
{
printf("ok\n");
_exit(0);
}
int main(void) {
alarm(1);
signal(SIGALRM, handler);
foo(0);
printf("endless loop returned!\n");
return 1;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment