ack/util/int/test/sig.c
1994-06-24 11:31:16 +00:00

28 lines
328 B
C

/* $Id$ */
#include <signal.h>
/* testing signal(SIGINT, vang) */
int handler();
main()
{
char *ch = "a\n";
signal( SIGINT, handler );
while(1) {
write(1, ch, 2);
ch[0]++;
if (ch[0] > 'z')
ch[0] = 'a';
}
}
handler()
{
/* vang CTRL-C op */
write( 1, "Heb um gevangen\n", 16 );
signal( SIGINT, handler );
}