aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/chanprint.c
blob: af9e81033061329d811a58d8a46543ad2624a698 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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;
}