10 fprint(2, "usage: %s [-q]\n", argv0);
17 if(strstr(s, "alarm")){
26 main(int argc, char **argv)
41 fd = open("/dev/cons", ORDWR);
43 sysfatal("opening /dev/cons: %r");
44 cfd = open("/dev/consctl", OWRITE);
48 switch(rfork(RFPROC|RFFDG|RFMEM)){
50 sysfatal("forking: %r");
52 // read until we're done writing or
53 // we get an end of line
68 if(!quiet && write(fd, buf, 1) < 1)
70 if(buf[0] == '\n' || buf[0] == '\r')
75 // pass one character at a time till end of line
77 if(read(fd, buf, 1) <= 0)
79 if(write(1, buf, 1) < 0)
81 if(buf[0] == '\n' || buf[0] == '\r')
85 // tell reader to give up after next char