aboutsummaryrefslogtreecommitdiffstats
path: root/sdk/dev/xmit.c
blob: 471736da6683377399c9dc8f05e2886bf960d7a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Write output to a device and ignore any incoming (echo) data.
 * $Id$
 * Copyright (c) 1997 by Tycho Softworks.
 * For conditions of distribution and reuse see product license.
 */

#include <dev/tty.h>

int	xmit(int fd, char *str)
{
	int	len = strlen(str);
	int	stat;

	while(inkey(fd, 2) > -1)
		continue;

	stat = write(fd, str, len);
	if(stat < 0)
		return stat;

	len = stat;
	while(len--)
		if(inkey(fd, 0) < 0)
			break;

	return stat;
}