1 #include <u.h> 2 #include <libc.h> 3 4 void ding(void *,char * s)5ding(void*, char *s) 6 { 7 if(strstr(s, "alarm")) 8 noted(NCONT); 9 else 10 noted(NDFLT); 11 } 12 13 void main(void)14main(void) 15 { 16 char buf[256]; 17 18 alarm(100); 19 while(read(0, buf, sizeof(buf)) > 0) 20 ; 21 alarm(0); 22 exits(0); 23 } 24