home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / sun / misc / 3684 < prev    next >
Encoding:
Internet Message Format  |  1992-08-14  |  1.4 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!news.udel.edu!brahms.udel.edu!stern
  2. From: stern@brahms.udel.edu (Garland Stern)
  3. Newsgroups: comp.sys.sun.misc
  4. Subject: HELP! Can't read /dev/ttya on 386i
  5. Message-ID: <Bsz9vq.AFB@news.udel.edu>
  6. Date: 14 Aug 92 14:35:50 GMT
  7. Sender: usenet@news.udel.edu
  8. Distribution: usa
  9. Organization: University of Delaware
  10. Lines: 37
  11. Nntp-Posting-Host: brahms.udel.edu
  12.  
  13. I am trying to read /dev/ttya in order to transfer data
  14. from an obsolete machine.  The following code fragment is the
  15. offender:
  16.  
  17. ttf = open("/dev/ttya", O_RDWR);
  18. if (ttf < 0) {
  19.     printf("Can't open /dev/ttya!\n");
  20.     exit(-1);
  21.     }
  22. ioctl(ttf, TCGETS, &pdpstat);
  23. pdpstat.c_iflag = IGNBRK | IGNPAR | IXON | IXOFF;
  24. pdpstat.c_oflag = ONLCR | NL1 | CR3;
  25. pdpstat.c_cflag = B9600 | CS7 | CLOCAL | PARENB;
  26. pdpstat.c_lflag &= ~(ICANON | ECHO | ISIG);
  27. pdpstat.c_cc[VMIN] = 1;
  28. ioctl(ttf, TCSETS, &pdpstat);
  29.     for ( ; ; ) {
  30.         n = read(ttf, buf, sizeof buf);
  31.         prbuf(buf, n);
  32.         }
  33.  
  34. Writing is not a problem - chars written to ttf make it to
  35. the other end OK.
  36.  
  37. I'm sure the hardware works - an identical terminal emulator
  38. running on the sun and a pc works just fine in both directions.
  39.  
  40. Could there be some hidden process which is also reading
  41. /dev/ttya?  (/etc/ttys, /etc/ttytab, and /etc/gettytab all
  42. have ttya disabled).
  43.  
  44. One curious thing - once /dev/ttya is open the owner and
  45. permissions do not change.
  46.  
  47. Thanks in advance for restoring my sanity
  48.  
  49. (post replies or email to stern@medsci.udel.edu)
  50.