home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8236 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.1 KB  |  50 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!arumble
  3. From: arumble@extro.ucc.su.OZ.AU (Anthony Rumble)
  4. Subject: PTYP/TTYP programming.. 
  5. Message-ID: <arumble.713786641@extro.ucc.su.OZ.AU>
  6. Sender: news@ucc.su.OZ.AU
  7. Nntp-Posting-Host: extro.ucc.su.oz.au
  8. Organization: Sydney University Computing Service, Sydney, NSW, Australia
  9. Date: Fri, 14 Aug 1992 10:04:01 GMT
  10. Lines: 38
  11.  
  12. Im sure this is a common problem, but.. i have no information
  13. to help me with this..
  14.  
  15. I am writing a small client to do something, that uses PTYP/TTYP pairs..
  16.  
  17. The client opens the ttyp open("/dev/ttyp0", O_RDWR) etc etc
  18.  
  19. and then fdopen's two streams (one for input, one for output)..
  20.  
  21. well.. anything that is sent to /dev/ptyp0 for some reason
  22. ends up on the client twice!!?!?!
  23.  
  24. the client only does this as yet..
  25.  
  26. while(1)
  27.    {
  28.    ch = fgetc(datin)l
  29.    printf("%c", ch);
  30.    }
  31.  
  32. If in another VT.. I do this echo hello >/dev/ptyp0
  33.  
  34. I will get 
  35.  
  36. Hello
  37. Hello
  38.  
  39. I get it twice?!?!
  40.  
  41. Any ideas..
  42.  
  43. Thanx in advance
  44.  
  45.  
  46. -- 
  47. Anthony Rumble
  48. aka SmilieZ
  49. "Anything is possible.. If there is enuf money in it"
  50.