diff options
author | rsc <devnull@localhost> | 2004-11-08 16:04:01 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2004-11-08 16:04:01 +0000 |
commit | 24f4e66b12cf0501d0f239ade10b2963f46e6755 (patch) | |
tree | 6fb79980edf83c07bba66b7303dde8874c6d7e33 /src/libthread/tsignal.c | |
parent | cf4f3eafc6016ccdb57773215dcdd5ebac95c07d (diff) | |
download | plan9port-24f4e66b12cf0501d0f239ade10b2963f46e6755.tar.gz plan9port-24f4e66b12cf0501d0f239ade10b2963f46e6755.tar.bz2 plan9port-24f4e66b12cf0501d0f239ade10b2963f46e6755.zip |
still more files
Diffstat (limited to 'src/libthread/tsignal.c')
-rw-r--r-- | src/libthread/tsignal.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/libthread/tsignal.c b/src/libthread/tsignal.c new file mode 100644 index 00000000..9c64c46b --- /dev/null +++ b/src/libthread/tsignal.c @@ -0,0 +1,43 @@ +#include <u.h> +#include <libc.h> +#include <thread.h> + +extern int _threaddebuglevel; + +void +usage(void) +{ + fprint(2, "usage: tsignal [-[ednf] note]*\n"); + threadexitsall("usage"); +} + +void +threadmain(int argc, char **argv) +{ + Channel *c; + char *msg; + + ARGBEGIN{ + case 'D': + _threaddebuglevel = ~0; + break; + default: + usage(); + case 'e': + notifyenable(EARGF(usage())); + break; + case 'd': + notifydisable(EARGF(usage())); + break; + case 'n': + notifyon(EARGF(usage())); + break; + case 'f': + notifyoff(EARGF(usage())); + break; + }ARGEND + + c = threadnotechan(); + while((msg = recvp(c)) != nil) + print("note: %s\n", msg); +} |