home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!news.udel.edu!brahms.udel.edu!stern
- From: stern@brahms.udel.edu (Garland Stern)
- Newsgroups: comp.sys.sun.misc
- Subject: HELP! Can't read /dev/ttya on 386i
- Message-ID: <Bsz9vq.AFB@news.udel.edu>
- Date: 14 Aug 92 14:35:50 GMT
- Sender: usenet@news.udel.edu
- Distribution: usa
- Organization: University of Delaware
- Lines: 37
- Nntp-Posting-Host: brahms.udel.edu
-
- I am trying to read /dev/ttya in order to transfer data
- from an obsolete machine. The following code fragment is the
- offender:
-
- ttf = open("/dev/ttya", O_RDWR);
- if (ttf < 0) {
- printf("Can't open /dev/ttya!\n");
- exit(-1);
- }
- ioctl(ttf, TCGETS, &pdpstat);
- pdpstat.c_iflag = IGNBRK | IGNPAR | IXON | IXOFF;
- pdpstat.c_oflag = ONLCR | NL1 | CR3;
- pdpstat.c_cflag = B9600 | CS7 | CLOCAL | PARENB;
- pdpstat.c_lflag &= ~(ICANON | ECHO | ISIG);
- pdpstat.c_cc[VMIN] = 1;
- ioctl(ttf, TCSETS, &pdpstat);
- for ( ; ; ) {
- n = read(ttf, buf, sizeof buf);
- prbuf(buf, n);
- }
-
- Writing is not a problem - chars written to ttf make it to
- the other end OK.
-
- I'm sure the hardware works - an identical terminal emulator
- running on the sun and a pc works just fine in both directions.
-
- Could there be some hidden process which is also reading
- /dev/ttya? (/etc/ttys, /etc/ttytab, and /etc/gettytab all
- have ttya disabled).
-
- One curious thing - once /dev/ttya is open the owner and
- permissions do not change.
-
- Thanks in advance for restoring my sanity
-
- (post replies or email to stern@medsci.udel.edu)
-