drain.c 241 B

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