public
/
Ack-5.5.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Pristine Ack-5.5
[Ack-5.5.git]
/
util
/
int
/
test
/
sig.c
1
/* $Id: sig.c,v 1.2 1994/06/24 10:51:03 ceriel Exp $ */
2
3
#include <signal.h>
4
5
/* testing signal(SIGINT, vang) */
6
7
int handler();
8
9
main()
10
{
11
char *ch = "a\n";
12
13
signal( SIGINT, handler );
14
while(1) {
15
write(1, ch, 2);
16
ch[0]++;
17
if (ch[0] > 'z')
18
ch[0] = 'a';
19
}
20
}
21
22
handler()
23
{
24
/* vang CTRL-C op */
25
write( 1, "Heb um gevangen\n", 16 );
26
signal( SIGINT, handler );
27
}