File:  [Research Unix] / researchv10no / cmd / weather / weather_read.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:35 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Norman

#include <stdio.h>
#include <sgtty.h>
#include <assert.h>

main()
{
	struct sgttyb sbuf;
	char dbuf[512];
	int fd, n;

	fd = open ("/dev/weather", 0);
	assert (fd >= 0);
	assert (gtty(fd, &sbuf) >= 0);
	sbuf.sg_ispeed = sbuf.sg_ospeed = B1200;
	sbuf.sg_flags &= ~(ECHO|RAW);
	assert (stty(fd, &sbuf) >= 0);
	ioctl(fd, TIOCEXCL, 0);

	for(;;) {
		n = read (fd, dbuf, 512);
		write (1, dbuf, n);
	}
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.