diff options
author | rsc <devnull@localhost> | 2003-09-30 17:47:42 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2003-09-30 17:47:42 +0000 |
commit | 76193d7cb0457807b2f0b95f909ab5de19480cd7 (patch) | |
tree | 97e538c7e38181431e90289a0fe8b6b7ce1f8f3c /src/libthread/chanprint.c | |
parent | ed7c8e8d02c02bdbff1e88a6d8d1419f39af48ad (diff) | |
download | plan9port-76193d7cb0457807b2f0b95f909ab5de19480cd7.tar.gz plan9port-76193d7cb0457807b2f0b95f909ab5de19480cd7.tar.bz2 plan9port-76193d7cb0457807b2f0b95f909ab5de19480cd7.zip |
Initial revision
Diffstat (limited to 'src/libthread/chanprint.c')
-rw-r--r-- | src/libthread/chanprint.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libthread/chanprint.c b/src/libthread/chanprint.c new file mode 100644 index 00000000..af9e8103 --- /dev/null +++ b/src/libthread/chanprint.c @@ -0,0 +1,18 @@ +#include "threadimpl.h" + +int +chanprint(Channel *c, char *fmt, ...) +{ + va_list arg; + char *p; + int n; + + va_start(arg, fmt); + p = vsmprint(fmt, arg); + va_end(arg); + if(p == nil) + sysfatal("vsmprint failed: %r"); + n = sendp(c, p); + yield(); /* let recipient handle message immediately */ + return n; +} |