home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6442 < prev    next >
Encoding:
Internet Message Format  |  1992-07-22  |  1.8 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!caen!uvaarpa!murdoch!Turing.ORG!lfoard
  2. From: lfoard@Turing.ORG (Lawrence C. Foard)
  3. Newsgroups: comp.os.linux
  4. Subject: Re: Termios question: Semantics of VMIN/VTIME on Linux/SunOS ?
  5. Message-ID: <1992Jul22.213627.10041@murdoch.acc.Virginia.EDU>
  6. Date: 22 Jul 92 21:36:27 GMT
  7. References: <9207151400@gandalf.moria>
  8. Sender: usenet@murdoch.acc.Virginia.EDU
  9. Organization: The Turing Project, Charlottesville Virginia.
  10. Lines: 37
  11.  
  12. In article <9207151400@gandalf.moria> u31b3hs@pool.informatik.rwth-aachen.de (Michael Haardt) writes:
  13. >I have an weird problem:
  14. >
  15. >  struct termios buff;
  16. >
  17. >  tcgetattr(file,&buff);
  18. >  buff.c_lflag=0;
  19. >  cfsetispeed(&buff,B1200);
  20. >  buff.c_cc[VMIN]=5;
  21. >  buff.c_cc[VTIME]=1;
  22. >  tcsetattr(file,TCSANOW,&buff);
  23. >
  24. >I am no termios expert, but this code is intended to let a
  25. >
  26. >  read(file,buffer,sizeof(buffer));
  27. >  
  28. >read as much characters as available, max sizeof(buffer) and return
  29. >after a short timeout if there are none.  Ok?
  30. >
  31. >Well, at least that is what Linux 0.96c.pl1 does -- in contrary to SunOS
  32. >4.1.1, which blocks until sizeof(buffer) characters are read.
  33. >
  34. >Who is right?
  35.  
  36. I think Linux just ignores VMIN and VTIME, I had a problem with this
  37. porting code from Linux to sun OS. On linux I hadn't filled in those
  38. fields and got very weird behaviour on sun os :)
  39.  
  40. On the otherhand Linux is almost perfectly compatible, the port of 1000
  41. lines took 15 minutes most spent on this. On the otherhand the code when
  42. moved back to linux ran perfectly the first time.
  43.  
  44. -- 
  45. >>Unix/C Contract worker available 5 years C/unix work experience<<  ______
  46. Available for Telecommuting/Travel and contracts on the T Line       \    /
  47. in the Boston MA area. Send me e-mail for a copy of my Resume.        \  /
  48.        -- VWIS 508-793-9568 (2400 baud), Linux support BBS.--          \/
  49.