|
|
1.1 root 1: #include <stdio.h>
2: #include <sgtty.h>
3: #include <assert.h>
4:
5: main()
6: {
7: struct sgttyb sbuf;
8: char dbuf[512];
9: int fd, n;
10:
11: fd = open ("/dev/weather", 0);
12: assert (fd >= 0);
13: assert (gtty(fd, &sbuf) >= 0);
14: sbuf.sg_ispeed = sbuf.sg_ospeed = B1200;
15: sbuf.sg_flags &= ~(ECHO|RAW);
16: assert (stty(fd, &sbuf) >= 0);
17: ioctl(fd, TIOCEXCL, 0);
18:
19: for(;;) {
20: n = read (fd, dbuf, 512);
21: write (1, dbuf, n);
22: }
23: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.