ack/util/int/test/sig.c

28 lines
332 B
C
Raw Normal View History

1988-06-24 15:40:41 +00:00
/* $Header$ */
#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 );
}